Skip to content
This repository was archived by the owner on Sep 19, 2018. It is now read-only.

Commit 067d5e6

Browse files
aygsideshowbarker
authored andcommitted
Add fold markers to new idlharness functions
In vim, these make the file much easier to navigate: function bodies are collapsed until you expand them (and zc recollapses them). I don't know if any other editors recognize them. Since the whole file uses them, we may as well be consistent.
1 parent 7716e25 commit 067d5e6

File tree

1 file changed

+24
-6
lines changed

1 file changed

+24
-6
lines changed

idlharness.js

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,19 @@ policies and contribution forms [3].
4949
(function(){
5050
"use strict";
5151
/// Helpers ///
52-
function constValue (cnt) {
52+
function constValue (cnt)
53+
//@{
54+
{
5355
if (cnt.type === "null") return null;
5456
if (cnt.type === "NaN") return NaN;
5557
if (cnt.type === "Infinity") return cnt.negative ? -Infinity : Infinity;
5658
return cnt.value;
5759
}
5860

59-
function minOverloadLength(overloads) {
61+
//@}
62+
function minOverloadLength(overloads)
63+
//@{
64+
{
6065
if (!overloads.length) {
6166
return 0;
6267
}
@@ -69,7 +74,10 @@ function minOverloadLength(overloads) {
6974
.reduce(function(m, n) { return Math.min(m, n); });
7075
}
7176

72-
function throwOrReject(a_test, operation, fn, obj, args, message, cb) {
77+
//@}
78+
function throwOrReject(a_test, operation, fn, obj, args, message, cb)
79+
//@{
80+
{
7381
if (operation.idlType.generic !== "Promise") {
7482
assert_throws(new TypeError(), function() {
7583
fn.apply(obj, args);
@@ -87,7 +95,10 @@ function throwOrReject(a_test, operation, fn, obj, args, message, cb) {
8795
}
8896
}
8997

90-
function awaitNCallbacks(n, cb, ctx) {
98+
//@}
99+
function awaitNCallbacks(n, cb, ctx)
100+
//@{
101+
{
91102
var counter = 0;
92103
return function() {
93104
counter++;
@@ -97,7 +108,10 @@ function awaitNCallbacks(n, cb, ctx) {
97108
};
98109
}
99110

100-
var fround = (function(){
111+
//@}
112+
var fround =
113+
//@{
114+
(function(){
101115
if (Math.fround) return Math.fround;
102116

103117
var arr = new Float32Array(1);
@@ -106,6 +120,7 @@ var fround = (function(){
106120
return arr[0];
107121
};
108122
})();
123+
//@}
109124

110125
/// IdlArray ///
111126
// Entry point
@@ -650,7 +665,9 @@ function IdlDictionary(obj)
650665
IdlDictionary.prototype = Object.create(IdlObject.prototype);
651666

652667
/// IdlInterface ///
653-
function IdlInterface(obj, is_callback) {
668+
function IdlInterface(obj, is_callback)
669+
//@{
670+
{
654671
/**
655672
* obj is an object produced by the WebIDLParser.js "interface" production.
656673
*/
@@ -687,6 +704,7 @@ function IdlInterface(obj, is_callback) {
687704

688705
this._is_callback = is_callback;
689706
}
707+
//@}
690708
IdlInterface.prototype = Object.create(IdlObject.prototype);
691709
IdlInterface.prototype.is_callback = function()
692710
//@{

0 commit comments

Comments
 (0)