function core(source, options) { return typeof source === 'string' ? fromSource(source, options) : fromAST(source); }
...
a more detailed description can be found below.
```js
/**
* This replaces every occurence of variable "foo".
*/
module.exports = function(fileInfo, api) {
return api.jscodeshift(fileInfo.source)
.findVariableDeclarators('foo')
.renameTo('bar')
.toSource();
}
```
**Note:** This api is exposed for convenience, but you don't have to use it.
...
anyTypeAnnotation = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
arrayExpression = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
arrayPattern = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
arrayStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
arrayTypeAnnotation = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
arrowFunctionExpression = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
arrowFunctionStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
assignmentExpression = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
assignmentPattern = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
assignmentStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
awaitExpression = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
awaitStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
binaryExpression = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
binaryStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
bindExpression = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
bindStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
block = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
blockStatement = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
booleanLiteral = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
booleanLiteralStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
booleanLiteralTypeAnnotation = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
booleanTypeAnnotation = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
breakStatement = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
callExpression = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
...
For example, the following creates an AST equivalent to `foo(bar)`:
```js
// inside a module transform
var j = jscodeshift;
// foo(bar);
var ast = j.callExpression(
j.identifier('foo'),
[j.identifier('bar')]
);
```
The signature of each builder function is best learned by having a look at the
[definition files](https://github.com/benjamn/ast-types/blob/master/def/).
...
callStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
catchClause = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
classBody = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
classDeclaration = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
classExpression = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
classImplements = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
classMethod = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
classProperty = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
classPropertyDefinition = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
classStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
commentBlock = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
commentLine = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
comprehensionBlock = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
comprehensionExpression = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
comprehensionStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
conditionalExpression = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
conditionalStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
continueStatement = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
debuggerStatement = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
declareClass = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
declareExportAllDeclaration = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
declareExportDeclaration = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
declareFunction = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
declareInterface = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
declareModule = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
declareModuleExports = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
declareTypeAlias = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
declareVariable = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
decorator = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
directive = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
directiveLiteral = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
directiveLiteralStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
doExpression = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
doStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
doWhileStatement = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
emptyStatement = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
emptyTypeAnnotation = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
existentialTypeParam = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
existsTypeAnnotation = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
exportAllDeclaration = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
exportBatchSpecifier = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
exportDeclaration = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
exportDefaultDeclaration = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
exportDefaultSpecifier = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
exportNamedDeclaration = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
exportNamespaceSpecifier = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
exportSpecifier = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
expressionStatement = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
file = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
forAwaitStatement = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
forInStatement = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
forOfStatement = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
forStatement = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
functionDeclaration = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
functionExpression = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
functionStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
functionTypeAnnotation = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
functionTypeParam = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
generatorExpression = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
generatorStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
genericTypeAnnotation = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
graphExpression = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
graphIndexExpression = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
graphIndexStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
graphStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
identifier = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
...
For example, the following creates an AST equivalent to `foo(bar)`:
```js
// inside a module transform
var j = jscodeshift;
// foo(bar);
var ast = j.callExpression(
j.identifier('foo'),
[j.identifier('bar')]
);
```
The signature of each builder function is best learned by having a look at the
[definition files](https://github.com/benjamn/ast-types/blob/master/def/).
...
identifierStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
ifStatement = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
import = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
importDeclaration = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
importDefaultSpecifier = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
importNamespaceSpecifier = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
importSpecifier = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
importStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
interfaceDeclaration = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
interfaceExtends = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
intersectionTypeAnnotation = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
jsxAttribute = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
jsxClosingElement = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
jsxElement = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
jsxElementStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
jsxEmptyExpression = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
jsxEmptyStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
jsxExpressionContainer = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
jsxExpressionContainerStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
jsxIdentifier = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
jsxIdentifierStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
jsxMemberExpression = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
jsxMemberStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
jsxNamespacedName = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
jsxOpeningElement = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
jsxSpreadAttribute = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
jsxText = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
jsxTextStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
labeledStatement = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
letExpression = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
letStatement = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
line = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
literal = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
literalStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
logicalExpression = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
logicalStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
function match(path, filter) { if (!(path instanceof NodePath)) { if (typeof path.get === 'function') { path = path.get(); } else { path = {value: path}; } } return matchNode(path.value, filter); }
n/a
memberExpression = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
memberStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
memberTypeAnnotation = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
metaProperty = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
metaPropertyStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
methodDefinition = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
mixedTypeAnnotation = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
newExpression = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
newStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
noop = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
nullLiteral = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
nullLiteralStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
nullLiteralTypeAnnotation = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
nullTypeAnnotation = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
nullableTypeAnnotation = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
numberLiteralTypeAnnotation = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
numberTypeAnnotation = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
numericLiteral = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
numericLiteralStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
numericLiteralTypeAnnotation = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
objectExpression = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
objectMethod = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
objectPattern = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
objectProperty = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
objectStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
objectTypeAnnotation = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
objectTypeCallProperty = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
objectTypeIndexer = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
objectTypeProperty = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
parenthesizedExpression = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
parenthesizedStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
position = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
program = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
property = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
propertyPattern = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
qualifiedTypeIdentifier = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
regExpLiteral = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
regExpLiteralStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
function registerMethods(methods, type) { for (const methodName in methods) { if (!methods.hasOwnProperty(methodName)) { return; } if (hasConflictingRegistration(methodName, type)) { let msg = `There is a conflicting registration for method with name "${methodName}".\nYou tried to register an additional method with `; if (type) { msg += `type "${type.toString()}".` } else { msg += 'universal type.' } msg += '\nThere are existing registrations for that method with '; const conflictingRegistrations = CPt[methodName].typedRegistrations; if (conflictingRegistrations) { msg += `type ${Object.keys(conflictingRegistrations).join(', ')}.`; } else { msg += 'universal type.'; } throw Error(msg); } if (!type) { CPt[methodName] = methods[methodName]; } else { type = type.toString(); if (!CPt.hasOwnProperty(methodName)) { installTypedMethod(methodName); } var registrations = CPt[methodName].typedRegistrations; registrations[type] = methods[methodName]; astTypes.getSupertypeNames(type).forEach(function (name) { registrations[name] = false; }); } } }
...
the nodes in the collection. **Type-specific** extensions work only on specific
node types and are not callable on differently typed collections.
#### Examples
```js
// Adding a method to all Identifiers
jscodeshift.registerMethods({
logNames: function() {
return this.forEach(function(path) {
console.log(path.node.name);
});
}
}, jscodeshift.Identifier);
...
restElement = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
restProperty = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
returnStatement = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
sequenceExpression = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
sequenceStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
sourceLocation = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
spreadElement = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
spreadElementPattern = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
spreadProperty = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
spreadPropertyPattern = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
stringLiteral = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
stringLiteralStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
stringLiteralTypeAnnotation = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
stringTypeAnnotation = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
super = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
superStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
switchCase = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
switchStatement = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
taggedTemplateExpression = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
taggedTemplateStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
templateElement = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
templateLiteral = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
templateLiteralStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
thisExpression = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
thisStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
thisTypeAnnotation = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
throwStatement = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
tryStatement = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
tupleTypeAnnotation = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
typeAlias = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
typeAnnotation = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
typeCastExpression = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
typeCastStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
typeParameter = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
typeParameterDeclaration = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
typeParameterInstantiation = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
typeofTypeAnnotation = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
function NodePath(value, parentPath, name) { if (!(this instanceof NodePath)) { throw new Error("NodePath constructor cannot be invoked without 'new'"); } Path.call(this, value, parentPath, name); }
n/a
function Path(value, parentPath, name) { if (!(this instanceof Path)) { throw new Error("Path constructor cannot be invoked without 'new'"); } if (parentPath) { if (!(parentPath instanceof Path)) { throw new Error(""); } } else { parentPath = null; name = null; } // The value encapsulated by this Path, generally equal to // parentPath.value[name] if we have a parentPath. this.value = value; // The immediate parent Path of this Path. this.parentPath = parentPath; // The name of the property of parentPath.value through which this // Path's value was reached. this.name = name; // Calling path.get("child") multiple times always returns the same // child Path object, for both performance and consistency reasons. this.__childCache = null; }
n/a
function PathVisitor() { if (!(this instanceof PathVisitor)) { throw new Error( "PathVisitor constructor cannot be invoked without 'new'" ); } // Permanent state. this._reusableContextStack = []; this._methodNameTable = computeMethodNameTable(this); this._shouldVisitComments = hasOwn.call(this._methodNameTable, "Block") || hasOwn.call(this._methodNameTable, "Line"); this.Context = makeContextConstructor(this); // State reset every time PathVisitor.prototype.visit is called. this._visiting = false; this._changeReported = false; }
n/a
function Type(check, name) { var self = this; if (!(self instanceof Type)) { throw new Error("Type constructor cannot be invoked without 'new'"); } // Unfortunately we can't elegantly reuse isFunction and isString, // here, because this code is executed while defining those types. if (objToStr.call(check) !== funObjStr) { throw new Error(check + " is not a function"); } // The `name` parameter can be either a function or a string. var nameObjStr = objToStr.call(name); if (!(nameObjStr === funObjStr || nameObjStr === strObjStr)) { throw new Error(name + " is neither a function nor a string"); } Object.defineProperties(self, { name: {value: name}, check: { value: function (value, deep) { var result = check.call(self, value, deep); if (!result && deep && objToStr.call(deep) === funObjStr) deep(self, value); return result; } } }); }
n/a
function astNodesAreEquivalent(a, b, problemPath) { if (isArray.check(problemPath)) { problemPath.length = 0; } else { problemPath = null; } return areEquivalent(a, b, problemPath); }
n/a
unaryExpression = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
unaryStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
unionTypeAnnotation = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
updateExpression = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
updateStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
function use(plugin) { if (plugins.indexOf(plugin) === -1) { plugins.push(plugin); plugin(core); } }
n/a
variableDeclaration = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
variableDeclarator = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
voidTypeAnnotation = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
whileStatement = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
function withParser(parser) { if (typeof parser === 'string') { parser = getParser(parser); } const newCore = function(source, options) { if (options && !options.parser) { options.parser = parser; } else { options = {parser}; } return core(source, options); }; return enrichCore(newCore, parser); }
n/a
withStatement = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
yieldExpression = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
yieldStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
function parse(code) { return babylon.parse(code, options); }
...
collection.
Here is an example of how one would find/traverse all `Identifier` nodes with
jscodeshift and with recast:
```js
// recast
var ast = recast.parse(src);
recast.visit(ast, {
visitIdentifier: function(path) {
// do something with path
return false;
}
});
...
function parse(code) { return flowParser.parse(code, options); }
...
collection.
Here is an example of how one would find/traverse all `Identifier` nodes with
jscodeshift and with recast:
```js
// recast
var ast = recast.parse(src);
recast.visit(ast, {
visitIdentifier: function(path) {
// do something with path
return false;
}
});
...
function expression(template) { // wrap code in `(...)` to force evaluation as expression template = Array.from(template); if (template.length > 1) { template[0] = '(' + template[0]; template[template.length - 1] += ')'; } else if (template.length === 0) { template[0] = '(' + template[0] + ')'; } return statement.apply( null, [template].concat(Array.from(arguments).slice(1)) ).expression; }
n/a
function statement() { return statements.apply(null, arguments)[0]; }
n/a
function statements(template) { template = Array.from(template); const nodes = Array.from(arguments).slice(1); const varNames = nodes.map(n => getRandomVarName()); const src = template.reduce( (result, elem, i) => result + varNames[i - 1] + elem ); return replaceNodes( src, varNames, nodes, parser ).program.body; }
n/a
function createTempFileWith(content, filename) { const info = temp.openSync(); let filePath = info.path; fs.writeSync(info.fd, content); fs.closeSync(info.fd); if (filename) { filePath = renameFileTo(filePath, filename); } return filePath; }
n/a
function createTransformWith(content, fileName) { return createTempFileWith( 'module.exports = function(fileInfo, api, options) { ' + content + ' }', fileName ); }
n/a
function getFileContent(filePath) { return fs.readFileSync(filePath).toString(); }
n/a
function NodePath(value, parentPath, name) { if (!(this instanceof NodePath)) { throw new Error("NodePath constructor cannot be invoked without 'new'"); } Path.call(this, value, parentPath, name); }
n/a
function Path(value, parentPath, name) { if (!(this instanceof Path)) { throw new Error("Path constructor cannot be invoked without 'new'"); } if (parentPath) { if (!(parentPath instanceof Path)) { throw new Error(""); } } else { parentPath = null; name = null; } // The value encapsulated by this Path, generally equal to // parentPath.value[name] if we have a parentPath. this.value = value; // The immediate parent Path of this Path. this.parentPath = parentPath; // The name of the property of parentPath.value through which this // Path's value was reached. this.name = name; // Calling path.get("child") multiple times always returns the same // child Path object, for both performance and consistency reasons. this.__childCache = null; }
n/a
function PathVisitor() { if (!(this instanceof PathVisitor)) { throw new Error( "PathVisitor constructor cannot be invoked without 'new'" ); } // Permanent state. this._reusableContextStack = []; this._methodNameTable = computeMethodNameTable(this); this._shouldVisitComments = hasOwn.call(this._methodNameTable, "Block") || hasOwn.call(this._methodNameTable, "Line"); this.Context = makeContextConstructor(this); // State reset every time PathVisitor.prototype.visit is called. this._visiting = false; this._changeReported = false; }
n/a
function Type(check, name) { var self = this; if (!(self instanceof Type)) { throw new Error("Type constructor cannot be invoked without 'new'"); } // Unfortunately we can't elegantly reuse isFunction and isString, // here, because this code is executed while defining those types. if (objToStr.call(check) !== funObjStr) { throw new Error(check + " is not a function"); } // The `name` parameter can be either a function or a string. var nameObjStr = objToStr.call(name); if (!(nameObjStr === funObjStr || nameObjStr === strObjStr)) { throw new Error(name + " is neither a function nor a string"); } Object.defineProperties(self, { name: {value: name}, check: { value: function (value, deep) { var result = check.call(self, value, deep); if (!result && deep && objToStr.call(deep) === funObjStr) deep(self, value); return result; } } }); }
n/a
function astNodesAreEquivalent(a, b, problemPath) { if (isArray.check(problemPath)) { problemPath.length = 0; } else { problemPath = null; } return areEquivalent(a, b, problemPath); }
n/a
defineMethod = function (name, func) { var old = nodePrototype[name]; // Pass undefined as func to delete nodePrototype[name]. if (isUndefined.check(func)) { delete nodePrototype[name]; } else { isFunction.assert(func); Object.defineProperty(nodePrototype, name, { enumerable: true, // For discoverability. configurable: true, // For delete proto[name]. value: func }); } return old; }
n/a
eachField = function (object, callback, context) { getFieldNames(object).forEach(function (name) { callback.call(this, name, getFieldValue(object, name)); }, context); }
n/a
finalize = function () { Object.keys(defCache).forEach(function (name) { defCache[name].finalize(); }); }
n/a
function getFieldNames(object) { var d = Def.fromValue(object); if (d) { return d.fieldNames.slice(0); } if ("type" in object) { throw new Error( "did not recognize object of type " + JSON.stringify(object.type) ); } return Object.keys(object); }
n/a
function getFieldValue(object, fieldName) { var d = Def.fromValue(object); if (d) { var field = d.allFields[fieldName]; if (field) { return field.getValue(object); } } return object && object[fieldName]; }
n/a
getSupertypeNames = function (typeName) { if (!hasOwn.call(defCache, typeName)) { throw new Error(""); } var d = defCache[typeName]; if (d.finalized !== true) { throw new Error(""); } return d.supertypeList.slice(1); }
n/a
someField = function (object, callback, context) { return getFieldNames(object).some(function (name) { return callback.call(this, name, getFieldValue(object, name)); }, context); }
n/a
function use(plugin) { var idx = used.indexOf(plugin); if (idx === -1) { idx = used.length; used.push(plugin); usedResult[idx] = plugin(fork); } return usedResult[idx]; }
n/a
function visit(node, methods) { return PathVisitor.fromMethodsObject(methods).visit(node); }
...
Here is an example of how one would find/traverse all `Identifier` nodes with
jscodeshift and with recast:
```js
// recast
var ast = recast.parse(src);
recast.visit(ast, {
visitIdentifier: function(path) {
// do something with path
return false;
}
});
// jscodeshift
...
function NodePath(value, parentPath, name) { if (!(this instanceof NodePath)) { throw new Error("NodePath constructor cannot be invoked without 'new'"); } Path.call(this, value, parentPath, name); }
n/a
_computeNode = function () { var value = this.value; if (n.Node.check(value)) { return value; } var pp = this.parentPath; return pp && pp.node || null; }
n/a
_computeParent = function () { var value = this.value; var pp = this.parentPath; if (!n.Node.check(value)) { while (pp && !n.Node.check(pp.value)) { pp = pp.parentPath; } if (pp) { pp = pp.parentPath; } } while (pp && !n.Node.check(pp.value)) { pp = pp.parentPath; } return pp || null; }
n/a
_computeScope = function () { var value = this.value; var pp = this.parentPath; var scope = pp && pp.scope; if (n.Node.check(value) && Scope.isEstablishedBy(value)) { scope = new Scope(this, scope); } return scope || null; }
n/a
canBeFirstInStatement = function () { var node = this.node; return !n.FunctionExpression.check(node) && !n.ObjectExpression.check(node); }
n/a
firstInStatement = function () { return firstInStatement(this); }
n/a
getValueProperty = function (name) { return types.getFieldValue(this.value, name); }
n/a
needsParens = function (assumeExpressionContext) { var pp = this.parentPath; if (!pp) { return false; } var node = this.value; // Only expressions need parentheses. if (!n.Expression.check(node)) { return false; } // Identifiers never need parentheses. if (node.type === "Identifier") { return false; } while (!n.Node.check(pp.value)) { pp = pp.parentPath; if (!pp) { return false; } } var parent = pp.value; switch (node.type) { case "UnaryExpression": case "SpreadElement": case "SpreadProperty": return parent.type === "MemberExpression" && this.name === "object" && parent.object === node; case "BinaryExpression": case "LogicalExpression": switch (parent.type) { case "CallExpression": return this.name === "callee" && parent.callee === node; case "UnaryExpression": case "SpreadElement": case "SpreadProperty": return true; case "MemberExpression": return this.name === "object" && parent.object === node; case "BinaryExpression": case "LogicalExpression": var po = parent.operator; var pp = PRECEDENCE[po]; var no = node.operator; var np = PRECEDENCE[no]; if (pp > np) { return true; } if (pp === np && this.name === "right") { if (parent.right !== node) { throw new Error("Nodes must be equal"); } return true; } default: return false; } case "SequenceExpression": switch (parent.type) { case "ForStatement": // Although parentheses wouldn't hurt around sequence // expressions in the head of for loops, traditional style // dictates that e.g. i++, j++ should not be wrapped with // parentheses. return false; case "ExpressionStatement": return this.name !== "expression"; default: // Otherwise err on the side of overparenthesization, adding // explicit exceptions above if this proves overzealous. return true; } case "YieldExpression": switch (parent.type) { case "BinaryExpression": case "LogicalExpression": case "UnaryExpression": case "SpreadElement": case "SpreadProperty": case "CallExpression": case "MemberExpression": case "NewExpression": case "ConditionalExpression": case "YieldExpression": return true; default: return false; } case "Literal": return parent.type === "MemberExpression" && isNumber.check(node.value) && this.name === "object" && parent.object === node; case "AssignmentExpression": case "ConditionalExpression": switch (parent.type) { case "UnaryExpression": case "SpreadElement": case "SpreadProperty": case "BinaryExpression": case "LogicalExpression": return true; case "CallExpression": return this.name === "callee" && parent.callee === node; case "ConditionalExpression": return this.name === " ...
n/a
prune = function () { var remainingNodePath = this.parent; this.replace(); return cleanUpNodesAfterPrune(remainingNodePath); }
n/a
replace = function () { delete this.node; delete this.parent; delete this.scope; return Path.prototype.replace.apply(this, arguments); }
n/a
function Path(value, parentPath, name) { if (!(this instanceof Path)) { throw new Error("Path constructor cannot be invoked without 'new'"); } if (parentPath) { if (!(parentPath instanceof Path)) { throw new Error(""); } } else { parentPath = null; name = null; } // The value encapsulated by this Path, generally equal to // parentPath.value[name] if we have a parentPath. this.value = value; // The immediate parent Path of this Path. this.parentPath = parentPath; // The name of the property of parentPath.value through which this // Path's value was reached. this.name = name; // Calling path.get("child") multiple times always returns the same // child Path object, for both performance and consistency reasons. this.__childCache = null; }
n/a
function each(callback, context) { var childPaths = []; var len = this.value.length; var i = 0; // Collect all the original child paths before invoking the callback. for (var i = 0; i < len; ++i) { if (hasOwn.call(this.value, i)) { childPaths[i] = this.get(i); } } // Invoke the callback on just the original child paths, regardless of // any modifications made to the array by the callback. I chose these // semantics over cleverly invoking the callback on new elements because // this way is much easier to reason about. context = context || this; for (i = 0; i < len; ++i) { if (hasOwn.call(childPaths, i)) { callback.call(context, childPaths[i]); } } }
n/a
function filter(callback, context) { var result = []; this.each(function (childPath) { if (callback.call(this, childPath)) { result.push(childPath); } }, context); return result; }
n/a
function get(name) { var path = this; var names = arguments; var count = names.length; for (var i = 0; i < count; ++i) { path = getChildPath(path, names[i]); } return path; }
n/a
function getValueProperty(name) { return this.value[name]; }
n/a
function insertAfter(node) { var pp = this.parentPath; var argc = arguments.length; var insertAtArgs = [this.name + 1]; for (var i = 0; i < argc; ++i) { insertAtArgs.push(arguments[i]); } return pp.insertAt.apply(pp, insertAtArgs); }
n/a
function insertAt(index, node) { var argc = arguments.length; var move = getMoves(this, argc - 1, index); if (move === emptyMoves) { return this; } index = Math.max(index, 0); for (var i = 1; i < argc; ++i) { this.value[index + i - 1] = arguments[i]; } move(); return this; }
n/a
function insertBefore(node) { var pp = this.parentPath; var argc = arguments.length; var insertAtArgs = [this.name]; for (var i = 0; i < argc; ++i) { insertAtArgs.push(arguments[i]); } return pp.insertAt.apply(pp, insertAtArgs); }
n/a
function map(callback, context) { var result = []; this.each(function (childPath) { result.push(callback.call(this, childPath)); }, context); return result; }
n/a
function pop() { isArray.assert(this.value); var cache = getChildCache(this); delete cache[this.value.length - 1]; delete cache.length; return this.value.pop(); }
n/a
function push(node) { isArray.assert(this.value); delete getChildCache(this).length return this.value.push.apply(this.value, arguments); }
n/a
function replace(replacement) { var results = []; var parentValue = this.parentPath.value; var parentCache = getChildCache(this.parentPath); var count = arguments.length; repairRelationshipWithParent(this); if (isArray.check(parentValue)) { var originalLength = parentValue.length; var move = getMoves(this.parentPath, count - 1, this.name + 1); var spliceArgs = [this.name, 1]; for (var i = 0; i < count; ++i) { spliceArgs.push(arguments[i]); } var splicedOut = parentValue.splice.apply(parentValue, spliceArgs); if (splicedOut[0] !== this.value) { throw new Error(""); } if (parentValue.length !== (originalLength - 1 + count)) { throw new Error(""); } move(); if (count === 0) { delete this.value; delete parentCache[this.name]; this.__childCache = null; } else { if (parentValue[this.name] !== replacement) { throw new Error(""); } if (this.value !== replacement) { this.value = replacement; this.__childCache = null; } for (i = 0; i < count; ++i) { results.push(this.parentPath.get(this.name + i)); } if (results[0] !== this) { throw new Error(""); } } } else if (count === 1) { if (this.value !== replacement) { this.__childCache = null; } this.value = parentValue[this.name] = replacement; results.push(this); } else if (count === 0) { delete parentValue[this.name]; delete this.value; this.__childCache = null; // Leave this path cached as parentCache[this.name], even though // it no longer has a value defined. } else { throw new Error("Could not replace path"); } return results; }
n/a
function shift() { var move = getMoves(this, -1); var result = this.value.shift(); move(); return result; }
n/a
function unshift(node) { var move = getMoves(this, arguments.length); var result = this.value.unshift.apply(this.value, arguments); move(); return result; }
n/a
function PathVisitor() { if (!(this instanceof PathVisitor)) { throw new Error( "PathVisitor constructor cannot be invoked without 'new'" ); } // Permanent state. this._reusableContextStack = []; this._methodNameTable = computeMethodNameTable(this); this._shouldVisitComments = hasOwn.call(this._methodNameTable, "Block") || hasOwn.call(this._methodNameTable, "Line"); this.Context = makeContextConstructor(this); // State reset every time PathVisitor.prototype.visit is called. this._visiting = false; this._changeReported = false; }
n/a
function fromMethodsObject(methods) { if (methods instanceof PathVisitor) { return methods; } if (!isObject.check(methods)) { // An empty visitor? return new PathVisitor; } function Visitor() { if (!(this instanceof Visitor)) { throw new Error( "Visitor constructor cannot be invoked without 'new'" ); } PathVisitor.call(this); } var Vp = Visitor.prototype = Object.create(PVp); Vp.constructor = Visitor; extend(Vp, methods); extend(Visitor, PathVisitor); isFunction.assert(Visitor.fromMethodsObject); isFunction.assert(Visitor.visit); return new Visitor; }
n/a
function visit(node, methods) { return PathVisitor.fromMethodsObject(methods).visit(node); }
...
Here is an example of how one would find/traverse all `Identifier` nodes with
jscodeshift and with recast:
```js
// recast
var ast = recast.parse(src);
recast.visit(ast, {
visitIdentifier: function(path) {
// do something with path
return false;
}
});
// jscodeshift
...
function AbortRequest() {}
n/a
abort = function () { var visitor = this; visitor._abortRequested = true; var request = new visitor.AbortRequest(); // If you decide to catch this exception and stop it from propagating, // make sure to call its cancel method to avoid silencing other // exceptions that might be thrown later in the traversal. request.cancel = function () { visitor._abortRequested = false; }; throw request; }
n/a
acquireContext = function (path) { if (this._reusableContextStack.length === 0) { return new this.Context(path); } return this._reusableContextStack.pop().reset(path); }
n/a
releaseContext = function (context) { if (!(context instanceof this.Context)) { throw new Error(""); } this._reusableContextStack.push(context); context.currentPath = null; }
n/a
reportChanged = function () { this._changeReported = true; }
n/a
reset = function (path) { // Empty stub; may be reassigned or overridden by subclasses. }
n/a
visit = function () { if (this._visiting) { throw new Error( "Recursively calling visitor.visit(path) resets visitor state. " + "Try this.visit(path) or this.traverse(path) instead." ); } // Private state that needs to be reset before every traversal. this._visiting = true; this._changeReported = false; this._abortRequested = false; var argc = arguments.length; var args = new Array(argc) for (var i = 0; i < argc; ++i) { args[i] = arguments[i]; } if (!(args[0] instanceof NodePath)) { args[0] = new NodePath({root: args[0]}).get("root"); } // Called with the same arguments as .visit. this.reset.apply(this, args); try { var root = this.visitWithoutReset(args[0]); var didNotThrow = true; } finally { this._visiting = false; if (!didNotThrow && this._abortRequested) { // If this.visitWithoutReset threw an exception and // this._abortRequested was set to true, return the root of // the AST instead of letting the exception propagate, so that // client code does not have to provide a try-catch block to // intercept the AbortRequest exception. Other kinds of // exceptions will propagate without being intercepted and // rethrown by a catch block, so their stacks will accurately // reflect the original throwing context. return args[0].value; } } return root; }
...
Here is an example of how one would find/traverse all `Identifier` nodes with
jscodeshift and with recast:
```js
// recast
var ast = recast.parse(src);
recast.visit(ast, {
visitIdentifier: function(path) {
// do something with path
return false;
}
});
// jscodeshift
...
visitWithoutReset = function (path) { if (this instanceof this.Context) { // Since this.Context.prototype === this, there's a chance we // might accidentally call context.visitWithoutReset. If that // happens, re-invoke the method against context.visitor. return this.visitor.visitWithoutReset(path); } if (!(path instanceof NodePath)) { throw new Error(""); } var value = path.value; var methodName = value && typeof value === "object" && typeof value.type === "string" && this._methodNameTable[value.type]; if (methodName) { var context = this.acquireContext(path); try { return context.invokeVisitorMethod(methodName); } finally { this.releaseContext(context); } } else { // If there was no visitor method to call, visit the children of // this node generically. return visitChildren(path, this); } }
n/a
wasChangeReported = function () { return this._changeReported; }
n/a
function Type(check, name) { var self = this; if (!(self instanceof Type)) { throw new Error("Type constructor cannot be invoked without 'new'"); } // Unfortunately we can't elegantly reuse isFunction and isString, // here, because this code is executed while defining those types. if (objToStr.call(check) !== funObjStr) { throw new Error(check + " is not a function"); } // The `name` parameter can be either a function or a string. var nameObjStr = objToStr.call(name); if (!(nameObjStr === funObjStr || nameObjStr === strObjStr)) { throw new Error(name + " is neither a function nor a string"); } Object.defineProperties(self, { name: {value: name}, check: { value: function (value, deep) { var result = check.call(self, value, deep); if (!result && deep && objToStr.call(deep) === funObjStr) deep(self, value); return result; } } }); }
n/a
def = function (typeName) { isString.assert(typeName); return hasOwn.call(defCache, typeName) ? defCache[typeName] : defCache[typeName] = new Def(typeName); }
n/a
fromArray = function (arr) { if (!isArray.check(arr)) { throw new Error(""); } if (arr.length !== 1) { throw new Error("only one element type is permitted for typed arrays"); } return toType(arr[0]).arrayOf(); }
n/a
fromObject = function (obj) { var fields = Object.keys(obj).map(function (name) { return new Field(name, obj[name]); }); return new Type(function (value, deep) { return isObject.check(value) && fields.every(function (field) { return field.type.check(value[field.name], deep); }); }, function () { return "{ " + fields.join(", ") + " }"; }); }
n/a
or = function () { var types = []; var len = arguments.length; for (var i = 0; i < len; ++i) types.push(toType(arguments[i])); return new Type(function (value, deep) { for (var i = 0; i < len; ++i) if (types[i].check(value, deep)) return true; return false; }, function () { return types.join(" | "); }); }
n/a
arrayOf = function () { var elemType = this; return new Type(function (value, deep) { return isArray.check(value) && value.every(function (elem) { return elemType.check(elem, deep); }); }, function () { return "[" + elemType + "]"; }); }
n/a
assert = function (value, deep) { if (!this.check(value, deep)) { var str = shallowStringify(value); throw new Error(str + " does not match type " + this); } return true; }
n/a
toString = function () { var name = this.name; if (isString.check(name)) return name; if (isFunction.check(name)) return name.call(this) + ""; return name + " type"; }
...
'module.exports = function(fileInfo, api, options) { ' + content + ' }',
fileName
);
}
exports.createTransformWith = createTransformWith;
function getFileContent(filePath) {
return fs.readFileSync(filePath).toString();
}
exports.getFileContent = getFileContent;
...
function astNodesAreEquivalent(a, b, problemPath) { if (isArray.check(problemPath)) { problemPath.length = 0; } else { problemPath = null; } return areEquivalent(a, b, problemPath); }
n/a
assert = function (a, b) { var problemPath = []; if (!astNodesAreEquivalent(a, b, problemPath)) { if (problemPath.length === 0) { if (a !== b) { throw new Error("Nodes must be equal"); } } else { throw new Error( "Nodes differ in the following path: " + problemPath.map(subscriptForProperty).join("") ); } } }
n/a
anyTypeAnnotation = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
arrayExpression = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
arrayPattern = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
arrayStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
arrayTypeAnnotation = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
arrowFunctionExpression = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
arrowFunctionStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
assignmentExpression = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
assignmentPattern = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
assignmentStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
awaitExpression = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
awaitStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
binaryExpression = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
binaryStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
bindExpression = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
bindStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
block = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
blockStatement = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
booleanLiteral = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
booleanLiteralStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
booleanLiteralTypeAnnotation = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
booleanTypeAnnotation = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
breakStatement = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
callExpression = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
...
For example, the following creates an AST equivalent to `foo(bar)`:
```js
// inside a module transform
var j = jscodeshift;
// foo(bar);
var ast = j.callExpression(
j.identifier('foo'),
[j.identifier('bar')]
);
```
The signature of each builder function is best learned by having a look at the
[definition files](https://github.com/benjamn/ast-types/blob/master/def/).
...
callStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
catchClause = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
classBody = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
classDeclaration = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
classExpression = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
classImplements = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
classMethod = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
classProperty = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
classPropertyDefinition = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
classStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
commentBlock = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
commentLine = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
comprehensionBlock = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
comprehensionExpression = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
comprehensionStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
conditionalExpression = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
conditionalStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
continueStatement = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
debuggerStatement = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
declareClass = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
declareExportAllDeclaration = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
declareExportDeclaration = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
declareFunction = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
declareInterface = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
declareModule = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
declareModuleExports = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
declareTypeAlias = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
declareVariable = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
decorator = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
directive = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
directiveLiteral = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
directiveLiteralStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
doExpression = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
doStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
doWhileStatement = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
emptyStatement = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
emptyTypeAnnotation = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
existentialTypeParam = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
existsTypeAnnotation = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
exportAllDeclaration = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
exportBatchSpecifier = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
exportDeclaration = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
exportDefaultDeclaration = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
exportDefaultSpecifier = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
exportNamedDeclaration = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
exportNamespaceSpecifier = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
exportSpecifier = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
expressionStatement = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
file = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
forAwaitStatement = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
forInStatement = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
forOfStatement = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
forStatement = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
functionDeclaration = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
functionExpression = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
functionStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
functionTypeAnnotation = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
functionTypeParam = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
generatorExpression = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
generatorStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
genericTypeAnnotation = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
graphExpression = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
graphIndexExpression = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
graphIndexStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
graphStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
identifier = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
...
For example, the following creates an AST equivalent to `foo(bar)`:
```js
// inside a module transform
var j = jscodeshift;
// foo(bar);
var ast = j.callExpression(
j.identifier('foo'),
[j.identifier('bar')]
);
```
The signature of each builder function is best learned by having a look at the
[definition files](https://github.com/benjamn/ast-types/blob/master/def/).
...
identifierStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
ifStatement = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
import = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
importDeclaration = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
importDefaultSpecifier = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
importNamespaceSpecifier = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
importSpecifier = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
importStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
interfaceDeclaration = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
interfaceExtends = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
intersectionTypeAnnotation = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
jsxAttribute = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
jsxClosingElement = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
jsxElement = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
jsxElementStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
jsxEmptyExpression = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
jsxEmptyStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
jsxExpressionContainer = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
jsxExpressionContainerStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
jsxIdentifier = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
jsxIdentifierStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
jsxMemberExpression = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
jsxMemberStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
jsxNamespacedName = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
jsxOpeningElement = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
jsxSpreadAttribute = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
jsxText = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
jsxTextStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
labeledStatement = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
letExpression = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
letStatement = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
line = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
literal = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
literalStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
logicalExpression = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
logicalStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
memberExpression = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
memberStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
memberTypeAnnotation = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
metaProperty = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
metaPropertyStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
methodDefinition = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
mixedTypeAnnotation = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
newExpression = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
newStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
noop = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
nullLiteral = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
nullLiteralStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
nullLiteralTypeAnnotation = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
nullTypeAnnotation = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
nullableTypeAnnotation = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
numberLiteralTypeAnnotation = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
numberTypeAnnotation = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
numericLiteral = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
numericLiteralStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
numericLiteralTypeAnnotation = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
objectExpression = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
objectMethod = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
objectPattern = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
objectProperty = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
objectStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
objectTypeAnnotation = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
objectTypeCallProperty = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
objectTypeIndexer = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
objectTypeProperty = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
parenthesizedExpression = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
parenthesizedStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
position = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
program = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
property = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
propertyPattern = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
qualifiedTypeIdentifier = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
regExpLiteral = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
regExpLiteralStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
restElement = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
restProperty = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
returnStatement = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
sequenceExpression = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
sequenceStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
sourceLocation = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
spreadElement = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
spreadElementPattern = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
spreadProperty = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
spreadPropertyPattern = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
stringLiteral = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
stringLiteralStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
stringLiteralTypeAnnotation = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
stringTypeAnnotation = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
super = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
superStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
switchCase = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
switchStatement = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
taggedTemplateExpression = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
taggedTemplateStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
templateElement = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
templateLiteral = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
templateLiteralStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
thisExpression = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
thisStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
thisTypeAnnotation = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
throwStatement = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
tryStatement = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
tupleTypeAnnotation = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
typeAlias = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
typeAnnotation = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
typeCastExpression = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
typeCastStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
typeParameter = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
typeParameterDeclaration = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
typeParameterInstantiation = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
typeofTypeAnnotation = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
unaryExpression = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
unaryStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
unionTypeAnnotation = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
updateExpression = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
updateStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a
variableDeclaration = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
variableDeclarator = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
voidTypeAnnotation = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
whileStatement = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
withStatement = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
yieldExpression = function () { var args = arguments; var argc = args.length; var built = Object.create(nodePrototype); if (!self.finalized) { throw new Error( "attempting to instantiate unfinalized type " + self.typeName ); } function add(param, i) { if (hasOwn.call(built, param)) return; var all = self.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isNumber.check(i) && i < argc) { value = args[i]; } else if (field.defaultFn) { // Expose the partially-built object to the default // function as its `this` object. value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + self.typeName + "(" + self.buildParams.map(function (name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error( shallowStringify(value) + " does not match field " + field + " of type " + self.typeName ); } // TODO Could attach getters and setters here to enforce // dynamic type safety. built[param] = value; } self.buildParams.forEach(function (param, i) { add(param, i); }); Object.keys(self.allFields).forEach(function (param) { add(param); // Use the default value. }); // Make sure that the "type" field was filled automatically. if (built.type !== self.typeName) { throw new Error(""); } return built; }
n/a
yieldStatement = function () { return builders.expressionStatement(wrapped.apply(builders, arguments)); }
n/a