6.0.0
I'm extremely stupid and didn't commit as I go. To anyone reading this I'm extremely sorry. A lot of these changes are very broad and I plan on releasing Babel 6.0.0 today live on stage at Ember Camp London so I'm afraid I couldn't wait. If you're ever in London I'll buy you a beer (or assorted beverage!) to make up for it, also I'll kiss your feet and give you a back massage, maybe.
This commit is contained in:
parent
d0b584fd13
commit
b909a81ab7
38
README.md
38
README.md
@ -32,13 +32,12 @@ Significant diversions are expected to occur in the future such as streaming, EB
|
||||
the top level raises an error. Set this to `true` to accept such
|
||||
code.
|
||||
|
||||
- **allowSuperOutsideMethod** TODO
|
||||
|
||||
- **sourceType**: Indicate the mode the code should be parsed in. Can be
|
||||
either `"script"` or `"module"`.
|
||||
|
||||
- **features**: Object containing names of all the proposed syntax you want
|
||||
to support.
|
||||
|
||||
- **plugins**: Object containg the plugins that you want to enable.
|
||||
- **plugins**: Array containing the plugins that you want to enable.
|
||||
|
||||
### Example
|
||||
|
||||
@ -47,29 +46,28 @@ require("babylon").parse("code", {
|
||||
// parse in strict mode and allow module declarations
|
||||
sourceType: "module",
|
||||
|
||||
features: {
|
||||
features: [
|
||||
// enable experimental async functions
|
||||
asyncFunctions: true
|
||||
}
|
||||
"asyncFunctions",
|
||||
|
||||
plugins: {
|
||||
// enable jsx and flow syntax
|
||||
jsx: true,
|
||||
flow: true
|
||||
}
|
||||
"jsx",
|
||||
"flow"
|
||||
]
|
||||
});
|
||||
```
|
||||
|
||||
### Features
|
||||
|
||||
- `asyncFunctions`
|
||||
- `doExpressions`
|
||||
- `comprehensions`
|
||||
- `trailingFunctionCommas`
|
||||
- `objectRestSpread`
|
||||
- `decorators`
|
||||
|
||||
### Plugins
|
||||
|
||||
- `jsx`
|
||||
- `flow`
|
||||
- `asyncFunctions`
|
||||
- `classConstructorCall`
|
||||
- `doExpressions`
|
||||
- `trailingFunctionCommas`
|
||||
- `objectRestSpread`
|
||||
- `decorators`
|
||||
- `classProperties`
|
||||
- `exportExtensions`
|
||||
- `exponentiationOperator`
|
||||
- `asyncGenerators`
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "babylon",
|
||||
"version": "5.8.23",
|
||||
"version": "5.10.32",
|
||||
"description": "A JavaScript parser",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
"homepage": "https://babeljs.io/",
|
||||
@ -8,9 +8,9 @@
|
||||
"repository": "babel/babel",
|
||||
"main": "lib/index.js",
|
||||
"dependencies": {
|
||||
"babel-runtime": "^5.8.20"
|
||||
"babel-runtime": "^5.10.32"
|
||||
},
|
||||
"bin": {
|
||||
"babylon": "./bin/babylon.js"
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -12,10 +12,12 @@ export const defaultOptions = {
|
||||
// When enabled, import/export statements are not constrained to
|
||||
// appearing at the top of the program.
|
||||
allowImportExportEverywhere: false,
|
||||
plugins: {},
|
||||
// Babel-specific options
|
||||
features: {},
|
||||
strictMode: null
|
||||
// TODO
|
||||
allowSuperOutsideMethod: false,
|
||||
// An array of plugins to enable
|
||||
plugins: [],
|
||||
// TODO
|
||||
strictMode: null,
|
||||
};
|
||||
|
||||
// Interpret and default an options object
|
||||
|
||||
@ -40,9 +40,9 @@ pp.addComment = function (comment) {
|
||||
pp.processComment = function (node) {
|
||||
if (node.type === "Program" && node.body.length > 0) return;
|
||||
|
||||
var stack = this.state.commentStack;
|
||||
let stack = this.state.commentStack;
|
||||
|
||||
var lastChild, trailingComments, i;
|
||||
let lastChild, trailingComments, i;
|
||||
|
||||
if (this.state.trailingComments.length > 0) {
|
||||
// If the first comment in trailingComments comes after the
|
||||
@ -62,7 +62,7 @@ pp.processComment = function (node) {
|
||||
this.state.trailingComments.length = 0;
|
||||
}
|
||||
} else {
|
||||
var lastInStack = last(stack);
|
||||
let lastInStack = last(stack);
|
||||
if (stack.length > 0 && lastInStack.trailingComments && lastInStack.trailingComments[0].start >= node.end) {
|
||||
trailingComments = lastInStack.trailingComments;
|
||||
lastInStack.trailingComments = null;
|
||||
@ -80,7 +80,7 @@ pp.processComment = function (node) {
|
||||
node.leadingComments = lastChild.leadingComments;
|
||||
lastChild.leadingComments = null;
|
||||
} else {
|
||||
// A leading comment for an anonymous class had been stolen by its first MethodDefinition,
|
||||
// A leading comment for an anonymous class had been stolen by its first ClassMethod,
|
||||
// so this takes back the leading comment.
|
||||
// See also: https://github.com/eslint/espree/issues/158
|
||||
for (i = lastChild.leadingComments.length - 2; i >= 0; --i) {
|
||||
|
||||
@ -30,9 +30,10 @@ const pp = Parser.prototype;
|
||||
// strict mode, init properties are also not allowed to be repeated.
|
||||
|
||||
pp.checkPropClash = function (prop, propHash) {
|
||||
if (prop.computed || prop.method || prop.shorthand) return;
|
||||
if (prop.computed || prop.method) return;
|
||||
|
||||
let key = prop.key, name;
|
||||
let key = prop.key;
|
||||
let name;
|
||||
switch (key.type) {
|
||||
case "Identifier":
|
||||
name = key.name;
|
||||
@ -47,8 +48,7 @@ pp.checkPropClash = function (prop, propHash) {
|
||||
return;
|
||||
}
|
||||
|
||||
let kind = prop.kind;
|
||||
if (name === "__proto__" && kind === "init") {
|
||||
if (name === "__proto__" && prop.kind === "init") {
|
||||
if (propHash.proto) this.raise(key.start, "Redefinition of __proto__ property");
|
||||
propHash.proto = true;
|
||||
}
|
||||
@ -225,11 +225,11 @@ pp.parseExprSubscripts = function (refShorthandDefaultPos) {
|
||||
if (refShorthandDefaultPos && refShorthandDefaultPos.start) {
|
||||
return expr;
|
||||
} else {
|
||||
return this.parseSubscripts(expr, startPos, startLoc);
|
||||
return this.parseSubscripts(expr, startPos, startLoc);
|
||||
}
|
||||
};
|
||||
|
||||
pp.parseSubscripts = function(base, startPos, startLoc, noCalls) {
|
||||
pp.parseSubscripts = function (base, startPos, startLoc, noCalls) {
|
||||
for (;;) {
|
||||
if (!noCalls && this.eat(tt.doubleColon)) {
|
||||
let node = this.startNodeAt(startPos, startLoc);
|
||||
@ -255,11 +255,11 @@ pp.parseSubscripts = function(base, startPos, startLoc, noCalls) {
|
||||
|
||||
let node = this.startNodeAt(startPos, startLoc);
|
||||
node.callee = base;
|
||||
node.arguments = this.parseCallExpressionArguments(tt.parenR, this.hasFeature("trailingFunctionCommas"), possibleAsync);
|
||||
node.arguments = this.parseCallExpressionArguments(tt.parenR, this.hasPlugin("trailingFunctionCommas"), possibleAsync);
|
||||
base = this.finishNode(node, "CallExpression");
|
||||
|
||||
if (possibleAsync && this.shouldParseAsyncArrow()) {
|
||||
base = this.parseAsyncArrowFromCallExpression(this.startNodeAt(startPos, startLoc), node);
|
||||
return this.parseAsyncArrowFromCallExpression(this.startNodeAt(startPos, startLoc), node);
|
||||
} else {
|
||||
this.toReferencedList(node.arguments);
|
||||
}
|
||||
@ -307,7 +307,7 @@ pp.shouldParseAsyncArrow = function () {
|
||||
};
|
||||
|
||||
pp.parseAsyncArrowFromCallExpression = function (node, call) {
|
||||
if (!this.hasFeature("asyncFunctions")) this.unexpected();
|
||||
if (!this.hasPlugin("asyncFunctions")) this.unexpected();
|
||||
this.expect(tt.arrow);
|
||||
return this.parseArrowExpression(node, call.arguments, true);
|
||||
};
|
||||
@ -328,7 +328,7 @@ pp.parseExprAtom = function (refShorthandDefaultPos) {
|
||||
let node, canBeArrow = this.state.potentialArrowAt === this.state.start;
|
||||
switch (this.state.type) {
|
||||
case tt._super:
|
||||
if (!this.state.inFunction) {
|
||||
if (!this.state.inMethod && !this.options.allowSuperOutsideMethod) {
|
||||
this.raise(this.state.start, "'super' outside of function or class");
|
||||
}
|
||||
|
||||
@ -337,6 +337,9 @@ pp.parseExprAtom = function (refShorthandDefaultPos) {
|
||||
if (!this.match(tt.parenL) && !this.match(tt.bracketL) && !this.match(tt.dot)) {
|
||||
this.unexpected();
|
||||
}
|
||||
if (this.match(tt.parenL) && this.state.inMethod !== "constructor" && !this.options.allowSuperOutsideMethod) {
|
||||
this.raise(node.start, "super() outside of class constructor");
|
||||
}
|
||||
return this.finishNode(node, "Super");
|
||||
|
||||
case tt._this:
|
||||
@ -349,18 +352,22 @@ pp.parseExprAtom = function (refShorthandDefaultPos) {
|
||||
|
||||
case tt.name:
|
||||
node = this.startNode();
|
||||
let id = this.parseIdentifier(true);
|
||||
let allowAwait = this.hasPlugin("asyncFunctions") && this.state.value === "await" && this.state.inAsync;
|
||||
let allowYield = this.shouldAllowYieldIdentifier();
|
||||
let id = this.parseIdentifier(allowAwait || allowYield);
|
||||
|
||||
if (this.hasFeature("asyncFunctions")) {
|
||||
if (this.hasPlugin("asyncFunctions")) {
|
||||
if (id.name === "await") {
|
||||
if (this.inAsync) return this.parseAwait(node);
|
||||
if (this.state.inAsync || this.inModule) {
|
||||
return this.parseAwait(node);
|
||||
}
|
||||
} else if (id.name === "async" && this.match(tt._function) && !this.canInsertSemicolon()) {
|
||||
this.next();
|
||||
return this.parseFunction(node, false, false, true);
|
||||
} else if (canBeArrow && id.name === "async" && this.match(tt.name)) {
|
||||
var params = [this.parseIdentifier()];
|
||||
let params = [this.parseIdentifier()];
|
||||
this.expect(tt.arrow);
|
||||
// var foo = bar => {};
|
||||
// let foo = bar => {};
|
||||
return this.parseArrowExpression(node, params, true);
|
||||
}
|
||||
}
|
||||
@ -372,14 +379,14 @@ pp.parseExprAtom = function (refShorthandDefaultPos) {
|
||||
return id;
|
||||
|
||||
case tt._do:
|
||||
if (this.hasFeature("doExpressions")) {
|
||||
if (this.hasPlugin("doExpressions")) {
|
||||
let node = this.startNode();
|
||||
this.next();
|
||||
var oldInFunction = this.state.inFunction;
|
||||
var oldLabels = this.state.labels;
|
||||
let oldInFunction = this.state.inFunction;
|
||||
let oldLabels = this.state.labels;
|
||||
this.state.labels = [];
|
||||
this.state.inFunction = false;
|
||||
node.body = this.parseBlock();
|
||||
node.body = this.parseBlock(false, true);
|
||||
this.state.inFunction = oldInFunction;
|
||||
this.state.labels = oldLabels;
|
||||
return this.finishNode(node, "DoExpression");
|
||||
@ -405,8 +412,7 @@ pp.parseExprAtom = function (refShorthandDefaultPos) {
|
||||
|
||||
case tt._true: case tt._false:
|
||||
node = this.startNode();
|
||||
node.rawValue = node.value = this.match(tt._true);
|
||||
node.raw = this.state.type.keyword;
|
||||
node.value = this.match(tt._true);
|
||||
this.next();
|
||||
return this.finishNode(node, "BooleanLiteral");
|
||||
|
||||
@ -416,10 +422,6 @@ pp.parseExprAtom = function (refShorthandDefaultPos) {
|
||||
case tt.bracketL:
|
||||
node = this.startNode();
|
||||
this.next();
|
||||
// check whether this is array comprehension or regular array
|
||||
if (this.hasFeature("comprehensions") && this.match(tt._for)) {
|
||||
return this.parseComprehension(node, false);
|
||||
}
|
||||
node.elements = this.parseExprList(tt.bracketR, true, true, refShorthandDefaultPos);
|
||||
this.toReferencedList(node.elements);
|
||||
return this.finishNode(node, "ArrayExpression");
|
||||
@ -464,8 +466,9 @@ pp.parseExprAtom = function (refShorthandDefaultPos) {
|
||||
|
||||
pp.parseLiteral = function (value, type) {
|
||||
let node = this.startNode();
|
||||
node.rawValue = node.value = value;
|
||||
node.raw = this.input.slice(this.state.start, this.state.end);
|
||||
this.addExtra(node, "rawValue", value);
|
||||
this.addExtra(node, "raw", this.input.slice(this.state.start, this.state.end));
|
||||
node.value = value;
|
||||
this.next();
|
||||
return this.finishNode(node, type);
|
||||
};
|
||||
@ -483,10 +486,6 @@ pp.parseParenAndDistinguishExpression = function (startPos, startLoc, canBeArrow
|
||||
let val;
|
||||
this.next();
|
||||
|
||||
if (this.hasFeature("comprehensions") && this.match(tt._for)) {
|
||||
return this.parseComprehension(this.startNodeAt(startPos, startLoc), true);
|
||||
}
|
||||
|
||||
let innerStartPos = this.state.start, innerStartLoc = this.state.startLoc;
|
||||
let exprList = [], first = true;
|
||||
let refShorthandDefaultPos = { start: 0 }, spreadStart, innerParenStart, optionalCommaStart;
|
||||
@ -495,7 +494,7 @@ pp.parseParenAndDistinguishExpression = function (startPos, startLoc, canBeArrow
|
||||
first = false;
|
||||
} else {
|
||||
this.expect(tt.comma);
|
||||
if (this.match(tt.parenR) && this.hasFeature("trailingFunctionCommas")) {
|
||||
if (this.match(tt.parenR) && this.hasPlugin("trailingFunctionCommas")) {
|
||||
optionalCommaStart = this.state.start;
|
||||
break;
|
||||
}
|
||||
@ -572,7 +571,7 @@ pp.parseNew = function () {
|
||||
node.callee = this.parseNoCallExpr();
|
||||
|
||||
if (this.eat(tt.parenL)) {
|
||||
node.arguments = this.parseExprList(tt.parenR, this.hasFeature("trailingFunctionCommas"));
|
||||
node.arguments = this.parseExprList(tt.parenR, this.hasPlugin("trailingFunctionCommas"));
|
||||
this.toReferencedList(node.arguments);
|
||||
} else {
|
||||
node.arguments = [];
|
||||
@ -613,10 +612,14 @@ pp.parseTemplate = function () {
|
||||
// Parse an object literal or binding pattern.
|
||||
|
||||
pp.parseObj = function (isPattern, refShorthandDefaultPos) {
|
||||
let node = this.startNode(), first = true, propHash = Object.create(null);
|
||||
node.properties = [];
|
||||
let decorators = [];
|
||||
let propHash = Object.create(null);
|
||||
let first = true;
|
||||
let node = this.startNode();
|
||||
|
||||
node.properties = [];
|
||||
this.next();
|
||||
|
||||
while (!this.eat(tt.braceR)) {
|
||||
if (first) {
|
||||
first = false;
|
||||
@ -634,24 +637,30 @@ pp.parseObj = function (isPattern, refShorthandDefaultPos) {
|
||||
prop.decorators = decorators;
|
||||
decorators = [];
|
||||
}
|
||||
if (this.hasFeature("objectRestSpread") && this.match(tt.ellipsis)) {
|
||||
|
||||
if (this.hasPlugin("objectRestSpread") && this.match(tt.ellipsis)) {
|
||||
prop = this.parseSpread();
|
||||
prop.type = isPattern ? "RestProperty" : "SpreadProperty";
|
||||
node.properties.push(prop);
|
||||
continue;
|
||||
}
|
||||
|
||||
prop.method = false;
|
||||
prop.shorthand = false;
|
||||
|
||||
if (isPattern || refShorthandDefaultPos) {
|
||||
startPos = this.state.start;
|
||||
startLoc = this.state.startLoc;
|
||||
}
|
||||
|
||||
if (!isPattern) {
|
||||
isGenerator = this.eat(tt.star);
|
||||
}
|
||||
if (!isPattern && this.hasFeature("asyncFunctions") && this.isContextual("async")) {
|
||||
|
||||
if (!isPattern && this.hasPlugin("asyncFunctions") && this.isContextual("async")) {
|
||||
if (isGenerator) this.unexpected();
|
||||
var asyncId = this.parseIdentifier();
|
||||
|
||||
let asyncId = this.parseIdentifier();
|
||||
if (this.match(tt.colon) || this.match(tt.parenL) || this.match(tt.braceR)) {
|
||||
prop.key = asyncId;
|
||||
} else {
|
||||
@ -661,43 +670,58 @@ pp.parseObj = function (isPattern, refShorthandDefaultPos) {
|
||||
} else {
|
||||
this.parsePropertyName(prop);
|
||||
}
|
||||
|
||||
this.parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, refShorthandDefaultPos);
|
||||
this.checkPropClash(prop, propHash);
|
||||
node.properties.push(this.finishNode(prop, "Property"));
|
||||
|
||||
if (prop.shorthand) {
|
||||
this.addExtra(prop, "shorthand", true);
|
||||
}
|
||||
|
||||
node.properties.push(prop);
|
||||
}
|
||||
|
||||
if (decorators.length) {
|
||||
this.raise(this.state.start, "You have trailing decorators with no property");
|
||||
}
|
||||
|
||||
return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression");
|
||||
};
|
||||
|
||||
pp.parseObjPropValue = function (prop, startPos, startLoc, isGenerator, isAsync, isPattern, refShorthandDefaultPos) {
|
||||
if (this.eat(tt.colon)) {
|
||||
prop.value = isPattern ? this.parseMaybeDefault(this.state.start, this.state.startLoc) : this.parseMaybeAssign(false, refShorthandDefaultPos);
|
||||
prop.kind = "init";
|
||||
} else if (this.match(tt.parenL)) {
|
||||
return this.finishNode(prop, "ObjectProperty");
|
||||
}
|
||||
|
||||
if (this.match(tt.parenL)) {
|
||||
if (isPattern) this.unexpected();
|
||||
prop.kind = "init";
|
||||
prop.kind = "method";
|
||||
prop.method = true;
|
||||
prop.value = this.parseMethod(isGenerator, isAsync);
|
||||
} else if (!prop.computed && prop.key.type === "Identifier" && (prop.key.name === "get" || prop.key.name === "set") && (!this.match(tt.comma) && !this.match(tt.braceR))) {
|
||||
this.parseMethod(prop, isGenerator, isAsync);
|
||||
return this.finishNode(prop, "ObjectMethod");
|
||||
}
|
||||
|
||||
if (!prop.computed && prop.key.type === "Identifier" && (prop.key.name === "get" || prop.key.name === "set") && (!this.match(tt.comma) && !this.match(tt.braceR))) {
|
||||
if (isGenerator || isAsync || isPattern) this.unexpected();
|
||||
prop.kind = prop.key.name;
|
||||
this.parsePropertyName(prop);
|
||||
prop.value = this.parseMethod(false);
|
||||
this.parseMethod(prop, false);
|
||||
let paramCount = prop.kind === "get" ? 0 : 1;
|
||||
if (prop.value.params.length !== paramCount) {
|
||||
let start = prop.value.start;
|
||||
if (prop.params.length !== paramCount) {
|
||||
let start = prop.start;
|
||||
if (prop.kind === "get") {
|
||||
this.raise(start, "getter should have no params");
|
||||
} else {
|
||||
this.raise(start, "setter should have exactly one param");
|
||||
}
|
||||
}
|
||||
} else if (!prop.computed && prop.key.type === "Identifier") {
|
||||
prop.kind = "init";
|
||||
return this.finishNode(prop, "ObjectMethod");
|
||||
}
|
||||
|
||||
if (!prop.computed && prop.key.type === "Identifier") {
|
||||
if (isPattern) {
|
||||
var illegalBinding = this.isKeyword(prop.key.name);
|
||||
let illegalBinding = this.isKeyword(prop.key.name);
|
||||
if (!illegalBinding && this.state.strict) {
|
||||
illegalBinding = reservedWords.strictBind(prop.key.name) || reservedWords.strict(prop.key.name);
|
||||
}
|
||||
@ -714,9 +738,10 @@ pp.parseObjPropValue = function (prop, startPos, startLoc, isGenerator, isAsync,
|
||||
prop.value = prop.key.__clone();
|
||||
}
|
||||
prop.shorthand = true;
|
||||
} else {
|
||||
this.unexpected();
|
||||
return this.finishNode(prop, "ObjectProperty");
|
||||
}
|
||||
|
||||
this.unexpected();
|
||||
};
|
||||
|
||||
pp.parsePropertyName = function (prop) {
|
||||
@ -737,21 +762,23 @@ pp.initFunction = function (node, isAsync) {
|
||||
node.id = null;
|
||||
node.generator = false;
|
||||
node.expression = false;
|
||||
if (this.hasFeature("asyncFunctions")) {
|
||||
if (this.hasPlugin("asyncFunctions")) {
|
||||
node.async = !!isAsync;
|
||||
}
|
||||
};
|
||||
|
||||
// Parse object or class method.
|
||||
|
||||
pp.parseMethod = function (isGenerator, isAsync) {
|
||||
let node = this.startNode();
|
||||
pp.parseMethod = function (node, isGenerator, isAsync) {
|
||||
let oldInMethod = this.state.inMethod;
|
||||
this.state.inMethod = node.kind || true;
|
||||
this.initFunction(node, isAsync);
|
||||
this.expect(tt.parenL);
|
||||
node.params = this.parseBindingList(tt.parenR, false, this.hasFeature("trailingFunctionCommas"));
|
||||
node.params = this.parseBindingList(tt.parenR, false, this.hasPlugin("trailingFunctionCommas"));
|
||||
node.generator = isGenerator;
|
||||
this.parseFunctionBody(node);
|
||||
return this.finishNode(node, "FunctionExpression");
|
||||
this.state.inMethod = oldInMethod;
|
||||
return node;
|
||||
};
|
||||
|
||||
// Parse arrow function expression with given parameters.
|
||||
@ -768,8 +795,8 @@ pp.parseArrowExpression = function (node, params, isAsync) {
|
||||
pp.parseFunctionBody = function (node, allowExpression) {
|
||||
let isExpression = allowExpression && !this.match(tt.braceL);
|
||||
|
||||
var oldInAsync = this.inAsync;
|
||||
this.inAsync = node.async;
|
||||
let oldInAsync = this.state.inAsync;
|
||||
this.state.inAsync = node.async;
|
||||
if (isExpression) {
|
||||
node.body = this.parseMaybeAssign();
|
||||
node.expression = true;
|
||||
@ -782,21 +809,23 @@ pp.parseFunctionBody = function (node, allowExpression) {
|
||||
node.expression = false;
|
||||
this.state.inFunction = oldInFunc; this.state.inGenerator = oldInGen; this.state.labels = oldLabels;
|
||||
}
|
||||
this.inAsync = oldInAsync;
|
||||
this.state.inAsync = oldInAsync;
|
||||
|
||||
// If this is a strict mode function, verify that argument names
|
||||
// are not repeated, and it does not try to bind the words `eval`
|
||||
// or `arguments`.
|
||||
var checkLVal = this.state.strict;
|
||||
var checkLValStrict = false;
|
||||
let checkLVal = this.state.strict;
|
||||
let checkLValStrict = false;
|
||||
let isStrict = false;
|
||||
|
||||
// arrow function
|
||||
if (allowExpression) checkLVal = true;
|
||||
|
||||
// normal function
|
||||
if (!isExpression && node.body.directives.length) {
|
||||
for (var directive of (node.body.directives: Array<Object>)) {
|
||||
if (directive.value === "use strict") {
|
||||
for (let directive of (node.body.directives: Array<Object>)) {
|
||||
if (directive.value.value === "use strict") {
|
||||
isStrict = true;
|
||||
checkLVal = true;
|
||||
checkLValStrict = true;
|
||||
break;
|
||||
@ -804,6 +833,11 @@ pp.parseFunctionBody = function (node, allowExpression) {
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
if (isStrict && node.id && node.id.type === "Identifier" && node.id.name === "yield") {
|
||||
this.raise(node.id.start, "Binding yield in strict mode");
|
||||
}
|
||||
|
||||
if (checkLVal) {
|
||||
let nameHash = Object.create(null);
|
||||
let oldStrict = this.state.strict;
|
||||
@ -870,6 +904,10 @@ pp.parseIdentifier = function (liberal) {
|
||||
this.unexpected();
|
||||
}
|
||||
|
||||
if (!liberal && node.name === "await" && this.state.inAsync) {
|
||||
this.raise(node.start, "invalid use of await inside of an async function");
|
||||
}
|
||||
|
||||
this.next();
|
||||
return this.finishNode(node, "Identifier");
|
||||
};
|
||||
@ -899,25 +937,3 @@ pp.parseYield = function () {
|
||||
}
|
||||
return this.finishNode(node, "YieldExpression");
|
||||
};
|
||||
|
||||
// Parses array and generator comprehensions.
|
||||
|
||||
pp.parseComprehension = function (node, isGenerator) {
|
||||
node.blocks = [];
|
||||
while (this.match(tt._for)) {
|
||||
let block = this.startNode();
|
||||
this.next();
|
||||
this.expect(tt.parenL);
|
||||
block.left = this.parseBindingAtom();
|
||||
this.checkLVal(block.left, true);
|
||||
this.expectContextual("of");
|
||||
block.right = this.parseExpression();
|
||||
this.expect(tt.parenR);
|
||||
node.blocks.push(this.finishNode(block, "ComprehensionBlock"));
|
||||
}
|
||||
node.filter = this.eat(tt._if) ? this.parseParenExpression() : null;
|
||||
node.body = this.parseExpression();
|
||||
this.expect(isGenerator ? tt.parenR : tt.bracketR);
|
||||
node.generator = isGenerator;
|
||||
return this.finishNode(node, "ComprehensionExpression");
|
||||
};
|
||||
|
||||
@ -4,8 +4,6 @@ import { reservedWords } from "../util/identifier";
|
||||
import { getOptions } from "../options";
|
||||
import Tokenizer from "../tokenizer";
|
||||
|
||||
// Registered plugins
|
||||
|
||||
export const plugins = {};
|
||||
|
||||
export default class Parser extends Tokenizer {
|
||||
@ -14,12 +12,10 @@ export default class Parser extends Tokenizer {
|
||||
super(options, input);
|
||||
|
||||
this.options = options;
|
||||
this.inModule = this.options.sourceType === "module";
|
||||
this.isReservedWord = reservedWords[6];
|
||||
this.input = input;
|
||||
this.loadPlugins(this.options.plugins);
|
||||
|
||||
// Figure out if it's a module code.
|
||||
this.inModule = this.options.sourceType === "module";
|
||||
this.plugins = this.loadPlugins(this.options.plugins);
|
||||
|
||||
// If enabled, skip leading hashbang line.
|
||||
if (this.state.pos === 0 && this.input[0] === "#" && this.input[1] === "!") {
|
||||
@ -27,20 +23,31 @@ export default class Parser extends Tokenizer {
|
||||
}
|
||||
}
|
||||
|
||||
hasFeature(name: string): boolean {
|
||||
return !!this.options.features[name];
|
||||
hasPlugin(name: string): boolean {
|
||||
return !!(this.plugins["*"] || this.plugins[name]);
|
||||
}
|
||||
|
||||
extend(name: string, f: Function) {
|
||||
this[name] = f(this[name]);
|
||||
}
|
||||
|
||||
loadPlugins(plugins) {
|
||||
for (let name in plugins) {
|
||||
let plugin = exports.plugins[name];
|
||||
if (!plugin) throw new Error(`Plugin '${name}' not found`);
|
||||
plugin(this, plugins[name]);
|
||||
loadPlugins(plugins: Array<string>) {
|
||||
let pluginMap = {};
|
||||
|
||||
if (plugins.indexOf("flow") >= 0) {
|
||||
// ensure flow plugin loads last
|
||||
plugins.splice(plugins.indexOf("flow"), 1);
|
||||
plugins.push("flow");
|
||||
}
|
||||
|
||||
for (let name of plugins) {
|
||||
pluginMap[name] = true;
|
||||
|
||||
let plugin = exports.plugins[name];
|
||||
if (plugin) plugin(this);
|
||||
}
|
||||
|
||||
return pluginMap;
|
||||
}
|
||||
|
||||
parse(): {
|
||||
|
||||
@ -22,8 +22,18 @@ pp.toAssignable = function (node, isBinding) {
|
||||
node.type = "ObjectPattern";
|
||||
for (let prop of (node.properties: Array<Object>)) {
|
||||
if (prop.type === "SpreadProperty") continue;
|
||||
if (prop.kind !== "init") this.raise(prop.key.start, "Object pattern can't contain getter or setter");
|
||||
this.toAssignable(prop.value, isBinding);
|
||||
|
||||
if (prop.type === "ObjectMethod") {
|
||||
if (prop.kind === "get" || prop.kind === "set") {
|
||||
this.raise(prop.key.start, "Object pattern can't contain getter or setter");
|
||||
} else {
|
||||
this.raise(prop.key.start, "Object pattern can't contain methods");
|
||||
}
|
||||
}
|
||||
|
||||
if (prop.type === "ObjectProperty") {
|
||||
this.toAssignable(prop.value, isBinding);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@ -94,14 +104,25 @@ pp.parseSpread = function (refShorthandDefaultPos) {
|
||||
pp.parseRest = function () {
|
||||
let node = this.startNode();
|
||||
this.next();
|
||||
node.argument = this.parseIdentifier();
|
||||
node.argument = this.parseBindingIdentifier();
|
||||
return this.finishNode(node, "RestElement");
|
||||
};
|
||||
|
||||
pp.shouldAllowYieldIdentifier = function () {
|
||||
return this.match(tt._yield) && !this.state.strict && !this.state.inGenerator;
|
||||
};
|
||||
|
||||
pp.parseBindingIdentifier = function () {
|
||||
return this.parseIdentifier(this.shouldAllowYieldIdentifier());
|
||||
};
|
||||
|
||||
// Parses lvalue (assignable) atom.
|
||||
|
||||
pp.parseBindingAtom = function () {
|
||||
switch (this.state.type) {
|
||||
case tt._yield:
|
||||
if (this.state.strict || this.state.inGenerator) this.unexpected();
|
||||
|
||||
case tt.name:
|
||||
return this.parseIdentifier(true);
|
||||
|
||||
@ -120,7 +141,8 @@ pp.parseBindingAtom = function () {
|
||||
};
|
||||
|
||||
pp.parseBindingList = function (close, allowEmpty, allowTrailingComma) {
|
||||
var elts = [], first = true;
|
||||
let elts = [];
|
||||
let first = true;
|
||||
while (!this.eat(close)) {
|
||||
if (first) {
|
||||
first = false;
|
||||
@ -136,7 +158,7 @@ pp.parseBindingList = function (close, allowEmpty, allowTrailingComma) {
|
||||
this.expect(close);
|
||||
break;
|
||||
} else {
|
||||
var left = this.parseMaybeDefault();
|
||||
let left = this.parseMaybeDefault();
|
||||
this.parseAssignableListItemTypes(left);
|
||||
elts.push(this.parseMaybeDefault(null, null, left));
|
||||
}
|
||||
@ -187,7 +209,7 @@ pp.checkLVal = function (expr, isBinding, checkClashes) {
|
||||
|
||||
case "ObjectPattern":
|
||||
for (let prop of (expr.properties: Array<Object>)) {
|
||||
if (prop.type === "Property") prop = prop.value;
|
||||
if (prop.type === "ObjectProperty") prop = prop.value;
|
||||
this.checkLVal(prop, isBinding, checkClashes);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -21,8 +21,8 @@ class Node {
|
||||
loc: SourceLocation;
|
||||
|
||||
__clone(): Node {
|
||||
var node2 = new Node;
|
||||
for (var key in this) node2[key] = this[key];
|
||||
let node2 = new Node;
|
||||
for (let key in this) node2[key] = this[key];
|
||||
return node2;
|
||||
}
|
||||
}
|
||||
|
||||
@ -16,7 +16,7 @@ const pp = Parser.prototype;
|
||||
pp.parseTopLevel = function (file, program) {
|
||||
program.sourceType = this.options.sourceType;
|
||||
|
||||
this.parseBlockBody(program, true, tt.eof);
|
||||
this.parseBlockBody(program, true, true, tt.eof);
|
||||
|
||||
file.program = this.finishNode(program, "Program");
|
||||
file.comments = this.state.comments;
|
||||
@ -30,11 +30,21 @@ const loopLabel = {kind: "loop"}, switchLabel = {kind: "switch"};
|
||||
// TODO
|
||||
|
||||
pp.parseDirective = function () {
|
||||
let node = this.startNode();
|
||||
node.raw = this.input.slice(this.state.start, this.state.end);
|
||||
node.value = node.raw.slice(1, -1); // remove quotes
|
||||
let directiveLiteral = this.startNode();
|
||||
let directive = this.startNode();
|
||||
|
||||
let raw = this.input.slice(this.state.start, this.state.end);
|
||||
let val = directiveLiteral.value = raw.slice(1, -1); // remove quotes
|
||||
|
||||
this.addExtra(directiveLiteral, "raw", raw);
|
||||
this.addExtra(directiveLiteral, "rawValue", val);
|
||||
|
||||
this.next();
|
||||
return this.finishNode(node, "Directive");
|
||||
|
||||
directive.value = this.finishNode(directiveLiteral, "DirectiveLiteral");
|
||||
|
||||
this.semicolon();
|
||||
return this.finishNode(directive, "Directive");
|
||||
};
|
||||
|
||||
// Parse a single statement.
|
||||
@ -89,16 +99,18 @@ pp.parseStatement = function (declaration, topLevel) {
|
||||
case tt._export:
|
||||
case tt._import:
|
||||
if (!this.options.allowImportExportEverywhere) {
|
||||
if (!topLevel)
|
||||
if (!topLevel) {
|
||||
this.raise(this.state.start, "'import' and 'export' may only appear at the top level");
|
||||
}
|
||||
|
||||
if (!this.inModule)
|
||||
if (!this.inModule) {
|
||||
this.raise(this.state.start, "'import' and 'export' may appear only with 'sourceType: module'");
|
||||
}
|
||||
}
|
||||
return starttype === tt._import ? this.parseImport(node) : this.parseExport(node);
|
||||
|
||||
case tt.name:
|
||||
if (this.hasFeature("asyncFunctions") && this.state.value === "async") {
|
||||
if (this.hasPlugin("asyncFunctions") && this.state.value === "async") {
|
||||
// peek ahead and see if next token is a function
|
||||
let state = this.state.clone();
|
||||
this.next();
|
||||
@ -147,7 +159,7 @@ pp.parseDecorators = function (allowExport) {
|
||||
};
|
||||
|
||||
pp.parseDecorator = function () {
|
||||
if (!this.hasFeature("decorators")) {
|
||||
if (!this.hasPlugin("decorators")) {
|
||||
this.unexpected();
|
||||
}
|
||||
let node = this.startNode();
|
||||
@ -171,7 +183,8 @@ pp.parseBreakContinueStatement = function (node, keyword) {
|
||||
|
||||
// Verify that there is an actual destination to break or
|
||||
// continue to.
|
||||
for (var i = 0; i < this.state.labels.length; ++i) {
|
||||
let i;
|
||||
for (i = 0; i < this.state.labels.length; ++i) {
|
||||
let lab = this.state.labels[i];
|
||||
if (node.label == null || lab.name === node.label.name) {
|
||||
if (lab.kind != null && (isBreak || lab.kind === "loop")) break;
|
||||
@ -288,7 +301,8 @@ pp.parseSwitchStatement = function (node) {
|
||||
// nodes. `cur` is used to keep the node that we are currently
|
||||
// adding statements to.
|
||||
|
||||
for (var cur, sawDefault; !this.match(tt.braceR); ) {
|
||||
let cur;
|
||||
for (let sawDefault; !this.match(tt.braceR); ) {
|
||||
if (this.match(tt._case) || this.match(tt._default)) {
|
||||
let isCase = this.match(tt._case);
|
||||
if (cur) this.finishNode(cur, "SwitchCase");
|
||||
@ -304,8 +318,11 @@ pp.parseSwitchStatement = function (node) {
|
||||
}
|
||||
this.expect(tt.colon);
|
||||
} else {
|
||||
if (!cur) this.unexpected();
|
||||
cur.consequent.push(this.parseStatement(true));
|
||||
if (cur) {
|
||||
cur.consequent.push(this.parseStatement(true));
|
||||
} else {
|
||||
this.unexpected();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (cur) this.finishNode(cur, "SwitchCase");
|
||||
@ -325,19 +342,23 @@ pp.parseThrowStatement = function (node) {
|
||||
|
||||
// Reused empty array added for node fields that are always empty.
|
||||
|
||||
var empty = [];
|
||||
let empty = [];
|
||||
|
||||
pp.parseTryStatement = function (node) {
|
||||
this.next();
|
||||
|
||||
node.block = this.parseBlock();
|
||||
node.handler = null;
|
||||
|
||||
if (this.match(tt._catch)) {
|
||||
let clause = this.startNode();
|
||||
this.next();
|
||||
|
||||
this.expect(tt.parenL);
|
||||
clause.param = this.parseBindingAtom();
|
||||
this.checkLVal(clause.param, true, Object.create(null));
|
||||
this.expect(tt.parenR);
|
||||
|
||||
clause.body = this.parseBlock();
|
||||
node.handler = this.finishNode(clause, "CatchClause");
|
||||
}
|
||||
@ -416,35 +437,55 @@ pp.parseExpressionStatement = function (node, expr) {
|
||||
// strict"` declarations when `allowStrict` is true (used for
|
||||
// function bodies).
|
||||
|
||||
pp.parseBlock = function (allowStrict) {
|
||||
pp.parseBlock = function (allowDirectives?) {
|
||||
let node = this.startNode();
|
||||
this.expect(tt.braceL);
|
||||
this.parseBlockBody(node, allowStrict, tt.braceR);
|
||||
this.parseBlockBody(node, allowDirectives, false, tt.braceR);
|
||||
return this.finishNode(node, "BlockStatement");
|
||||
};
|
||||
|
||||
// TODO
|
||||
|
||||
pp.parseBlockBody = function (node, allowStrict, end) {
|
||||
pp.parseBlockBody = function (node, allowDirectives, topLevel, end) {
|
||||
node.body = [];
|
||||
node.directives = [];
|
||||
|
||||
let parsedNonDirective = false;
|
||||
let oldStrict;
|
||||
let octalPosition;
|
||||
|
||||
while (!this.eat(end)) {
|
||||
if (!parsedNonDirective && this.match(tt.string)) {
|
||||
let stmt = this.parseDirective();
|
||||
node.directives.push(stmt);
|
||||
if (allowDirectives && !parsedNonDirective && this.match(tt.string)) {
|
||||
let oldState = this.state;
|
||||
let lookahead = this.lookahead();
|
||||
this.state = lookahead;
|
||||
let isDirective = this.isLineTerminator();
|
||||
this.state = oldState;
|
||||
|
||||
if (allowStrict && stmt.value === "use strict") {
|
||||
oldStrict = this.state.strict;
|
||||
this.setStrict(this.state.strict = true);
|
||||
if (isDirective) {
|
||||
if (this.state.containsOctal && !octalPosition) {
|
||||
octalPosition = this.state.octalPosition;
|
||||
}
|
||||
|
||||
let stmt = this.parseDirective();
|
||||
node.directives.push(stmt);
|
||||
|
||||
if (allowDirectives && stmt.value.value === "use strict") {
|
||||
oldStrict = this.state.strict;
|
||||
this.state.strict = true;
|
||||
this.setStrict(true);
|
||||
|
||||
if (octalPosition) {
|
||||
this.raise(octalPosition, "Octal literal in strict mode");
|
||||
}
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
parsedNonDirective = true;
|
||||
node.body.push(this.parseStatement(true));
|
||||
}
|
||||
|
||||
parsedNonDirective = true;
|
||||
node.body.push(this.parseStatement(true, topLevel));
|
||||
}
|
||||
|
||||
if (oldStrict === false) {
|
||||
@ -514,25 +555,39 @@ pp.parseVarHead = function (decl) {
|
||||
// `isStatement` parameter).
|
||||
|
||||
pp.parseFunction = function (node, isStatement, allowExpressionBody, isAsync, optionalId) {
|
||||
this.initFunction(node, isAsync);
|
||||
node.generator = this.eat(tt.star);
|
||||
let oldInMethod = this.state.inMethod;
|
||||
this.state.inMethod = false;
|
||||
|
||||
if (isStatement && !optionalId && !this.match(tt.name)) {
|
||||
this.initFunction(node, isAsync);
|
||||
|
||||
if (this.match(tt.star)) {
|
||||
if (node.async && !this.hasPlugin("asyncGenerators")) {
|
||||
this.unexpected();
|
||||
} else {
|
||||
node.generator = true;
|
||||
this.next();
|
||||
}
|
||||
}
|
||||
|
||||
if (isStatement && !optionalId && !this.match(tt.name) && !this.match(tt._yield)) {
|
||||
this.unexpected();
|
||||
}
|
||||
|
||||
if (this.match(tt.name)) {
|
||||
node.id = this.parseIdentifier();
|
||||
if (this.match(tt.name) || this.match(tt._yield)) {
|
||||
node.id = this.parseBindingIdentifier();
|
||||
}
|
||||
|
||||
this.parseFunctionParams(node);
|
||||
this.parseFunctionBody(node, allowExpressionBody);
|
||||
|
||||
this.state.inMethod = oldInMethod;
|
||||
|
||||
return this.finishNode(node, isStatement ? "FunctionDeclaration" : "FunctionExpression");
|
||||
};
|
||||
|
||||
pp.parseFunctionParams = function (node) {
|
||||
this.expect(tt.parenL);
|
||||
node.params = this.parseBindingList(tt.parenR, false, this.hasFeature("trailingFunctionCommas"));
|
||||
node.params = this.parseBindingList(tt.parenR, false, this.hasPlugin("trailingFunctionCommas"));
|
||||
};
|
||||
|
||||
// Parse a class declaration or literal (depending on the
|
||||
@ -542,51 +597,99 @@ pp.parseClass = function (node, isStatement, optionalId) {
|
||||
this.next();
|
||||
this.parseClassId(node, isStatement, optionalId);
|
||||
this.parseClassSuper(node);
|
||||
var classBody = this.startNode();
|
||||
this.parseClassBody(node);
|
||||
return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression");
|
||||
};
|
||||
|
||||
pp.isClassProperty = function () {
|
||||
return this.match(tt.eq) || this.isLineTerminator();
|
||||
};
|
||||
|
||||
pp.parseClassBody = function (node) {
|
||||
// class bodies are implicitly strict
|
||||
let oldStrict = this.state.strict;
|
||||
this.state.strict = true;
|
||||
|
||||
let hadConstructorCall = false;
|
||||
let hadConstructor = false;
|
||||
classBody.body = [];
|
||||
this.expect(tt.braceL);
|
||||
let decorators = [];
|
||||
let classBody = this.startNode();
|
||||
|
||||
classBody.body = [];
|
||||
|
||||
this.expect(tt.braceL);
|
||||
|
||||
while (!this.eat(tt.braceR)) {
|
||||
if (this.eat(tt.semi)) continue;
|
||||
if (this.eat(tt.semi)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (this.match(tt.at)) {
|
||||
decorators.push(this.parseDecorator());
|
||||
continue;
|
||||
}
|
||||
var method = this.startNode();
|
||||
|
||||
let method = this.startNode();
|
||||
|
||||
// steal the decorators if there are any
|
||||
if (decorators.length) {
|
||||
method.decorators = decorators;
|
||||
decorators = [];
|
||||
}
|
||||
|
||||
let isConstructorCall = false;
|
||||
let isMaybeStatic = this.match(tt.name) && this.state.value === "static";
|
||||
var isGenerator = this.eat(tt.star), isAsync = false;
|
||||
let isGenerator = this.eat(tt.star);
|
||||
let isGetSet = false;
|
||||
let isAsync = false;
|
||||
|
||||
this.parsePropertyName(method);
|
||||
|
||||
method.static = isMaybeStatic && !this.match(tt.parenL);
|
||||
if (method.static) {
|
||||
if (isGenerator) this.unexpected();
|
||||
isGenerator = this.eat(tt.star);
|
||||
this.parsePropertyName(method);
|
||||
}
|
||||
if (!isGenerator && method.key.type === "Identifier" && !method.computed && this.isClassProperty()) {
|
||||
classBody.body.push(this.parseClassProperty(method));
|
||||
continue;
|
||||
|
||||
if (!isGenerator && method.key.type === "Identifier" && !method.computed) {
|
||||
if (this.isClassProperty()) {
|
||||
classBody.body.push(this.parseClassProperty(method));
|
||||
continue;
|
||||
}
|
||||
|
||||
if (this.hasPlugin("classConstructorCall") && method.key.name === "call" && this.match(tt.name) && this.state.value === "constructor") {
|
||||
isConstructorCall = true;
|
||||
this.parsePropertyName(method);
|
||||
}
|
||||
}
|
||||
if (this.hasFeature("asyncFunctions") && !this.match(tt.parenL) &&
|
||||
!method.computed && method.key.type === "Identifier" && method.key.name === "async") {
|
||||
|
||||
let isAsyncMethod = this.hasPlugin("asyncFunctions") && !this.match(tt.parenL) && !method.computed && method.key.type === "Identifier" && method.key.name === "async";
|
||||
if (isAsyncMethod) {
|
||||
if (this.hasPlugin("asyncGenerators") && this.eat(tt.star)) isGenerator = true;
|
||||
isAsync = true;
|
||||
this.parsePropertyName(method);
|
||||
}
|
||||
let isGetSet = false;
|
||||
|
||||
method.kind = "method";
|
||||
|
||||
if (!method.computed) {
|
||||
let {key} = method;
|
||||
let { key } = method;
|
||||
|
||||
// handle get/set methods
|
||||
// eg. class Foo { get bar() {} set bar() {} }
|
||||
if (!isAsync && !isGenerator && key.type === "Identifier" && !this.match(tt.parenL) && (key.name === "get" || key.name === "set")) {
|
||||
isGetSet = true;
|
||||
method.kind = key.name;
|
||||
key = this.parsePropertyName(method);
|
||||
}
|
||||
if (!method.static && (key.type === "Identifier" && key.name === "constructor" ||
|
||||
key.type === "StringLiteral" && key.value === "constructor")) {
|
||||
|
||||
// disallow invalid constructors
|
||||
let isConstructor = !isConstructorCall && !method.static && (
|
||||
(key.type === "Identifier" && key.name === "constructor") ||
|
||||
(key.type === "StringLiteral" && key.value === "constructor")
|
||||
);
|
||||
if (isConstructor) {
|
||||
if (hadConstructor) this.raise(key.start, "Duplicate constructor in the same class");
|
||||
if (isGetSet) this.raise(key.start, "Constructor can't have get/set modifier");
|
||||
if (isGenerator) this.raise(key.start, "Constructor can't be a generator");
|
||||
@ -594,15 +697,37 @@ pp.parseClass = function (node, isStatement, optionalId) {
|
||||
method.kind = "constructor";
|
||||
hadConstructor = true;
|
||||
}
|
||||
|
||||
// disallow static prototype method
|
||||
let isStaticPrototype = method.static && (
|
||||
(key.type === "Identifier" && key.name === "prototype") ||
|
||||
(key.type === "StringLiteral" && key.value === "prototype")
|
||||
);
|
||||
if (isStaticPrototype) {
|
||||
this.raise(key.start, "Classes may not have static property named prototype");
|
||||
}
|
||||
}
|
||||
if (method.kind === "constructor" && method.decorators) {
|
||||
|
||||
// convert constructor to a constructor call
|
||||
if (isConstructorCall) {
|
||||
if (hadConstructorCall) this.raise(method.start, "Duplicate constructor call in the same class");
|
||||
method.kind = "constructorCall";
|
||||
hadConstructorCall = true;
|
||||
}
|
||||
|
||||
// disallow decorators on class constructors
|
||||
if ((method.kind === "constructor" || method.kind === "constructorCall") && method.decorators) {
|
||||
this.raise(method.start, "You can't attach decorators to a class constructor");
|
||||
}
|
||||
|
||||
this.parseClassMethod(classBody, method, isGenerator, isAsync);
|
||||
|
||||
// get methods aren't allowed to have any parameters
|
||||
// set methods must have exactly 1 parameter
|
||||
if (isGetSet) {
|
||||
let paramCount = method.kind === "get" ? 0 : 1;
|
||||
if (method.value.params.length !== paramCount) {
|
||||
let start = method.value.start;
|
||||
if (method.params.length !== paramCount) {
|
||||
let start = method.start;
|
||||
if (method.kind === "get") {
|
||||
this.raise(start, "getter should have no params");
|
||||
} else {
|
||||
@ -617,16 +742,13 @@ pp.parseClass = function (node, isStatement, optionalId) {
|
||||
}
|
||||
|
||||
node.body = this.finishNode(classBody, "ClassBody");
|
||||
return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression");
|
||||
};
|
||||
|
||||
pp.isClassProperty = function () {
|
||||
return this.match(tt.eq) || (this.match(tt.semi) || this.canInsertSemicolon());
|
||||
this.state.strict = oldStrict;
|
||||
};
|
||||
|
||||
pp.parseClassProperty = function (node) {
|
||||
if (this.match(tt.eq)) {
|
||||
if (!this.hasFeature("classProperties")) this.unexpected();
|
||||
if (!this.hasPlugin("classProperties")) this.unexpected();
|
||||
this.next();
|
||||
node.value = this.parseMaybeAssign();
|
||||
} else {
|
||||
@ -637,8 +759,8 @@ pp.parseClassProperty = function (node) {
|
||||
};
|
||||
|
||||
pp.parseClassMethod = function (classBody, method, isGenerator, isAsync) {
|
||||
method.value = this.parseMethod(isGenerator, isAsync);
|
||||
classBody.body.push(this.finishNode(method, "MethodDefinition"));
|
||||
this.parseMethod(method, isGenerator, isAsync);
|
||||
classBody.body.push(this.finishNode(method, "ClassMethod"));
|
||||
};
|
||||
|
||||
pp.parseClassId = function (node, isStatement, optionalId) {
|
||||
@ -665,7 +787,7 @@ pp.parseExport = function (node) {
|
||||
if (this.match(tt.star)) {
|
||||
let specifier = this.startNode();
|
||||
this.next();
|
||||
if (this.hasFeature("exportExtensions") && this.eatContextual("as")) {
|
||||
if (this.hasPlugin("exportExtensions") && this.eatContextual("as")) {
|
||||
specifier.exported = this.parseIdentifier();
|
||||
node.specifiers = [this.finishNode(specifier, "ExportNamespaceSpecifier")];
|
||||
this.parseExportSpecifiersMaybe(node);
|
||||
@ -674,7 +796,7 @@ pp.parseExport = function (node) {
|
||||
this.parseExportFrom(node, true);
|
||||
return this.finishNode(node, "ExportAllDeclaration");
|
||||
}
|
||||
} else if (this.hasFeature("exportExtensions") && this.isExportDefaultSpecifier()) {
|
||||
} else if (this.hasPlugin("exportExtensions") && this.isExportDefaultSpecifier()) {
|
||||
let specifier = this.startNode();
|
||||
specifier.exported = this.parseIdentifier(true);
|
||||
node.specifiers = [this.finishNode(specifier, "ExportDefaultSpecifier")];
|
||||
@ -730,7 +852,7 @@ pp.isExportDefaultSpecifier = function () {
|
||||
return false;
|
||||
}
|
||||
|
||||
var lookahead = this.lookahead();
|
||||
let lookahead = this.lookahead();
|
||||
return lookahead.type === tt.comma || (lookahead.type === tt.name && lookahead.value === "from");
|
||||
};
|
||||
|
||||
@ -756,12 +878,12 @@ pp.parseExportFrom = function (node, expect?) {
|
||||
};
|
||||
|
||||
pp.shouldParseExportDeclaration = function () {
|
||||
return this.hasFeature("asyncFunctions") && this.isContextual("async");
|
||||
return this.hasPlugin("asyncFunctions") && this.isContextual("async");
|
||||
};
|
||||
|
||||
pp.checkExport = function (node) {
|
||||
if (this.state.decorators.length) {
|
||||
var isClass = node.declaration && (node.declaration.type === "ClassDeclaration" || node.declaration.type === "ClassExpression");
|
||||
let isClass = node.declaration && (node.declaration.type === "ClassDeclaration" || node.declaration.type === "ClassExpression");
|
||||
if (!node.declaration || !isClass) {
|
||||
this.raise(node.start, "You can only use decorators on an export when exporting a class");
|
||||
}
|
||||
@ -826,10 +948,10 @@ pp.parseImport = function (node) {
|
||||
// Parses a comma-separated list of module imports.
|
||||
|
||||
pp.parseImportSpecifiers = function (node) {
|
||||
var first = true;
|
||||
let first = true;
|
||||
if (this.match(tt.name)) {
|
||||
// import defaultObj, { x, y as z } from '...'
|
||||
var startPos = this.state.start, startLoc = this.state.startLoc;
|
||||
let startPos = this.state.start, startLoc = this.state.startLoc;
|
||||
node.specifiers.push(this.parseImportSpecifierDefault(this.parseIdentifier(), startPos, startLoc));
|
||||
if (!this.eat(tt.comma)) return;
|
||||
}
|
||||
@ -862,7 +984,7 @@ pp.parseImportSpecifiers = function (node) {
|
||||
};
|
||||
|
||||
pp.parseImportSpecifierDefault = function (id, startPos, startLoc) {
|
||||
var node = this.startNodeAt(startPos, startLoc);
|
||||
let node = this.startNodeAt(startPos, startLoc);
|
||||
node.local = id;
|
||||
this.checkLVal(node.local, true);
|
||||
return this.finishNode(node, "ImportDefaultSpecifier");
|
||||
|
||||
@ -13,7 +13,7 @@ const pp = Parser.prototype;
|
||||
pp.addExtra = function (node, key, val) {
|
||||
if (!node) return;
|
||||
|
||||
var extra = node.extra = node.extra || {};
|
||||
let extra = node.extra = node.extra || {};
|
||||
extra[key] = val;
|
||||
};
|
||||
|
||||
|
||||
@ -3,13 +3,13 @@
|
||||
import { types as tt } from "../tokenizer/types";
|
||||
import Parser from "../parser";
|
||||
|
||||
var pp = Parser.prototype;
|
||||
let pp = Parser.prototype;
|
||||
|
||||
pp.flowParseTypeInitialiser = function (tok) {
|
||||
var oldInType = this.state.inType;
|
||||
let oldInType = this.state.inType;
|
||||
this.state.inType = true;
|
||||
this.expect(tok || tt.colon);
|
||||
var type = this.flowParseType();
|
||||
let type = this.flowParseType();
|
||||
this.state.inType = oldInType;
|
||||
return type;
|
||||
};
|
||||
@ -23,10 +23,10 @@ pp.flowParseDeclareClass = function (node) {
|
||||
pp.flowParseDeclareFunction = function (node) {
|
||||
this.next();
|
||||
|
||||
var id = node.id = this.parseIdentifier();
|
||||
let id = node.id = this.parseIdentifier();
|
||||
|
||||
var typeNode = this.startNode();
|
||||
var typeContainer = this.startNode();
|
||||
let typeNode = this.startNode();
|
||||
let typeContainer = this.startNode();
|
||||
|
||||
if (this.isRelational("<")) {
|
||||
typeNode.typeParameters = this.flowParseTypeParameterDeclaration();
|
||||
@ -35,7 +35,7 @@ pp.flowParseDeclareFunction = function (node) {
|
||||
}
|
||||
|
||||
this.expect(tt.parenL);
|
||||
var tmp = this.flowParseFunctionTypeParams();
|
||||
let tmp = this.flowParseFunctionTypeParams();
|
||||
typeNode.params = tmp.params;
|
||||
typeNode.rest = tmp.rest;
|
||||
this.expect(tt.parenR);
|
||||
@ -81,11 +81,11 @@ pp.flowParseDeclareModule = function (node) {
|
||||
node.id = this.parseIdentifier();
|
||||
}
|
||||
|
||||
var bodyNode = node.body = this.startNode();
|
||||
var body = bodyNode.body = [];
|
||||
let bodyNode = node.body = this.startNode();
|
||||
let body = bodyNode.body = [];
|
||||
this.expect(tt.braceL);
|
||||
while (!this.match(tt.braceR)) {
|
||||
var node2 = this.startNode();
|
||||
let node2 = this.startNode();
|
||||
|
||||
// todo: declare check
|
||||
this.next();
|
||||
@ -122,7 +122,7 @@ pp.flowParseInterfaceish = function (node, allowStatic) {
|
||||
};
|
||||
|
||||
pp.flowParseInterfaceExtends = function () {
|
||||
var node = this.startNode();
|
||||
let node = this.startNode();
|
||||
|
||||
node.id = this.parseIdentifier();
|
||||
if (this.isRelational("<")) {
|
||||
@ -159,7 +159,7 @@ pp.flowParseTypeAlias = function (node) {
|
||||
// Type annotations
|
||||
|
||||
pp.flowParseTypeParameterDeclaration = function () {
|
||||
var node = this.startNode();
|
||||
let node = this.startNode();
|
||||
node.params = [];
|
||||
|
||||
this.expectRelational("<");
|
||||
@ -175,7 +175,7 @@ pp.flowParseTypeParameterDeclaration = function () {
|
||||
};
|
||||
|
||||
pp.flowParseTypeParameterInstantiation = function () {
|
||||
var node = this.startNode(), oldInType = this.state.inType;
|
||||
let node = this.startNode(), oldInType = this.state.inType;
|
||||
node.params = [];
|
||||
|
||||
this.state.inType = true;
|
||||
@ -238,7 +238,7 @@ pp.flowParseObjectTypeMethodish = function (node) {
|
||||
};
|
||||
|
||||
pp.flowParseObjectTypeMethod = function (startPos, startLoc, isStatic, key) {
|
||||
var node = this.startNodeAt(startPos, startLoc);
|
||||
let node = this.startNodeAt(startPos, startLoc);
|
||||
node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(startPos, startLoc));
|
||||
node.static = isStatic;
|
||||
node.key = key;
|
||||
@ -248,7 +248,7 @@ pp.flowParseObjectTypeMethod = function (startPos, startLoc, isStatic, key) {
|
||||
};
|
||||
|
||||
pp.flowParseObjectTypeCallProperty = function (node, isStatic) {
|
||||
var valueNode = this.startNode();
|
||||
let valueNode = this.startNode();
|
||||
node.static = isStatic;
|
||||
node.value = this.flowParseObjectTypeMethodish(valueNode);
|
||||
this.flowObjectTypeSemicolon();
|
||||
@ -256,10 +256,10 @@ pp.flowParseObjectTypeCallProperty = function (node, isStatic) {
|
||||
};
|
||||
|
||||
pp.flowParseObjectType = function (allowStatic) {
|
||||
var nodeStart = this.startNode();
|
||||
var node;
|
||||
var propertyKey;
|
||||
var isStatic;
|
||||
let nodeStart = this.startNode();
|
||||
let node;
|
||||
let propertyKey;
|
||||
let isStatic;
|
||||
|
||||
nodeStart.callProperties = [];
|
||||
nodeStart.properties = [];
|
||||
@ -268,8 +268,8 @@ pp.flowParseObjectType = function (allowStatic) {
|
||||
this.expect(tt.braceL);
|
||||
|
||||
while (!this.match(tt.braceR)) {
|
||||
var optional = false;
|
||||
var startPos = this.state.start, startLoc = this.state.startLoc;
|
||||
let optional = false;
|
||||
let startPos = this.state.start, startLoc = this.state.startLoc;
|
||||
node = this.startNode();
|
||||
if (allowStatic && this.isContextual("static")) {
|
||||
this.next();
|
||||
@ -315,13 +315,13 @@ pp.flowObjectTypeSemicolon = function () {
|
||||
};
|
||||
|
||||
pp.flowParseGenericType = function (startPos, startLoc, id) {
|
||||
var node = this.startNodeAt(startPos, startLoc);
|
||||
let node = this.startNodeAt(startPos, startLoc);
|
||||
|
||||
node.typeParameters = null;
|
||||
node.id = id;
|
||||
|
||||
while (this.eat(tt.dot)) {
|
||||
var node2 = this.startNodeAt(startPos, startLoc);
|
||||
let node2 = this.startNodeAt(startPos, startLoc);
|
||||
node2.qualification = node.id;
|
||||
node2.id = this.parseIdentifier();
|
||||
node.id = this.finishNode(node2, "QualifiedTypeIdentifier");
|
||||
@ -335,14 +335,14 @@ pp.flowParseGenericType = function (startPos, startLoc, id) {
|
||||
};
|
||||
|
||||
pp.flowParseTypeofType = function () {
|
||||
var node = this.startNode();
|
||||
let node = this.startNode();
|
||||
this.expect(tt._typeof);
|
||||
node.argument = this.flowParsePrimaryType();
|
||||
return this.finishNode(node, "TypeofTypeAnnotation");
|
||||
};
|
||||
|
||||
pp.flowParseTupleType = function () {
|
||||
var node = this.startNode();
|
||||
let node = this.startNode();
|
||||
node.types = [];
|
||||
this.expect(tt.bracketL);
|
||||
// We allow trailing commas
|
||||
@ -356,8 +356,8 @@ pp.flowParseTupleType = function () {
|
||||
};
|
||||
|
||||
pp.flowParseFunctionTypeParam = function () {
|
||||
var optional = false;
|
||||
var node = this.startNode();
|
||||
let optional = false;
|
||||
let node = this.startNode();
|
||||
node.name = this.parseIdentifier();
|
||||
if (this.eat(tt.question)) {
|
||||
optional = true;
|
||||
@ -368,7 +368,7 @@ pp.flowParseFunctionTypeParam = function () {
|
||||
};
|
||||
|
||||
pp.flowParseFunctionTypeParams = function () {
|
||||
var ret = { params: [], rest: null };
|
||||
let ret = { params: [], rest: null };
|
||||
while (this.match(tt.name)) {
|
||||
ret.params.push(this.flowParseFunctionTypeParam());
|
||||
if (!this.match(tt.parenR)) {
|
||||
@ -411,11 +411,11 @@ pp.flowIdentToTypeAnnotation = function (startPos, startLoc, node, id) {
|
||||
// primary types are kind of like primary expressions...they're the
|
||||
// primitives with which other types are constructed.
|
||||
pp.flowParsePrimaryType = function () {
|
||||
var startPos = this.state.start, startLoc = this.state.startLoc;
|
||||
var node = this.startNode();
|
||||
var tmp;
|
||||
var type;
|
||||
var isGroupedType = false;
|
||||
let startPos = this.state.start, startLoc = this.state.startLoc;
|
||||
let node = this.startNode();
|
||||
let tmp;
|
||||
let type;
|
||||
let isGroupedType = false;
|
||||
|
||||
switch (this.state.type) {
|
||||
case tt.name:
|
||||
@ -449,7 +449,7 @@ pp.flowParsePrimaryType = function () {
|
||||
// Check to see if this is actually a grouped type
|
||||
if (!this.match(tt.parenR) && !this.match(tt.ellipsis)) {
|
||||
if (this.match(tt.name)) {
|
||||
var token = this.lookahead().type;
|
||||
let token = this.lookahead().type;
|
||||
isGroupedType = token !== tt.question && token !== tt.colon;
|
||||
} else {
|
||||
isGroupedType = true;
|
||||
@ -490,8 +490,9 @@ pp.flowParsePrimaryType = function () {
|
||||
return this.finishNode(node, "FunctionTypeAnnotation");
|
||||
|
||||
case tt.string:
|
||||
node.rawValue = node.value = this.state.value;
|
||||
node.raw = this.input.slice(this.state.start, this.state.end);
|
||||
node.value = this.state.value;
|
||||
this.addExtra(node, "rawValue", node.value);
|
||||
this.addExtra(node, "raw", this.input.slice(this.state.start, this.state.end));
|
||||
this.next();
|
||||
return this.finishNode(node, "StringLiteralTypeAnnotation");
|
||||
|
||||
@ -501,8 +502,9 @@ pp.flowParsePrimaryType = function () {
|
||||
return this.finishNode(node, "BooleanLiteralTypeAnnotation");
|
||||
|
||||
case tt.num:
|
||||
node.rawValue = node.value = this.state.value;
|
||||
node.raw = this.input.slice(this.state.start, this.state.end);
|
||||
node.value = this.state.value;
|
||||
this.addExtra(node, "rawValue", node.value);
|
||||
this.addExtra(node, "raw", this.input.slice(this.state.start, this.state.end));
|
||||
this.next();
|
||||
return this.finishNode(node, "NumberLiteralTypeAnnotation");
|
||||
|
||||
@ -516,8 +518,8 @@ pp.flowParsePrimaryType = function () {
|
||||
};
|
||||
|
||||
pp.flowParsePostfixType = function () {
|
||||
var node = this.startNode();
|
||||
var type = node.elementType = this.flowParsePrimaryType();
|
||||
let node = this.startNode();
|
||||
let type = node.elementType = this.flowParsePrimaryType();
|
||||
if (this.match(tt.bracketL)) {
|
||||
this.expect(tt.bracketL);
|
||||
this.expect(tt.bracketR);
|
||||
@ -528,7 +530,7 @@ pp.flowParsePostfixType = function () {
|
||||
};
|
||||
|
||||
pp.flowParsePrefixType = function () {
|
||||
var node = this.startNode();
|
||||
let node = this.startNode();
|
||||
if (this.eat(tt.question)) {
|
||||
node.typeAnnotation = this.flowParsePrefixType();
|
||||
return this.finishNode(node, "NullableTypeAnnotation");
|
||||
@ -538,8 +540,8 @@ pp.flowParsePrefixType = function () {
|
||||
};
|
||||
|
||||
pp.flowParseIntersectionType = function () {
|
||||
var node = this.startNode();
|
||||
var type = this.flowParsePrefixType();
|
||||
let node = this.startNode();
|
||||
let type = this.flowParsePrefixType();
|
||||
node.types = [type];
|
||||
while (this.eat(tt.bitwiseAND)) {
|
||||
node.types.push(this.flowParsePrefixType());
|
||||
@ -548,8 +550,8 @@ pp.flowParseIntersectionType = function () {
|
||||
};
|
||||
|
||||
pp.flowParseUnionType = function () {
|
||||
var node = this.startNode();
|
||||
var type = this.flowParseIntersectionType();
|
||||
let node = this.startNode();
|
||||
let type = this.flowParseIntersectionType();
|
||||
node.types = [type];
|
||||
while (this.eat(tt.bitwiseOR)) {
|
||||
node.types.push(this.flowParseIntersectionType());
|
||||
@ -558,22 +560,22 @@ pp.flowParseUnionType = function () {
|
||||
};
|
||||
|
||||
pp.flowParseType = function () {
|
||||
var oldInType = this.state.inType;
|
||||
let oldInType = this.state.inType;
|
||||
this.state.inType = true;
|
||||
var type = this.flowParseUnionType();
|
||||
let type = this.flowParseUnionType();
|
||||
this.state.inType = oldInType;
|
||||
return type;
|
||||
};
|
||||
|
||||
pp.flowParseTypeAnnotation = function () {
|
||||
var node = this.startNode();
|
||||
let node = this.startNode();
|
||||
node.typeAnnotation = this.flowParseTypeInitialiser();
|
||||
return this.finishNode(node, "TypeAnnotation");
|
||||
};
|
||||
|
||||
pp.flowParseTypeAnnotatableIdentifier = function (requireTypeAnnotation, canBeOptionalParam) {
|
||||
var ident = this.parseIdentifier();
|
||||
var isOptionalParam = false;
|
||||
let ident = this.parseIdentifier();
|
||||
let isOptionalParam = false;
|
||||
|
||||
if (canBeOptionalParam && this.eat(tt.question)) {
|
||||
this.expect(tt.question);
|
||||
@ -612,7 +614,7 @@ export default function (instance) {
|
||||
return function (declaration, topLevel) {
|
||||
// strict mode handling of `interface` since it's a reserved word
|
||||
if (this.state.strict && this.match(tt.name) && this.state.value === "interface") {
|
||||
var node = this.startNode();
|
||||
let node = this.startNode();
|
||||
this.next();
|
||||
return this.flowParseInterface(node);
|
||||
} else {
|
||||
@ -652,7 +654,7 @@ export default function (instance) {
|
||||
instance.extend("parseParenItem", function () {
|
||||
return function (node, startLoc, startPos, forceArrow?) {
|
||||
if (this.match(tt.colon)) {
|
||||
var typeCastNode = this.startNodeAt(startLoc, startPos);
|
||||
let typeCastNode = this.startNodeAt(startLoc, startPos);
|
||||
typeCastNode.expression = node;
|
||||
typeCastNode.typeAnnotation = this.flowParseTypeAnnotation();
|
||||
|
||||
@ -662,7 +664,7 @@ export default function (instance) {
|
||||
|
||||
if (this.eat(tt.arrow)) {
|
||||
// ((lol): number => {});
|
||||
var func = this.parseArrowExpression(this.startNodeAt(startLoc, startPos), [node]);
|
||||
let func = this.parseArrowExpression(this.startNodeAt(startLoc, startPos), [node]);
|
||||
func.returnType = typeCastNode.typeAnnotation;
|
||||
return func;
|
||||
} else {
|
||||
@ -689,7 +691,7 @@ export default function (instance) {
|
||||
if (this.isContextual("type")) {
|
||||
node.exportKind = "type";
|
||||
|
||||
var declarationNode = this.startNode();
|
||||
let declarationNode = this.startNode();
|
||||
this.next();
|
||||
|
||||
if (this.match(tt.braceL)) {
|
||||
@ -754,8 +756,8 @@ export default function (instance) {
|
||||
// turn type casts that we found in function parameter head into type annotated params
|
||||
instance.extend("toAssignableList", function (inner) {
|
||||
return function (exprList, isBinding) {
|
||||
for (var i = 0; i < exprList.length; i++) {
|
||||
var expr = exprList[i];
|
||||
for (let i = 0; i < exprList.length; i++) {
|
||||
let expr = exprList[i];
|
||||
if (expr && expr.type === "TypeCastExpression") {
|
||||
exprList[i] = typeCastToParameter(expr);
|
||||
}
|
||||
@ -768,8 +770,8 @@ export default function (instance) {
|
||||
// type casts that we've found that are illegal in this context
|
||||
instance.extend("toReferencedList", function () {
|
||||
return function (exprList) {
|
||||
for (var i = 0; i < exprList.length; i++) {
|
||||
var expr = exprList[i];
|
||||
for (let i = 0; i < exprList.length; i++) {
|
||||
let expr = exprList[i];
|
||||
if (expr && expr._exprListItem && expr.type === "TypeCastExpression") {
|
||||
this.raise(expr.start, "Unexpected type cast");
|
||||
}
|
||||
@ -783,8 +785,8 @@ export default function (instance) {
|
||||
// the position where this function is cal;ed
|
||||
instance.extend("parseExprListItem", function (inner) {
|
||||
return function (allowEmpty, refShorthandDefaultPos) {
|
||||
var container = this.startNode();
|
||||
var node = inner.call(this, allowEmpty, refShorthandDefaultPos);
|
||||
let container = this.startNode();
|
||||
let node = inner.call(this, allowEmpty, refShorthandDefaultPos);
|
||||
if (this.match(tt.colon)) {
|
||||
container._exprListItem = true;
|
||||
container.expression = node;
|
||||
@ -816,13 +818,11 @@ export default function (instance) {
|
||||
// parse type parameters for class methods
|
||||
instance.extend("parseClassMethod", function () {
|
||||
return function (classBody, method, isGenerator, isAsync) {
|
||||
var typeParameters;
|
||||
if (this.isRelational("<")) {
|
||||
typeParameters = this.flowParseTypeParameterDeclaration();
|
||||
method.typeParameters = this.flowParseTypeParameterDeclaration();
|
||||
}
|
||||
method.value = this.parseMethod(isGenerator, isAsync);
|
||||
method.value.typeParameters = typeParameters;
|
||||
classBody.body.push(this.finishNode(method, "MethodDefinition"));
|
||||
this.parseMethod(method, isGenerator, isAsync);
|
||||
classBody.body.push(this.finishNode(method, "ClassMethod"));
|
||||
};
|
||||
});
|
||||
|
||||
@ -835,7 +835,7 @@ export default function (instance) {
|
||||
}
|
||||
if (this.isContextual("implements")) {
|
||||
this.next();
|
||||
var implemented = node.implements = [];
|
||||
let implemented = node.implements = [];
|
||||
do {
|
||||
let node = this.startNode();
|
||||
node.id = this.parseIdentifier();
|
||||
@ -853,7 +853,7 @@ export default function (instance) {
|
||||
// parse type parameters for object method shorthand
|
||||
instance.extend("parseObjPropValue", function (inner) {
|
||||
return function (prop) {
|
||||
var typeParameters;
|
||||
let typeParameters;
|
||||
|
||||
// method shorthand
|
||||
if (this.isRelational("<")) {
|
||||
@ -865,7 +865,7 @@ export default function (instance) {
|
||||
|
||||
// add typeParameters if we found them
|
||||
if (typeParameters) {
|
||||
prop.value.typeParameters = typeParameters;
|
||||
(prop.value || prop).typeParameters = typeParameters;
|
||||
}
|
||||
};
|
||||
});
|
||||
@ -889,14 +889,14 @@ export default function (instance) {
|
||||
return function (node) {
|
||||
node.importKind = "value";
|
||||
|
||||
var kind = null;
|
||||
let kind = null;
|
||||
if (this.match(tt._typeof)) {
|
||||
kind = "typeof";
|
||||
} else if (this.isContextual("type")) {
|
||||
kind = "type";
|
||||
}
|
||||
if (kind) {
|
||||
var lh = this.lookahead();
|
||||
let lh = this.lookahead();
|
||||
if ((lh.type === tt.name && lh.value !== "from") || lh.type === tt.braceL || lh.type === tt.star) {
|
||||
this.next();
|
||||
node.importKind = kind;
|
||||
@ -917,7 +917,7 @@ export default function (instance) {
|
||||
};
|
||||
});
|
||||
|
||||
// parse flow type annotations on variable declarator heads - var foo: string = bar
|
||||
// parse flow type annotations on variable declarator heads - let foo: string = bar
|
||||
instance.extend("parseVarHead", function (inner) {
|
||||
return function (decl) {
|
||||
inner.call(this, decl);
|
||||
@ -928,7 +928,7 @@ export default function (instance) {
|
||||
};
|
||||
});
|
||||
|
||||
// parse the return type of an async arrow function - var foo = (async (): number => {});
|
||||
// parse the return type of an async arrow function - let foo = (async (): number => {});
|
||||
instance.extend("parseAsyncArrowFromCallExpression", function (inner) {
|
||||
return function (node, call) {
|
||||
if (this.match(tt.colon)) {
|
||||
@ -953,7 +953,7 @@ export default function (instance) {
|
||||
startLoc = startLoc || this.state.startLoc;
|
||||
|
||||
if (this.lookahead().type === tt.parenR) {
|
||||
// var foo = (): number => {};
|
||||
// let foo = (): number => {};
|
||||
this.expect(tt.parenL);
|
||||
this.expect(tt.parenR);
|
||||
|
||||
@ -962,11 +962,11 @@ export default function (instance) {
|
||||
this.expect(tt.arrow);
|
||||
return this.parseArrowExpression(node, [], isAsync);
|
||||
} else {
|
||||
// var foo = (foo): number => {};
|
||||
// let foo = (foo): number => {};
|
||||
let node = inner.call(this, startPos, startLoc, canBeArrow, isAsync);
|
||||
|
||||
if (this.match(tt.colon)) {
|
||||
var state = this.state.clone();
|
||||
let state = this.state.clone();
|
||||
try {
|
||||
return this.parseParenItem(node, startPos, startLoc, true);
|
||||
} catch (err) {
|
||||
|
||||
@ -26,7 +26,7 @@ tt.jsxTagStart.updateContext = function() {
|
||||
};
|
||||
|
||||
tt.jsxTagEnd.updateContext = function(prevType) {
|
||||
var out = this.state.context.pop();
|
||||
let out = this.state.context.pop();
|
||||
if (out === tc.j_oTag && prevType === tt.slash || out === tc.j_cTag) {
|
||||
this.state.context.pop();
|
||||
this.state.exprAllowed = this.curContext() === tc.j_expr;
|
||||
@ -35,18 +35,19 @@ tt.jsxTagEnd.updateContext = function(prevType) {
|
||||
}
|
||||
};
|
||||
|
||||
var pp = Parser.prototype;
|
||||
let pp = Parser.prototype;
|
||||
|
||||
// Reads inline JSX contents token.
|
||||
|
||||
pp.jsxReadToken = function() {
|
||||
var out = "", chunkStart = this.state.pos;
|
||||
let out = "";
|
||||
let chunkStart = this.state.pos;
|
||||
for (;;) {
|
||||
if (this.state.pos >= this.input.length) {
|
||||
this.raise(this.state.start, "Unterminated JSX contents");
|
||||
}
|
||||
|
||||
var ch = this.input.charCodeAt(this.state.pos);
|
||||
let ch = this.input.charCodeAt(this.state.pos);
|
||||
|
||||
switch (ch) {
|
||||
case 60: // "<"
|
||||
@ -80,8 +81,8 @@ pp.jsxReadToken = function() {
|
||||
};
|
||||
|
||||
pp.jsxReadNewLine = function(normalizeCRLF) {
|
||||
var ch = this.input.charCodeAt(this.state.pos);
|
||||
var out;
|
||||
let ch = this.input.charCodeAt(this.state.pos);
|
||||
let out;
|
||||
++this.state.pos;
|
||||
if (ch === 13 && this.input.charCodeAt(this.state.pos) === 10) {
|
||||
++this.state.pos;
|
||||
@ -96,13 +97,14 @@ pp.jsxReadNewLine = function(normalizeCRLF) {
|
||||
};
|
||||
|
||||
pp.jsxReadString = function(quote) {
|
||||
var out = "", chunkStart = ++this.state.pos;
|
||||
let out = "";
|
||||
let chunkStart = ++this.state.pos;
|
||||
for (;;) {
|
||||
if (this.state.pos >= this.input.length) {
|
||||
this.raise(this.state.start, "Unterminated string constant");
|
||||
}
|
||||
|
||||
var ch = this.input.charCodeAt(this.state.pos);
|
||||
let ch = this.input.charCodeAt(this.state.pos);
|
||||
if (ch === quote) break;
|
||||
if (ch === 38) { // "&"
|
||||
out += this.input.slice(chunkStart, this.state.pos);
|
||||
@ -121,10 +123,12 @@ pp.jsxReadString = function(quote) {
|
||||
};
|
||||
|
||||
pp.jsxReadEntity = function() {
|
||||
var str = "", count = 0, entity;
|
||||
var ch = this.input[this.state.pos];
|
||||
let str = "";
|
||||
let count = 0;
|
||||
let entity;
|
||||
let ch = this.input[this.state.pos];
|
||||
|
||||
var startPos = ++this.state.pos;
|
||||
let startPos = ++this.state.pos;
|
||||
while (this.state.pos < this.input.length && count++ < 10) {
|
||||
ch = this.input[this.state.pos++];
|
||||
if (ch === ";") {
|
||||
@ -161,7 +165,8 @@ pp.jsxReadEntity = function() {
|
||||
// by isIdentifierStart in readToken.
|
||||
|
||||
pp.jsxReadWord = function() {
|
||||
var ch, start = this.state.pos;
|
||||
let ch;
|
||||
let start = this.state.pos;
|
||||
do {
|
||||
ch = this.input.charCodeAt(++this.state.pos);
|
||||
} while (isIdentifierChar(ch) || ch === 45); // "-"
|
||||
@ -187,7 +192,7 @@ function getQualifiedJSXName(object) {
|
||||
// Parse next token as JSX identifier
|
||||
|
||||
pp.jsxParseIdentifier = function() {
|
||||
var node = this.startNode();
|
||||
let node = this.startNode();
|
||||
if (this.match(tt.jsxName)) {
|
||||
node.name = this.state.value;
|
||||
} else if (this.state.type.keyword) {
|
||||
@ -202,11 +207,11 @@ pp.jsxParseIdentifier = function() {
|
||||
// Parse namespaced identifier.
|
||||
|
||||
pp.jsxParseNamespacedName = function() {
|
||||
var startPos = this.state.start, startLoc = this.state.startLoc;
|
||||
var name = this.jsxParseIdentifier();
|
||||
let startPos = this.state.start, startLoc = this.state.startLoc;
|
||||
let name = this.jsxParseIdentifier();
|
||||
if (!this.eat(tt.colon)) return name;
|
||||
|
||||
var node = this.startNodeAt(startPos, startLoc);
|
||||
let node = this.startNodeAt(startPos, startLoc);
|
||||
node.namespace = name;
|
||||
node.name = this.jsxParseIdentifier();
|
||||
return this.finishNode(node, "JSXNamespacedName");
|
||||
@ -216,10 +221,10 @@ pp.jsxParseNamespacedName = function() {
|
||||
// or single identifier.
|
||||
|
||||
pp.jsxParseElementName = function() {
|
||||
var startPos = this.state.start, startLoc = this.state.startLoc;
|
||||
var node = this.jsxParseNamespacedName();
|
||||
let startPos = this.state.start, startLoc = this.state.startLoc;
|
||||
let node = this.jsxParseNamespacedName();
|
||||
while (this.eat(tt.dot)) {
|
||||
var newNode = this.startNodeAt(startPos, startLoc);
|
||||
let newNode = this.startNodeAt(startPos, startLoc);
|
||||
newNode.object = node;
|
||||
newNode.property = this.jsxParseIdentifier();
|
||||
node = this.finishNode(newNode, "JSXMemberExpression");
|
||||
@ -230,7 +235,7 @@ pp.jsxParseElementName = function() {
|
||||
// Parses any type of JSX attribute value.
|
||||
|
||||
pp.jsxParseAttributeValue = function() {
|
||||
var node;
|
||||
let node;
|
||||
switch (this.state.type) {
|
||||
case tt.braceL:
|
||||
node = this.jsxParseExpressionContainer();
|
||||
@ -243,7 +248,7 @@ pp.jsxParseAttributeValue = function() {
|
||||
case tt.jsxTagStart:
|
||||
case tt.string:
|
||||
node = this.parseExprAtom();
|
||||
node.rawValue = null;
|
||||
node.extra = null;
|
||||
return node;
|
||||
|
||||
default:
|
||||
@ -251,27 +256,20 @@ pp.jsxParseAttributeValue = function() {
|
||||
}
|
||||
};
|
||||
|
||||
// JSXEmptyExpression is unique type since it doesn"t actually parse anything,
|
||||
// JSXEmptyExpression is unique type since it doesn't actually parse anything,
|
||||
// and so it should start at the end of last read token (left brace) and finish
|
||||
// at the beginning of the next one (right brace).
|
||||
|
||||
pp.jsxParseEmptyExpression = function() {
|
||||
var tmp = this.state.start;
|
||||
this.state.start = this.state.lastTokEnd;
|
||||
this.state.lastTokEnd = tmp;
|
||||
|
||||
tmp = this.state.startLoc;
|
||||
this.state.startLoc = this.state.lastTokEndLoc;
|
||||
this.state.lastTokEndLoc = tmp;
|
||||
|
||||
return this.finishNode(this.startNode(), "JSXEmptyExpression");
|
||||
let node = this.startNodeAt(this.lastTokEnd, this.lastTokEndLoc);
|
||||
return this.finishNodeAt(node, "JSXEmptyExpression", this.start, this.startLoc);
|
||||
};
|
||||
|
||||
// Parses JSX expression enclosed into curly brackets.
|
||||
|
||||
|
||||
pp.jsxParseExpressionContainer = function() {
|
||||
var node = this.startNode();
|
||||
let node = this.startNode();
|
||||
this.next();
|
||||
if (this.match(tt.braceR)) {
|
||||
node.expression = this.jsxParseEmptyExpression();
|
||||
@ -285,7 +283,7 @@ pp.jsxParseExpressionContainer = function() {
|
||||
// Parses following JSX attribute name-value pair.
|
||||
|
||||
pp.jsxParseAttribute = function() {
|
||||
var node = this.startNode();
|
||||
let node = this.startNode();
|
||||
if (this.eat(tt.braceL)) {
|
||||
this.expect(tt.ellipsis);
|
||||
node.argument = this.parseMaybeAssign();
|
||||
@ -300,7 +298,7 @@ pp.jsxParseAttribute = function() {
|
||||
// Parses JSX opening tag starting after "<".
|
||||
|
||||
pp.jsxParseOpeningElementAt = function(startPos, startLoc) {
|
||||
var node = this.startNodeAt(startPos, startLoc);
|
||||
let node = this.startNodeAt(startPos, startLoc);
|
||||
node.attributes = [];
|
||||
node.name = this.jsxParseElementName();
|
||||
while (!this.match(tt.slash) && !this.match(tt.jsxTagEnd)) {
|
||||
@ -314,7 +312,7 @@ pp.jsxParseOpeningElementAt = function(startPos, startLoc) {
|
||||
// Parses JSX closing tag starting after "</".
|
||||
|
||||
pp.jsxParseClosingElementAt = function(startPos, startLoc) {
|
||||
var node = this.startNodeAt(startPos, startLoc);
|
||||
let node = this.startNodeAt(startPos, startLoc);
|
||||
node.name = this.jsxParseElementName();
|
||||
this.expect(tt.jsxTagEnd);
|
||||
return this.finishNode(node, "JSXClosingElement");
|
||||
@ -324,10 +322,10 @@ pp.jsxParseClosingElementAt = function(startPos, startLoc) {
|
||||
// (starting after "<"), attributes, contents and closing tag.
|
||||
|
||||
pp.jsxParseElementAt = function(startPos, startLoc) {
|
||||
var node = this.startNodeAt(startPos, startLoc);
|
||||
var children = [];
|
||||
var openingElement = this.jsxParseOpeningElementAt(startPos, startLoc);
|
||||
var closingElement = null;
|
||||
let node = this.startNodeAt(startPos, startLoc);
|
||||
let children = [];
|
||||
let openingElement = this.jsxParseOpeningElementAt(startPos, startLoc);
|
||||
let closingElement = null;
|
||||
|
||||
if (!openingElement.selfClosing) {
|
||||
contents: for (;;) {
|
||||
@ -375,7 +373,7 @@ pp.jsxParseElementAt = function(startPos, startLoc) {
|
||||
// Parses entire JSX element from current position.
|
||||
|
||||
pp.jsxParseElement = function() {
|
||||
var startPos = this.state.start, startLoc = this.state.startLoc;
|
||||
let startPos = this.state.start, startLoc = this.state.startLoc;
|
||||
this.next();
|
||||
return this.jsxParseElementAt(startPos, startLoc);
|
||||
};
|
||||
@ -384,9 +382,9 @@ export default function(instance) {
|
||||
instance.extend("parseExprAtom", function(inner) {
|
||||
return function(refShortHandDefaultPos) {
|
||||
if (this.match(tt.jsxText)) {
|
||||
var node = this.parseLiteral(this.state.value, "JSXText");
|
||||
let node = this.parseLiteral(this.state.value, "JSXText");
|
||||
// https://github.com/babel/babel/issues/2078
|
||||
node.rawValue = null;
|
||||
node.extra = null;
|
||||
return node;
|
||||
} else if (this.match(tt.jsxTagStart)) {
|
||||
return this.jsxParseElement();
|
||||
@ -398,7 +396,7 @@ export default function(instance) {
|
||||
|
||||
instance.extend("readToken", function(inner) {
|
||||
return function(code) {
|
||||
var context = this.curContext();
|
||||
let context = this.curContext();
|
||||
|
||||
if (context === tc.j_expr) {
|
||||
return this.jsxReadToken();
|
||||
@ -431,7 +429,7 @@ export default function(instance) {
|
||||
instance.extend("updateContext", function(inner) {
|
||||
return function(prevType) {
|
||||
if (this.match(tt.braceL)) {
|
||||
var curContext = this.curContext();
|
||||
let curContext = this.curContext();
|
||||
if (curContext === tc.j_oTag) {
|
||||
this.state.context.push(tc.b_expr);
|
||||
} else if (curContext === tc.j_expr) {
|
||||
|
||||
@ -79,30 +79,20 @@ export default class Tokenizer {
|
||||
// TODO
|
||||
|
||||
isKeyword(word) {
|
||||
if (!this.state.strict) {
|
||||
if (word === "yield" && !this.state.inGenerator) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (word === "let") {
|
||||
// check if next token is a name, braceL or bracketL, if so, it's a keyword!
|
||||
}
|
||||
}
|
||||
|
||||
return isKeyword(word);
|
||||
}
|
||||
|
||||
// TODO
|
||||
|
||||
lookahead() {
|
||||
var old = this.state;
|
||||
let old = this.state;
|
||||
this.state = old.clone(true);
|
||||
|
||||
this.isLookahead = true;
|
||||
this.next();
|
||||
this.isLookahead = false;
|
||||
|
||||
var curr = this.state.clone(true);
|
||||
let curr = this.state.clone(true);
|
||||
this.state = old;
|
||||
return curr;
|
||||
}
|
||||
@ -132,6 +122,8 @@ export default class Tokenizer {
|
||||
let curContext = this.curContext();
|
||||
if (!curContext || !curContext.preserveSpace) this.skipSpace();
|
||||
|
||||
this.state.containsOctal = false;
|
||||
this.state.octalPosition = null;
|
||||
this.state.start = this.state.pos;
|
||||
this.state.startLoc = this.state.curPosition();
|
||||
if (this.state.pos >= this.input.length) return this.finishToken(tt.eof);
|
||||
@ -162,7 +154,7 @@ export default class Tokenizer {
|
||||
}
|
||||
|
||||
pushComment(block, text, start, end, startLoc, endLoc) {
|
||||
var comment = {
|
||||
let comment = {
|
||||
type: block ? "CommentBlock" : "CommentLine",
|
||||
value: text,
|
||||
start: start,
|
||||
@ -308,11 +300,11 @@ export default class Tokenizer {
|
||||
}
|
||||
|
||||
readToken_mult_modulo(code) { // '%*'
|
||||
var type = code === 42 ? tt.star : tt.modulo;
|
||||
var width = 1;
|
||||
var next = this.input.charCodeAt(this.state.pos + 1);
|
||||
let type = code === 42 ? tt.star : tt.modulo;
|
||||
let width = 1;
|
||||
let next = this.input.charCodeAt(this.state.pos + 1);
|
||||
|
||||
if (next === 42 && this.hasFeature("exponentiationOperator")) { // '*'
|
||||
if (next === 42 && this.hasPlugin("exponentiationOperator")) { // '*'
|
||||
width++;
|
||||
next = this.input.charCodeAt(this.state.pos + 2);
|
||||
type = tt.exponent;
|
||||
@ -415,7 +407,7 @@ export default class Tokenizer {
|
||||
case 125: ++this.state.pos; return this.finishToken(tt.braceR);
|
||||
|
||||
case 58:
|
||||
if (this.hasFeature("functionBind") && this.input.charCodeAt(this.state.pos + 1) === 58) {
|
||||
if (this.hasPlugin("functionBind") && this.input.charCodeAt(this.state.pos + 1) === 58) {
|
||||
return this.finishOp(tt.doubleColon, 2);
|
||||
} else {
|
||||
++this.state.pos;
|
||||
@ -694,8 +686,14 @@ export default class Tokenizer {
|
||||
octalStr = octalStr.slice(0, -1);
|
||||
octal = parseInt(octalStr, 8);
|
||||
}
|
||||
if (octal > 0 && (this.state.strict || inTemplate)) {
|
||||
this.raise(this.state.pos - 2, "Octal literal in strict mode");
|
||||
if (octal > 0) {
|
||||
if (!this.state.containsOctal) {
|
||||
this.state.containsOctal = true;
|
||||
this.state.octalPosition = this.state.pos - 2;
|
||||
}
|
||||
if (this.state.strict || inTemplate) {
|
||||
this.raise(this.state.pos - 2, "Octal literal in strict mode");
|
||||
}
|
||||
}
|
||||
this.state.pos += octalStr.length - 1;
|
||||
return String.fromCharCode(octal);
|
||||
|
||||
@ -14,7 +14,7 @@ export default class State {
|
||||
|
||||
this.potentialArrowAt = -1;
|
||||
|
||||
this.inFunction = this.inGenerator = false;
|
||||
this.inMethod = this.inFunction = this.inGenerator = this.inAsync = false;
|
||||
|
||||
this.labels = [];
|
||||
|
||||
@ -42,7 +42,8 @@ export default class State {
|
||||
this.context = [ct.b_stat];
|
||||
this.exprAllowed = true;
|
||||
|
||||
this.containsEsc = false;
|
||||
this.containsEsc = this.containsOctal = false;
|
||||
this.octalPosition = null;
|
||||
|
||||
return this;
|
||||
}
|
||||
@ -59,6 +60,7 @@ export default class State {
|
||||
// Flags to track whether we are in a function, a generator.
|
||||
inFunction: boolean;
|
||||
inGenerator: boolean;
|
||||
inMethod: boolean;
|
||||
|
||||
// Labels in scope.
|
||||
labels: Array<Object>;
|
||||
@ -115,16 +117,20 @@ export default class State {
|
||||
// escape sequences must not be interpreted as keywords.
|
||||
containsEsc: boolean;
|
||||
|
||||
// TODO
|
||||
containsOctal: boolean;
|
||||
octalPosition: ?number;
|
||||
|
||||
curPosition() {
|
||||
return new Position(this.curLine, this.pos - this.lineStart);
|
||||
}
|
||||
|
||||
clone(skipArrays?) {
|
||||
var state = new State;
|
||||
for (var key in this) {
|
||||
var val = this[key];
|
||||
let state = new State;
|
||||
for (let key in this) {
|
||||
let val = this[key];
|
||||
|
||||
if (!skipArrays && Array.isArray(val)) {
|
||||
if ((!skipArrays || key === "context") && Array.isArray(val)) {
|
||||
val = val.slice();
|
||||
}
|
||||
|
||||
|
||||
@ -115,7 +115,7 @@ kw("catch");
|
||||
kw("continue");
|
||||
kw("debugger");
|
||||
kw("default", beforeExpr);
|
||||
kw("do", {isLoop: true});
|
||||
kw("do", {isLoop: true, beforeExpr: true});
|
||||
kw("else", beforeExpr);
|
||||
kw("finally");
|
||||
kw("for", {isLoop: true});
|
||||
|
||||
@ -49,7 +49,7 @@ nonASCIIidentifierStartChars = nonASCIIidentifierChars = null;
|
||||
// offset starts at 0x10000, and each pair of numbers represents an
|
||||
// offset to the next range, and then a size of the range. They were
|
||||
// generated by tools/generate-identifier-regex.js
|
||||
var astralIdentifierStartCodes = [
|
||||
let astralIdentifierStartCodes = [
|
||||
0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 17, 26, 6, 37, 11, 29, 3, 35, 5,
|
||||
7, 2, 4, 43, 157, 99, 39, 9, 51, 157, 310, 10, 21, 11, 7, 153, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30,
|
||||
98, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 26, 45, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14,
|
||||
@ -62,7 +62,7 @@ var astralIdentifierStartCodes = [
|
||||
0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2,
|
||||
4, 2, 16, 4421, 42710, 42, 4148, 12, 221, 16355, 541
|
||||
];
|
||||
var astralIdentifierCodes = [
|
||||
let astralIdentifierCodes = [
|
||||
509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 1306, 2, 54, 14, 32, 9, 16, 3, 46, 10,
|
||||
54, 9, 7, 2, 37, 13, 2, 9, 52, 0, 13, 2, 49, 13, 16, 9, 83, 11, 168, 11, 6, 9, 8, 2, 57, 0, 2, 6, 3, 1, 3, 2, 10,
|
||||
0, 11, 1, 3, 6, 4, 4, 316, 19, 13, 9, 214, 6, 3, 8, 112, 16, 16, 9, 82, 12, 9, 9, 535, 9, 20855, 9, 135, 4, 60, 6,
|
||||
|
||||
@ -74,7 +74,7 @@
|
||||
},
|
||||
"body": [
|
||||
{
|
||||
"type": "MethodDefinition",
|
||||
"type": "ClassMethod",
|
||||
"start": 103,
|
||||
"end": 119,
|
||||
"loc": {
|
||||
@ -107,41 +107,26 @@
|
||||
},
|
||||
"static": false,
|
||||
"kind": "method",
|
||||
"value": {
|
||||
"type": "FunctionExpression",
|
||||
"start": 110,
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 112,
|
||||
"end": 119,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 8,
|
||||
"column": 11
|
||||
"column": 13
|
||||
},
|
||||
"end": {
|
||||
"line": 9,
|
||||
"column": 5
|
||||
}
|
||||
},
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 112,
|
||||
"end": 119,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 8,
|
||||
"column": 13
|
||||
},
|
||||
"end": {
|
||||
"line": 9,
|
||||
"column": 5
|
||||
}
|
||||
},
|
||||
"body": [],
|
||||
"directives": []
|
||||
}
|
||||
"body": [],
|
||||
"directives": []
|
||||
},
|
||||
"leadingComments": [
|
||||
{
|
||||
|
||||
@ -89,7 +89,7 @@
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"type": "Property",
|
||||
"type": "ObjectProperty",
|
||||
"start": 6,
|
||||
"end": 16,
|
||||
"loc": {
|
||||
@ -140,8 +140,7 @@
|
||||
"raw": "42"
|
||||
},
|
||||
"value": 42
|
||||
},
|
||||
"kind": "init"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -89,7 +89,7 @@
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"type": "Property",
|
||||
"type": "ObjectProperty",
|
||||
"start": 6,
|
||||
"end": 12,
|
||||
"loc": {
|
||||
@ -140,8 +140,7 @@
|
||||
"raw": "42"
|
||||
},
|
||||
"value": 42
|
||||
},
|
||||
"kind": "init"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -89,7 +89,7 @@
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"type": "Property",
|
||||
"type": "ObjectProperty",
|
||||
"start": 6,
|
||||
"end": 14,
|
||||
"loc": {
|
||||
@ -140,8 +140,7 @@
|
||||
"raw": "42"
|
||||
},
|
||||
"value": 42
|
||||
},
|
||||
"kind": "init"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -89,7 +89,7 @@
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"type": "Property",
|
||||
"type": "ObjectProperty",
|
||||
"start": 6,
|
||||
"end": 15,
|
||||
"loc": {
|
||||
@ -140,8 +140,7 @@
|
||||
"raw": "42"
|
||||
},
|
||||
"value": 42
|
||||
},
|
||||
"kind": "init"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -89,7 +89,7 @@
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"type": "Property",
|
||||
"type": "ObjectProperty",
|
||||
"start": 6,
|
||||
"end": 14,
|
||||
"loc": {
|
||||
@ -140,8 +140,7 @@
|
||||
"raw": "42"
|
||||
},
|
||||
"value": 42
|
||||
},
|
||||
"kind": "init"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -89,7 +89,7 @@
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"type": "Property",
|
||||
"type": "ObjectProperty",
|
||||
"start": 6,
|
||||
"end": 18,
|
||||
"loc": {
|
||||
@ -144,8 +144,7 @@
|
||||
"raw": "42"
|
||||
},
|
||||
"value": 42
|
||||
},
|
||||
"kind": "init"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -58,7 +58,7 @@
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"type": "Property",
|
||||
"type": "ObjectProperty",
|
||||
"start": 8,
|
||||
"end": 24,
|
||||
"loc": {
|
||||
@ -109,8 +109,7 @@
|
||||
"raw": "\"Error\""
|
||||
},
|
||||
"value": "Error"
|
||||
},
|
||||
"kind": "init"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -89,7 +89,7 @@
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"type": "Property",
|
||||
"type": "ObjectProperty",
|
||||
"start": 6,
|
||||
"end": 10,
|
||||
"loc": {
|
||||
@ -140,11 +140,10 @@
|
||||
"raw": "1"
|
||||
},
|
||||
"value": 1
|
||||
},
|
||||
"kind": "init"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Property",
|
||||
"type": "ObjectProperty",
|
||||
"start": 12,
|
||||
"end": 16,
|
||||
"loc": {
|
||||
@ -195,8 +194,7 @@
|
||||
"raw": "2"
|
||||
},
|
||||
"value": 2
|
||||
},
|
||||
"kind": "init"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -89,7 +89,7 @@
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"type": "Property",
|
||||
"type": "ObjectMethod",
|
||||
"start": 6,
|
||||
"end": 36,
|
||||
"loc": {
|
||||
@ -122,78 +122,65 @@
|
||||
"name": "width"
|
||||
},
|
||||
"kind": "get",
|
||||
"value": {
|
||||
"type": "FunctionExpression",
|
||||
"start": 15,
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 18,
|
||||
"end": 36,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 15
|
||||
"column": 18
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 36
|
||||
}
|
||||
},
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 18,
|
||||
"end": 36,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 18
|
||||
"body": [
|
||||
{
|
||||
"type": "ReturnStatement",
|
||||
"start": 20,
|
||||
"end": 34,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 20
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 34
|
||||
}
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 36
|
||||
}
|
||||
},
|
||||
"body": [
|
||||
{
|
||||
"type": "ReturnStatement",
|
||||
"start": 20,
|
||||
"argument": {
|
||||
"type": "Identifier",
|
||||
"start": 27,
|
||||
"end": 34,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 20
|
||||
"column": 27
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 34
|
||||
}
|
||||
},
|
||||
"argument": {
|
||||
"type": "Identifier",
|
||||
"start": 27,
|
||||
"end": 34,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 27
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 34
|
||||
}
|
||||
},
|
||||
"name": "m_width"
|
||||
}
|
||||
"name": "m_width"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -89,7 +89,7 @@
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"type": "Property",
|
||||
"type": "ObjectMethod",
|
||||
"start": 6,
|
||||
"end": 20,
|
||||
"loc": {
|
||||
@ -122,46 +122,33 @@
|
||||
"name": "undef"
|
||||
},
|
||||
"kind": "get",
|
||||
"value": {
|
||||
"type": "FunctionExpression",
|
||||
"start": 15,
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 18,
|
||||
"end": 20,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 15
|
||||
"column": 18
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 20
|
||||
}
|
||||
},
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 18,
|
||||
"end": 20,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 18
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 20
|
||||
}
|
||||
},
|
||||
"body": []
|
||||
}
|
||||
"body": [],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -89,7 +89,7 @@
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"type": "Property",
|
||||
"type": "ObjectMethod",
|
||||
"start": 6,
|
||||
"end": 17,
|
||||
"loc": {
|
||||
@ -122,46 +122,33 @@
|
||||
"name": "if"
|
||||
},
|
||||
"kind": "get",
|
||||
"value": {
|
||||
"type": "FunctionExpression",
|
||||
"start": 12,
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 15,
|
||||
"end": 17,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 12
|
||||
"column": 15
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 17
|
||||
}
|
||||
},
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 15,
|
||||
"end": 17,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 15
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 17
|
||||
}
|
||||
},
|
||||
"body": []
|
||||
}
|
||||
"body": [],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -89,7 +89,7 @@
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"type": "Property",
|
||||
"type": "ObjectMethod",
|
||||
"start": 6,
|
||||
"end": 19,
|
||||
"loc": {
|
||||
@ -122,46 +122,33 @@
|
||||
"name": "true"
|
||||
},
|
||||
"kind": "get",
|
||||
"value": {
|
||||
"type": "FunctionExpression",
|
||||
"start": 14,
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 17,
|
||||
"end": 19,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 14
|
||||
"column": 17
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 19
|
||||
}
|
||||
},
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 17,
|
||||
"end": 19,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 17
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 19
|
||||
}
|
||||
},
|
||||
"body": []
|
||||
}
|
||||
"body": [],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -89,7 +89,7 @@
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"type": "Property",
|
||||
"type": "ObjectMethod",
|
||||
"start": 6,
|
||||
"end": 20,
|
||||
"loc": {
|
||||
@ -122,46 +122,33 @@
|
||||
"name": "false"
|
||||
},
|
||||
"kind": "get",
|
||||
"value": {
|
||||
"type": "FunctionExpression",
|
||||
"start": 15,
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 18,
|
||||
"end": 20,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 15
|
||||
"column": 18
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 20
|
||||
}
|
||||
},
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 18,
|
||||
"end": 20,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 18
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 20
|
||||
}
|
||||
},
|
||||
"body": []
|
||||
}
|
||||
"body": [],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -89,7 +89,7 @@
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"type": "Property",
|
||||
"type": "ObjectMethod",
|
||||
"start": 6,
|
||||
"end": 19,
|
||||
"loc": {
|
||||
@ -122,46 +122,33 @@
|
||||
"name": "null"
|
||||
},
|
||||
"kind": "get",
|
||||
"value": {
|
||||
"type": "FunctionExpression",
|
||||
"start": 14,
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 17,
|
||||
"end": 19,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 14
|
||||
"column": 17
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 19
|
||||
}
|
||||
},
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 17,
|
||||
"end": 19,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 17
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 19
|
||||
}
|
||||
},
|
||||
"body": []
|
||||
}
|
||||
"body": [],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -89,7 +89,7 @@
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"type": "Property",
|
||||
"type": "ObjectMethod",
|
||||
"start": 6,
|
||||
"end": 22,
|
||||
"loc": {
|
||||
@ -126,41 +126,26 @@
|
||||
"value": "undef"
|
||||
},
|
||||
"kind": "get",
|
||||
"value": {
|
||||
"type": "FunctionExpression",
|
||||
"start": 17,
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 20,
|
||||
"end": 22,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 17
|
||||
"column": 20
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 22
|
||||
}
|
||||
},
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 20,
|
||||
"end": 22,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 20
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 22
|
||||
}
|
||||
},
|
||||
"body": [],
|
||||
"directives": []
|
||||
}
|
||||
"body": [],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@ -89,7 +89,7 @@
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"type": "Property",
|
||||
"type": "ObjectMethod",
|
||||
"start": 6,
|
||||
"end": 17,
|
||||
"loc": {
|
||||
@ -126,41 +126,26 @@
|
||||
"value": 10
|
||||
},
|
||||
"kind": "get",
|
||||
"value": {
|
||||
"type": "FunctionExpression",
|
||||
"start": 12,
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 15,
|
||||
"end": 17,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 12
|
||||
"column": 15
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 17
|
||||
}
|
||||
},
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 15,
|
||||
"end": 17,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 15
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 17
|
||||
}
|
||||
},
|
||||
"body": [],
|
||||
"directives": []
|
||||
}
|
||||
"body": [],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
133
test/fixtures/core/uncategorised/37/expected.json
vendored
133
test/fixtures/core/uncategorised/37/expected.json
vendored
@ -89,7 +89,7 @@
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"type": "Property",
|
||||
"type": "ObjectMethod",
|
||||
"start": 6,
|
||||
"end": 34,
|
||||
"loc": {
|
||||
@ -122,58 +122,58 @@
|
||||
"name": "width"
|
||||
},
|
||||
"kind": "set",
|
||||
"value": {
|
||||
"type": "FunctionExpression",
|
||||
"start": 15,
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [
|
||||
{
|
||||
"type": "Identifier",
|
||||
"start": 16,
|
||||
"end": 17,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 16
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 17
|
||||
}
|
||||
},
|
||||
"name": "w"
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 19,
|
||||
"end": 34,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 15
|
||||
"column": 19
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 34
|
||||
}
|
||||
},
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [
|
||||
"body": [
|
||||
{
|
||||
"type": "Identifier",
|
||||
"start": 16,
|
||||
"end": 17,
|
||||
"type": "ExpressionStatement",
|
||||
"start": 21,
|
||||
"end": 32,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 16
|
||||
"column": 21
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 17
|
||||
"column": 32
|
||||
}
|
||||
},
|
||||
"name": "w"
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 19,
|
||||
"end": 34,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 19
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 34
|
||||
}
|
||||
},
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"expression": {
|
||||
"type": "AssignmentExpression",
|
||||
"start": 21,
|
||||
"end": 32,
|
||||
"loc": {
|
||||
@ -186,63 +186,50 @@
|
||||
"column": 32
|
||||
}
|
||||
},
|
||||
"expression": {
|
||||
"type": "AssignmentExpression",
|
||||
"operator": "=",
|
||||
"left": {
|
||||
"type": "Identifier",
|
||||
"start": 21,
|
||||
"end": 32,
|
||||
"end": 28,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 21
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 28
|
||||
}
|
||||
},
|
||||
"name": "m_width"
|
||||
},
|
||||
"right": {
|
||||
"type": "Identifier",
|
||||
"start": 31,
|
||||
"end": 32,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 31
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 32
|
||||
}
|
||||
},
|
||||
"operator": "=",
|
||||
"left": {
|
||||
"type": "Identifier",
|
||||
"start": 21,
|
||||
"end": 28,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 21
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 28
|
||||
}
|
||||
},
|
||||
"name": "m_width"
|
||||
},
|
||||
"right": {
|
||||
"type": "Identifier",
|
||||
"start": 31,
|
||||
"end": 32,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 31
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 32
|
||||
}
|
||||
},
|
||||
"name": "w"
|
||||
}
|
||||
"name": "w"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
133
test/fixtures/core/uncategorised/38/expected.json
vendored
133
test/fixtures/core/uncategorised/38/expected.json
vendored
@ -89,7 +89,7 @@
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"type": "Property",
|
||||
"type": "ObjectMethod",
|
||||
"start": 6,
|
||||
"end": 28,
|
||||
"loc": {
|
||||
@ -122,58 +122,58 @@
|
||||
"name": "if"
|
||||
},
|
||||
"kind": "set",
|
||||
"value": {
|
||||
"type": "FunctionExpression",
|
||||
"start": 12,
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [
|
||||
{
|
||||
"type": "Identifier",
|
||||
"start": 13,
|
||||
"end": 14,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 13
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 14
|
||||
}
|
||||
},
|
||||
"name": "w"
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 16,
|
||||
"end": 28,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 12
|
||||
"column": 16
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 28
|
||||
}
|
||||
},
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [
|
||||
"body": [
|
||||
{
|
||||
"type": "Identifier",
|
||||
"start": 13,
|
||||
"end": 14,
|
||||
"type": "ExpressionStatement",
|
||||
"start": 18,
|
||||
"end": 26,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 13
|
||||
"column": 18
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 14
|
||||
"column": 26
|
||||
}
|
||||
},
|
||||
"name": "w"
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 16,
|
||||
"end": 28,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 16
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 28
|
||||
}
|
||||
},
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"expression": {
|
||||
"type": "AssignmentExpression",
|
||||
"start": 18,
|
||||
"end": 26,
|
||||
"loc": {
|
||||
@ -186,63 +186,50 @@
|
||||
"column": 26
|
||||
}
|
||||
},
|
||||
"expression": {
|
||||
"type": "AssignmentExpression",
|
||||
"operator": "=",
|
||||
"left": {
|
||||
"type": "Identifier",
|
||||
"start": 18,
|
||||
"end": 26,
|
||||
"end": 22,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 18
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 22
|
||||
}
|
||||
},
|
||||
"name": "m_if"
|
||||
},
|
||||
"right": {
|
||||
"type": "Identifier",
|
||||
"start": 25,
|
||||
"end": 26,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 25
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 26
|
||||
}
|
||||
},
|
||||
"operator": "=",
|
||||
"left": {
|
||||
"type": "Identifier",
|
||||
"start": 18,
|
||||
"end": 22,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 18
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 22
|
||||
}
|
||||
},
|
||||
"name": "m_if"
|
||||
},
|
||||
"right": {
|
||||
"type": "Identifier",
|
||||
"start": 25,
|
||||
"end": 26,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 25
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 26
|
||||
}
|
||||
},
|
||||
"name": "w"
|
||||
}
|
||||
"name": "w"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
133
test/fixtures/core/uncategorised/39/expected.json
vendored
133
test/fixtures/core/uncategorised/39/expected.json
vendored
@ -89,7 +89,7 @@
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"type": "Property",
|
||||
"type": "ObjectMethod",
|
||||
"start": 6,
|
||||
"end": 32,
|
||||
"loc": {
|
||||
@ -122,58 +122,58 @@
|
||||
"name": "true"
|
||||
},
|
||||
"kind": "set",
|
||||
"value": {
|
||||
"type": "FunctionExpression",
|
||||
"start": 14,
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [
|
||||
{
|
||||
"type": "Identifier",
|
||||
"start": 15,
|
||||
"end": 16,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 15
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 16
|
||||
}
|
||||
},
|
||||
"name": "w"
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 18,
|
||||
"end": 32,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 14
|
||||
"column": 18
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 32
|
||||
}
|
||||
},
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [
|
||||
"body": [
|
||||
{
|
||||
"type": "Identifier",
|
||||
"start": 15,
|
||||
"end": 16,
|
||||
"type": "ExpressionStatement",
|
||||
"start": 20,
|
||||
"end": 30,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 15
|
||||
"column": 20
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 16
|
||||
"column": 30
|
||||
}
|
||||
},
|
||||
"name": "w"
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 18,
|
||||
"end": 32,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 18
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 32
|
||||
}
|
||||
},
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"expression": {
|
||||
"type": "AssignmentExpression",
|
||||
"start": 20,
|
||||
"end": 30,
|
||||
"loc": {
|
||||
@ -186,63 +186,50 @@
|
||||
"column": 30
|
||||
}
|
||||
},
|
||||
"expression": {
|
||||
"type": "AssignmentExpression",
|
||||
"operator": "=",
|
||||
"left": {
|
||||
"type": "Identifier",
|
||||
"start": 20,
|
||||
"end": 30,
|
||||
"end": 26,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 20
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 26
|
||||
}
|
||||
},
|
||||
"name": "m_true"
|
||||
},
|
||||
"right": {
|
||||
"type": "Identifier",
|
||||
"start": 29,
|
||||
"end": 30,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 29
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 30
|
||||
}
|
||||
},
|
||||
"operator": "=",
|
||||
"left": {
|
||||
"type": "Identifier",
|
||||
"start": 20,
|
||||
"end": 26,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 20
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 26
|
||||
}
|
||||
},
|
||||
"name": "m_true"
|
||||
},
|
||||
"right": {
|
||||
"type": "Identifier",
|
||||
"start": 29,
|
||||
"end": 30,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 29
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 30
|
||||
}
|
||||
},
|
||||
"name": "w"
|
||||
}
|
||||
"name": "w"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
133
test/fixtures/core/uncategorised/40/expected.json
vendored
133
test/fixtures/core/uncategorised/40/expected.json
vendored
@ -89,7 +89,7 @@
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"type": "Property",
|
||||
"type": "ObjectMethod",
|
||||
"start": 6,
|
||||
"end": 34,
|
||||
"loc": {
|
||||
@ -122,58 +122,58 @@
|
||||
"name": "false"
|
||||
},
|
||||
"kind": "set",
|
||||
"value": {
|
||||
"type": "FunctionExpression",
|
||||
"start": 15,
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [
|
||||
{
|
||||
"type": "Identifier",
|
||||
"start": 16,
|
||||
"end": 17,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 16
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 17
|
||||
}
|
||||
},
|
||||
"name": "w"
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 19,
|
||||
"end": 34,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 15
|
||||
"column": 19
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 34
|
||||
}
|
||||
},
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [
|
||||
"body": [
|
||||
{
|
||||
"type": "Identifier",
|
||||
"start": 16,
|
||||
"end": 17,
|
||||
"type": "ExpressionStatement",
|
||||
"start": 21,
|
||||
"end": 32,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 16
|
||||
"column": 21
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 17
|
||||
"column": 32
|
||||
}
|
||||
},
|
||||
"name": "w"
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 19,
|
||||
"end": 34,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 19
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 34
|
||||
}
|
||||
},
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"expression": {
|
||||
"type": "AssignmentExpression",
|
||||
"start": 21,
|
||||
"end": 32,
|
||||
"loc": {
|
||||
@ -186,63 +186,50 @@
|
||||
"column": 32
|
||||
}
|
||||
},
|
||||
"expression": {
|
||||
"type": "AssignmentExpression",
|
||||
"operator": "=",
|
||||
"left": {
|
||||
"type": "Identifier",
|
||||
"start": 21,
|
||||
"end": 32,
|
||||
"end": 28,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 21
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 28
|
||||
}
|
||||
},
|
||||
"name": "m_false"
|
||||
},
|
||||
"right": {
|
||||
"type": "Identifier",
|
||||
"start": 31,
|
||||
"end": 32,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 31
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 32
|
||||
}
|
||||
},
|
||||
"operator": "=",
|
||||
"left": {
|
||||
"type": "Identifier",
|
||||
"start": 21,
|
||||
"end": 28,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 21
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 28
|
||||
}
|
||||
},
|
||||
"name": "m_false"
|
||||
},
|
||||
"right": {
|
||||
"type": "Identifier",
|
||||
"start": 31,
|
||||
"end": 32,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 31
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 32
|
||||
}
|
||||
},
|
||||
"name": "w"
|
||||
}
|
||||
"name": "w"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
133
test/fixtures/core/uncategorised/41/expected.json
vendored
133
test/fixtures/core/uncategorised/41/expected.json
vendored
@ -89,7 +89,7 @@
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"type": "Property",
|
||||
"type": "ObjectMethod",
|
||||
"start": 6,
|
||||
"end": 32,
|
||||
"loc": {
|
||||
@ -122,58 +122,58 @@
|
||||
"name": "null"
|
||||
},
|
||||
"kind": "set",
|
||||
"value": {
|
||||
"type": "FunctionExpression",
|
||||
"start": 14,
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [
|
||||
{
|
||||
"type": "Identifier",
|
||||
"start": 15,
|
||||
"end": 16,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 15
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 16
|
||||
}
|
||||
},
|
||||
"name": "w"
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 18,
|
||||
"end": 32,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 14
|
||||
"column": 18
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 32
|
||||
}
|
||||
},
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [
|
||||
"body": [
|
||||
{
|
||||
"type": "Identifier",
|
||||
"start": 15,
|
||||
"end": 16,
|
||||
"type": "ExpressionStatement",
|
||||
"start": 20,
|
||||
"end": 30,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 15
|
||||
"column": 20
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 16
|
||||
"column": 30
|
||||
}
|
||||
},
|
||||
"name": "w"
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 18,
|
||||
"end": 32,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 18
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 32
|
||||
}
|
||||
},
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"expression": {
|
||||
"type": "AssignmentExpression",
|
||||
"start": 20,
|
||||
"end": 30,
|
||||
"loc": {
|
||||
@ -186,63 +186,50 @@
|
||||
"column": 30
|
||||
}
|
||||
},
|
||||
"expression": {
|
||||
"type": "AssignmentExpression",
|
||||
"operator": "=",
|
||||
"left": {
|
||||
"type": "Identifier",
|
||||
"start": 20,
|
||||
"end": 30,
|
||||
"end": 26,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 20
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 26
|
||||
}
|
||||
},
|
||||
"name": "m_null"
|
||||
},
|
||||
"right": {
|
||||
"type": "Identifier",
|
||||
"start": 29,
|
||||
"end": 30,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 29
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 30
|
||||
}
|
||||
},
|
||||
"operator": "=",
|
||||
"left": {
|
||||
"type": "Identifier",
|
||||
"start": 20,
|
||||
"end": 26,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 20
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 26
|
||||
}
|
||||
},
|
||||
"name": "m_null"
|
||||
},
|
||||
"right": {
|
||||
"type": "Identifier",
|
||||
"start": 29,
|
||||
"end": 30,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 29
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 30
|
||||
}
|
||||
},
|
||||
"name": "w"
|
||||
}
|
||||
"name": "w"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
131
test/fixtures/core/uncategorised/42/expected.json
vendored
131
test/fixtures/core/uncategorised/42/expected.json
vendored
@ -89,7 +89,7 @@
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"type": "Property",
|
||||
"type": "ObjectMethod",
|
||||
"start": 6,
|
||||
"end": 34,
|
||||
"loc": {
|
||||
@ -126,58 +126,58 @@
|
||||
"value": "null"
|
||||
},
|
||||
"kind": "set",
|
||||
"value": {
|
||||
"type": "FunctionExpression",
|
||||
"start": 16,
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [
|
||||
{
|
||||
"type": "Identifier",
|
||||
"start": 17,
|
||||
"end": 18,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 17
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 18
|
||||
}
|
||||
},
|
||||
"name": "w"
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 20,
|
||||
"end": 34,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 16
|
||||
"column": 20
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 34
|
||||
}
|
||||
},
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [
|
||||
"body": [
|
||||
{
|
||||
"type": "Identifier",
|
||||
"start": 17,
|
||||
"end": 18,
|
||||
"type": "ExpressionStatement",
|
||||
"start": 22,
|
||||
"end": 32,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 17
|
||||
"column": 22
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 18
|
||||
"column": 32
|
||||
}
|
||||
},
|
||||
"name": "w"
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 20,
|
||||
"end": 34,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 20
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 34
|
||||
}
|
||||
},
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"expression": {
|
||||
"type": "AssignmentExpression",
|
||||
"start": 22,
|
||||
"end": 32,
|
||||
"loc": {
|
||||
@ -190,58 +190,43 @@
|
||||
"column": 32
|
||||
}
|
||||
},
|
||||
"expression": {
|
||||
"type": "AssignmentExpression",
|
||||
"operator": "=",
|
||||
"left": {
|
||||
"type": "Identifier",
|
||||
"start": 22,
|
||||
"end": 32,
|
||||
"end": 28,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 22
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 28
|
||||
}
|
||||
},
|
||||
"name": "m_null"
|
||||
},
|
||||
"right": {
|
||||
"type": "Identifier",
|
||||
"start": 31,
|
||||
"end": 32,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 31
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 32
|
||||
}
|
||||
},
|
||||
"operator": "=",
|
||||
"left": {
|
||||
"type": "Identifier",
|
||||
"start": 22,
|
||||
"end": 28,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 22
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 28
|
||||
}
|
||||
},
|
||||
"name": "m_null"
|
||||
},
|
||||
"right": {
|
||||
"type": "Identifier",
|
||||
"start": 31,
|
||||
"end": 32,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 31
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 32
|
||||
}
|
||||
},
|
||||
"name": "w"
|
||||
}
|
||||
"name": "w"
|
||||
}
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
131
test/fixtures/core/uncategorised/43/expected.json
vendored
131
test/fixtures/core/uncategorised/43/expected.json
vendored
@ -89,7 +89,7 @@
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"type": "Property",
|
||||
"type": "ObjectMethod",
|
||||
"start": 6,
|
||||
"end": 30,
|
||||
"loc": {
|
||||
@ -126,58 +126,58 @@
|
||||
"value": 10
|
||||
},
|
||||
"kind": "set",
|
||||
"value": {
|
||||
"type": "FunctionExpression",
|
||||
"start": 12,
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [
|
||||
{
|
||||
"type": "Identifier",
|
||||
"start": 13,
|
||||
"end": 14,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 13
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 14
|
||||
}
|
||||
},
|
||||
"name": "w"
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 16,
|
||||
"end": 30,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 12
|
||||
"column": 16
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 30
|
||||
}
|
||||
},
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [
|
||||
"body": [
|
||||
{
|
||||
"type": "Identifier",
|
||||
"start": 13,
|
||||
"end": 14,
|
||||
"type": "ExpressionStatement",
|
||||
"start": 18,
|
||||
"end": 28,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 13
|
||||
"column": 18
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 14
|
||||
"column": 28
|
||||
}
|
||||
},
|
||||
"name": "w"
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 16,
|
||||
"end": 30,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 16
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 30
|
||||
}
|
||||
},
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"expression": {
|
||||
"type": "AssignmentExpression",
|
||||
"start": 18,
|
||||
"end": 28,
|
||||
"loc": {
|
||||
@ -190,58 +190,43 @@
|
||||
"column": 28
|
||||
}
|
||||
},
|
||||
"expression": {
|
||||
"type": "AssignmentExpression",
|
||||
"operator": "=",
|
||||
"left": {
|
||||
"type": "Identifier",
|
||||
"start": 18,
|
||||
"end": 28,
|
||||
"end": 24,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 18
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 24
|
||||
}
|
||||
},
|
||||
"name": "m_null"
|
||||
},
|
||||
"right": {
|
||||
"type": "Identifier",
|
||||
"start": 27,
|
||||
"end": 28,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 27
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 28
|
||||
}
|
||||
},
|
||||
"operator": "=",
|
||||
"left": {
|
||||
"type": "Identifier",
|
||||
"start": 18,
|
||||
"end": 24,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 18
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 24
|
||||
}
|
||||
},
|
||||
"name": "m_null"
|
||||
},
|
||||
"right": {
|
||||
"type": "Identifier",
|
||||
"start": 27,
|
||||
"end": 28,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 27
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 28
|
||||
}
|
||||
},
|
||||
"name": "w"
|
||||
}
|
||||
"name": "w"
|
||||
}
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@ -89,7 +89,7 @@
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"type": "Property",
|
||||
"type": "ObjectProperty",
|
||||
"start": 6,
|
||||
"end": 13,
|
||||
"loc": {
|
||||
@ -140,8 +140,7 @@
|
||||
"raw": "42"
|
||||
},
|
||||
"value": 42
|
||||
},
|
||||
"kind": "init"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -89,7 +89,7 @@
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"type": "Property",
|
||||
"type": "ObjectProperty",
|
||||
"start": 6,
|
||||
"end": 13,
|
||||
"loc": {
|
||||
@ -140,8 +140,7 @@
|
||||
"raw": "43"
|
||||
},
|
||||
"value": 43
|
||||
},
|
||||
"kind": "init"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -136,7 +136,7 @@
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"type": "Property",
|
||||
"type": "ObjectProperty",
|
||||
"start": 21,
|
||||
"end": 22,
|
||||
"loc": {
|
||||
@ -168,7 +168,6 @@
|
||||
},
|
||||
"name": "c"
|
||||
},
|
||||
"kind": "init",
|
||||
"value": {
|
||||
"type": "Identifier",
|
||||
"start": 21,
|
||||
@ -187,7 +186,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Property",
|
||||
"type": "ObjectProperty",
|
||||
"start": 24,
|
||||
"end": 29,
|
||||
"loc": {
|
||||
@ -269,11 +268,10 @@
|
||||
},
|
||||
"value": 0
|
||||
}
|
||||
},
|
||||
"kind": "init"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Property",
|
||||
"type": "ObjectProperty",
|
||||
"start": 31,
|
||||
"end": 38,
|
||||
"loc": {
|
||||
@ -355,11 +353,10 @@
|
||||
},
|
||||
"value": 0
|
||||
}
|
||||
},
|
||||
"kind": "init"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Property",
|
||||
"type": "ObjectProperty",
|
||||
"start": 40,
|
||||
"end": 43,
|
||||
"loc": {
|
||||
@ -391,7 +388,6 @@
|
||||
},
|
||||
"name": "h"
|
||||
},
|
||||
"kind": "init",
|
||||
"value": {
|
||||
"type": "AssignmentPattern",
|
||||
"start": 40,
|
||||
|
||||
@ -88,7 +88,7 @@
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"type": "Property",
|
||||
"type": "ObjectProperty",
|
||||
"start": 6,
|
||||
"end": 7,
|
||||
"loc": {
|
||||
@ -120,7 +120,6 @@
|
||||
},
|
||||
"name": "a"
|
||||
},
|
||||
"kind": "init",
|
||||
"value": {
|
||||
"type": "Identifier",
|
||||
"start": 6,
|
||||
|
||||
@ -93,7 +93,7 @@
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"type": "Property",
|
||||
"type": "ObjectProperty",
|
||||
"start": 8,
|
||||
"end": 20,
|
||||
"loc": {
|
||||
@ -144,8 +144,7 @@
|
||||
"raw": "42"
|
||||
},
|
||||
"value": 42
|
||||
},
|
||||
"kind": "init"
|
||||
}
|
||||
}
|
||||
],
|
||||
"extra": {
|
||||
|
||||
@ -75,7 +75,7 @@
|
||||
},
|
||||
"body": [
|
||||
{
|
||||
"type": "MethodDefinition",
|
||||
"type": "ClassMethod",
|
||||
"start": 9,
|
||||
"end": 18,
|
||||
"loc": {
|
||||
@ -75,7 +75,7 @@
|
||||
},
|
||||
"body": [
|
||||
{
|
||||
"type": "MethodDefinition",
|
||||
"type": "ClassMethod",
|
||||
"start": 9,
|
||||
"end": 14,
|
||||
"loc": {
|
||||
@ -107,45 +107,32 @@
|
||||
},
|
||||
"static": false,
|
||||
"kind": "method",
|
||||
"value": {
|
||||
"type": "FunctionExpression",
|
||||
"start": 10,
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 12,
|
||||
"end": 14,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 10
|
||||
"column": 12
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 14
|
||||
}
|
||||
},
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 12,
|
||||
"end": 14,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 12
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 14
|
||||
}
|
||||
},
|
||||
"body": []
|
||||
}
|
||||
"body": [],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -75,7 +75,7 @@
|
||||
},
|
||||
"body": [
|
||||
{
|
||||
"type": "MethodDefinition",
|
||||
"type": "ClassMethod",
|
||||
"start": 9,
|
||||
"end": 14,
|
||||
"loc": {
|
||||
@ -107,44 +107,30 @@
|
||||
},
|
||||
"static": false,
|
||||
"kind": "method",
|
||||
"value": {
|
||||
"type": "FunctionExpression",
|
||||
"start": 10,
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 12,
|
||||
"end": 14,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 10
|
||||
"column": 12
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 14
|
||||
}
|
||||
},
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 12,
|
||||
"end": 14,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 12
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 14
|
||||
}
|
||||
},
|
||||
"body": []
|
||||
}
|
||||
"body": [],
|
||||
"directives": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "MethodDefinition",
|
||||
"type": "ClassMethod",
|
||||
"start": 14,
|
||||
"end": 19,
|
||||
"loc": {
|
||||
@ -176,45 +162,32 @@
|
||||
},
|
||||
"static": false,
|
||||
"kind": "method",
|
||||
"value": {
|
||||
"type": "FunctionExpression",
|
||||
"start": 15,
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 17,
|
||||
"end": 19,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 15
|
||||
"column": 17
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 19
|
||||
}
|
||||
},
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 17,
|
||||
"end": 19,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 17
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 19
|
||||
}
|
||||
},
|
||||
"body": []
|
||||
}
|
||||
"body": [],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -75,7 +75,7 @@
|
||||
},
|
||||
"body": [
|
||||
{
|
||||
"type": "MethodDefinition",
|
||||
"type": "ClassMethod",
|
||||
"start": 9,
|
||||
"end": 14,
|
||||
"loc": {
|
||||
@ -107,44 +107,30 @@
|
||||
},
|
||||
"static": false,
|
||||
"kind": "method",
|
||||
"value": {
|
||||
"type": "FunctionExpression",
|
||||
"start": 10,
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 12,
|
||||
"end": 14,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 10
|
||||
"column": 12
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 14
|
||||
}
|
||||
},
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 12,
|
||||
"end": 14,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 12
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 14
|
||||
}
|
||||
},
|
||||
"body": []
|
||||
}
|
||||
"body": [],
|
||||
"directives": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "MethodDefinition",
|
||||
"type": "ClassMethod",
|
||||
"start": 15,
|
||||
"end": 20,
|
||||
"loc": {
|
||||
@ -176,45 +162,32 @@
|
||||
},
|
||||
"static": false,
|
||||
"kind": "method",
|
||||
"value": {
|
||||
"type": "FunctionExpression",
|
||||
"start": 16,
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 18,
|
||||
"end": 20,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 16
|
||||
"column": 18
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 20
|
||||
}
|
||||
},
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 18,
|
||||
"end": 20,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 18
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 20
|
||||
}
|
||||
},
|
||||
"body": []
|
||||
}
|
||||
"body": [],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -75,7 +75,7 @@
|
||||
},
|
||||
"body": [
|
||||
{
|
||||
"type": "MethodDefinition",
|
||||
"type": "ClassMethod",
|
||||
"start": 9,
|
||||
"end": 14,
|
||||
"loc": {
|
||||
@ -107,44 +107,30 @@
|
||||
},
|
||||
"static": false,
|
||||
"kind": "method",
|
||||
"value": {
|
||||
"type": "FunctionExpression",
|
||||
"start": 10,
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 12,
|
||||
"end": 14,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 10
|
||||
"column": 12
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 14
|
||||
}
|
||||
},
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 12,
|
||||
"end": 14,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 12
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 14
|
||||
}
|
||||
},
|
||||
"body": []
|
||||
}
|
||||
"body": [],
|
||||
"directives": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "MethodDefinition",
|
||||
"type": "ClassMethod",
|
||||
"start": 15,
|
||||
"end": 20,
|
||||
"loc": {
|
||||
@ -176,45 +162,32 @@
|
||||
},
|
||||
"static": false,
|
||||
"kind": "method",
|
||||
"value": {
|
||||
"type": "FunctionExpression",
|
||||
"start": 16,
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 18,
|
||||
"end": 20,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 16
|
||||
"column": 18
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 20
|
||||
}
|
||||
},
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 18,
|
||||
"end": 20,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 18
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 20
|
||||
}
|
||||
},
|
||||
"body": []
|
||||
}
|
||||
"body": [],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -75,7 +75,7 @@
|
||||
},
|
||||
"body": [
|
||||
{
|
||||
"type": "MethodDefinition",
|
||||
"type": "ClassMethod",
|
||||
"start": 10,
|
||||
"end": 15,
|
||||
"loc": {
|
||||
@ -107,44 +107,30 @@
|
||||
},
|
||||
"static": false,
|
||||
"kind": "method",
|
||||
"value": {
|
||||
"type": "FunctionExpression",
|
||||
"start": 11,
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 13,
|
||||
"end": 15,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 11
|
||||
"column": 13
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 15
|
||||
}
|
||||
},
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 13,
|
||||
"end": 15,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 13
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 15
|
||||
}
|
||||
},
|
||||
"body": []
|
||||
}
|
||||
"body": [],
|
||||
"directives": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "MethodDefinition",
|
||||
"type": "ClassMethod",
|
||||
"start": 16,
|
||||
"end": 21,
|
||||
"loc": {
|
||||
@ -176,45 +162,32 @@
|
||||
},
|
||||
"static": false,
|
||||
"kind": "method",
|
||||
"value": {
|
||||
"type": "FunctionExpression",
|
||||
"start": 17,
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 19,
|
||||
"end": 21,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 17
|
||||
"column": 19
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 21
|
||||
}
|
||||
},
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 19,
|
||||
"end": 21,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 19
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 21
|
||||
}
|
||||
},
|
||||
"body": []
|
||||
}
|
||||
"body": [],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -75,7 +75,7 @@
|
||||
},
|
||||
"body": [
|
||||
{
|
||||
"type": "MethodDefinition",
|
||||
"type": "ClassMethod",
|
||||
"start": 9,
|
||||
"end": 19,
|
||||
"loc": {
|
||||
@ -107,45 +107,32 @@
|
||||
},
|
||||
"static": false,
|
||||
"kind": "method",
|
||||
"value": {
|
||||
"type": "FunctionExpression",
|
||||
"start": 15,
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 17,
|
||||
"end": 19,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 15
|
||||
"column": 17
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 19
|
||||
}
|
||||
},
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 17,
|
||||
"end": 19,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 17
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 19
|
||||
}
|
||||
},
|
||||
"body": []
|
||||
}
|
||||
"body": [],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -75,7 +75,7 @@
|
||||
},
|
||||
"body": [
|
||||
{
|
||||
"type": "MethodDefinition",
|
||||
"type": "ClassMethod",
|
||||
"start": 9,
|
||||
"end": 18,
|
||||
"loc": {
|
||||
@ -107,44 +107,30 @@
|
||||
},
|
||||
"static": false,
|
||||
"kind": "get",
|
||||
"value": {
|
||||
"type": "FunctionExpression",
|
||||
"start": 14,
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 16,
|
||||
"end": 18,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 14
|
||||
"column": 16
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 18
|
||||
}
|
||||
},
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 16,
|
||||
"end": 18,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 16
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 18
|
||||
}
|
||||
},
|
||||
"body": []
|
||||
}
|
||||
"body": [],
|
||||
"directives": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "MethodDefinition",
|
||||
"type": "ClassMethod",
|
||||
"start": 19,
|
||||
"end": 29,
|
||||
"loc": {
|
||||
@ -176,62 +162,49 @@
|
||||
},
|
||||
"static": false,
|
||||
"kind": "set",
|
||||
"value": {
|
||||
"type": "FunctionExpression",
|
||||
"start": 24,
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [
|
||||
{
|
||||
"type": "Identifier",
|
||||
"start": 25,
|
||||
"end": 26,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 25
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 26
|
||||
}
|
||||
},
|
||||
"name": "c"
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 27,
|
||||
"end": 29,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 24
|
||||
"column": 27
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 29
|
||||
}
|
||||
},
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [
|
||||
{
|
||||
"type": "Identifier",
|
||||
"start": 25,
|
||||
"end": 26,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 25
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 26
|
||||
}
|
||||
},
|
||||
"name": "c"
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 27,
|
||||
"end": 29,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 27
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 29
|
||||
}
|
||||
},
|
||||
"body": []
|
||||
}
|
||||
"body": [],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -75,7 +75,7 @@
|
||||
},
|
||||
"body": [
|
||||
{
|
||||
"type": "MethodDefinition",
|
||||
"type": "ClassMethod",
|
||||
"start": 9,
|
||||
"end": 21,
|
||||
"loc": {
|
||||
@ -107,44 +107,30 @@
|
||||
},
|
||||
"static": true,
|
||||
"kind": "method",
|
||||
"value": {
|
||||
"type": "FunctionExpression",
|
||||
"start": 17,
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 19,
|
||||
"end": 21,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 17
|
||||
"column": 19
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 21
|
||||
}
|
||||
},
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 19,
|
||||
"end": 21,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 19
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 21
|
||||
}
|
||||
},
|
||||
"body": []
|
||||
}
|
||||
"body": [],
|
||||
"directives": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "MethodDefinition",
|
||||
"type": "ClassMethod",
|
||||
"start": 22,
|
||||
"end": 38,
|
||||
"loc": {
|
||||
@ -176,44 +162,30 @@
|
||||
},
|
||||
"static": true,
|
||||
"kind": "get",
|
||||
"value": {
|
||||
"type": "FunctionExpression",
|
||||
"start": 34,
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 36,
|
||||
"end": 38,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 34
|
||||
"column": 36
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 38
|
||||
}
|
||||
},
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 36,
|
||||
"end": 38,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 36
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 38
|
||||
}
|
||||
},
|
||||
"body": []
|
||||
}
|
||||
"body": [],
|
||||
"directives": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "MethodDefinition",
|
||||
"type": "ClassMethod",
|
||||
"start": 39,
|
||||
"end": 56,
|
||||
"loc": {
|
||||
@ -245,62 +217,49 @@
|
||||
},
|
||||
"static": true,
|
||||
"kind": "set",
|
||||
"value": {
|
||||
"type": "FunctionExpression",
|
||||
"start": 51,
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [
|
||||
{
|
||||
"type": "Identifier",
|
||||
"start": 52,
|
||||
"end": 53,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 52
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 53
|
||||
}
|
||||
},
|
||||
"name": "b"
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 54,
|
||||
"end": 56,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 51
|
||||
"column": 54
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 56
|
||||
}
|
||||
},
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [
|
||||
{
|
||||
"type": "Identifier",
|
||||
"start": 52,
|
||||
"end": 53,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 52
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 53
|
||||
}
|
||||
},
|
||||
"name": "b"
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 54,
|
||||
"end": 56,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 54
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 56
|
||||
}
|
||||
},
|
||||
"body": []
|
||||
}
|
||||
"body": [],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -75,7 +75,7 @@
|
||||
},
|
||||
"body": [
|
||||
{
|
||||
"type": "MethodDefinition",
|
||||
"type": "ClassMethod",
|
||||
"start": 9,
|
||||
"end": 21,
|
||||
"loc": {
|
||||
@ -107,45 +107,32 @@
|
||||
},
|
||||
"static": true,
|
||||
"kind": "method",
|
||||
"value": {
|
||||
"type": "FunctionExpression",
|
||||
"start": 17,
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 19,
|
||||
"end": 21,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 17
|
||||
"column": 19
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 21
|
||||
}
|
||||
},
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 19,
|
||||
"end": 21,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 19
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 21
|
||||
}
|
||||
},
|
||||
"body": []
|
||||
}
|
||||
"body": [],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -75,7 +75,7 @@
|
||||
},
|
||||
"body": [
|
||||
{
|
||||
"type": "MethodDefinition",
|
||||
"type": "ClassMethod",
|
||||
"start": 9,
|
||||
"end": 23,
|
||||
"loc": {
|
||||
@ -107,45 +107,32 @@
|
||||
},
|
||||
"static": true,
|
||||
"kind": "method",
|
||||
"value": {
|
||||
"type": "FunctionExpression",
|
||||
"start": 19,
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 21,
|
||||
"end": 23,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 19
|
||||
"column": 21
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 23
|
||||
}
|
||||
},
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 21,
|
||||
"end": 23,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 21
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 23
|
||||
}
|
||||
},
|
||||
"body": []
|
||||
}
|
||||
"body": [],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -75,7 +75,7 @@
|
||||
},
|
||||
"body": [
|
||||
{
|
||||
"type": "MethodDefinition",
|
||||
"type": "ClassMethod",
|
||||
"start": 9,
|
||||
"end": 22,
|
||||
"loc": {
|
||||
@ -107,44 +107,30 @@
|
||||
},
|
||||
"static": true,
|
||||
"kind": "method",
|
||||
"value": {
|
||||
"type": "FunctionExpression",
|
||||
"start": 18,
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 20,
|
||||
"end": 22,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 18
|
||||
"column": 20
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 22
|
||||
}
|
||||
},
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 20,
|
||||
"end": 22,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 20
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 22
|
||||
}
|
||||
},
|
||||
"body": []
|
||||
}
|
||||
"body": [],
|
||||
"directives": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "MethodDefinition",
|
||||
"type": "ClassMethod",
|
||||
"start": 24,
|
||||
"end": 37,
|
||||
"loc": {
|
||||
@ -176,45 +162,32 @@
|
||||
},
|
||||
"static": true,
|
||||
"kind": "method",
|
||||
"value": {
|
||||
"type": "FunctionExpression",
|
||||
"start": 33,
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 35,
|
||||
"end": 37,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 33
|
||||
"column": 35
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 37
|
||||
}
|
||||
},
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 35,
|
||||
"end": 37,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 35
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 37
|
||||
}
|
||||
},
|
||||
"body": []
|
||||
}
|
||||
"body": [],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -75,7 +75,7 @@
|
||||
},
|
||||
"body": [
|
||||
{
|
||||
"type": "MethodDefinition",
|
||||
"type": "ClassMethod",
|
||||
"start": 9,
|
||||
"end": 26,
|
||||
"loc": {
|
||||
@ -107,45 +107,32 @@
|
||||
},
|
||||
"static": true,
|
||||
"kind": "method",
|
||||
"value": {
|
||||
"type": "FunctionExpression",
|
||||
"start": 22,
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 24,
|
||||
"end": 26,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 22
|
||||
"column": 24
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 26
|
||||
}
|
||||
},
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 24,
|
||||
"end": 26,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 24
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 26
|
||||
}
|
||||
},
|
||||
"body": []
|
||||
}
|
||||
"body": [],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -75,7 +75,7 @@
|
||||
},
|
||||
"body": [
|
||||
{
|
||||
"type": "MethodDefinition",
|
||||
"type": "ClassMethod",
|
||||
"start": 9,
|
||||
"end": 22,
|
||||
"loc": {
|
||||
@ -107,45 +107,32 @@
|
||||
},
|
||||
"static": false,
|
||||
"kind": "method",
|
||||
"value": {
|
||||
"type": "FunctionExpression",
|
||||
"start": 18,
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 20,
|
||||
"end": 22,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 18
|
||||
"column": 20
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 22
|
||||
}
|
||||
},
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 20,
|
||||
"end": 22,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 20
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 22
|
||||
}
|
||||
},
|
||||
"body": []
|
||||
}
|
||||
"body": [],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -75,7 +75,7 @@
|
||||
},
|
||||
"body": [
|
||||
{
|
||||
"type": "MethodDefinition",
|
||||
"type": "ClassMethod",
|
||||
"start": 9,
|
||||
"end": 24,
|
||||
"loc": {
|
||||
@ -107,45 +107,32 @@
|
||||
},
|
||||
"static": false,
|
||||
"kind": "constructor",
|
||||
"value": {
|
||||
"type": "FunctionExpression",
|
||||
"start": 20,
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 22,
|
||||
"end": 24,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 20
|
||||
"column": 22
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 24
|
||||
}
|
||||
},
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 22,
|
||||
"end": 24,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 22
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 24
|
||||
}
|
||||
},
|
||||
"body": []
|
||||
}
|
||||
"body": [],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -75,7 +75,7 @@
|
||||
},
|
||||
"body": [
|
||||
{
|
||||
"type": "MethodDefinition",
|
||||
"type": "ClassMethod",
|
||||
"start": 9,
|
||||
"end": 26,
|
||||
"loc": {
|
||||
@ -111,45 +111,30 @@
|
||||
},
|
||||
"static": false,
|
||||
"kind": "constructor",
|
||||
"value": {
|
||||
"type": "FunctionExpression",
|
||||
"start": 22,
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 24,
|
||||
"end": 26,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 22
|
||||
"column": 24
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 26
|
||||
}
|
||||
},
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 24,
|
||||
"end": 26,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 24
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 26
|
||||
}
|
||||
},
|
||||
"body": [],
|
||||
"directives": []
|
||||
}
|
||||
"body": [],
|
||||
"directives": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "MethodDefinition",
|
||||
"type": "ClassMethod",
|
||||
"start": 27,
|
||||
"end": 46,
|
||||
"loc": {
|
||||
@ -185,41 +170,26 @@
|
||||
},
|
||||
"static": false,
|
||||
"kind": "method",
|
||||
"value": {
|
||||
"type": "FunctionExpression",
|
||||
"start": 42,
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 44,
|
||||
"end": 46,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 42
|
||||
"column": 44
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 46
|
||||
}
|
||||
},
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 44,
|
||||
"end": 46,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 44
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 46
|
||||
}
|
||||
},
|
||||
"body": [],
|
||||
"directives": []
|
||||
}
|
||||
"body": [],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@ -75,7 +75,7 @@
|
||||
},
|
||||
"body": [
|
||||
{
|
||||
"type": "MethodDefinition",
|
||||
"type": "ClassMethod",
|
||||
"start": 9,
|
||||
"end": 31,
|
||||
"loc": {
|
||||
@ -107,44 +107,30 @@
|
||||
},
|
||||
"static": true,
|
||||
"kind": "method",
|
||||
"value": {
|
||||
"type": "FunctionExpression",
|
||||
"start": 27,
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 29,
|
||||
"end": 31,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 27
|
||||
"column": 29
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 31
|
||||
}
|
||||
},
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 29,
|
||||
"end": 31,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 29
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 31
|
||||
}
|
||||
},
|
||||
"body": []
|
||||
}
|
||||
"body": [],
|
||||
"directives": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "MethodDefinition",
|
||||
"type": "ClassMethod",
|
||||
"start": 32,
|
||||
"end": 54,
|
||||
"loc": {
|
||||
@ -176,45 +162,32 @@
|
||||
},
|
||||
"static": true,
|
||||
"kind": "method",
|
||||
"value": {
|
||||
"type": "FunctionExpression",
|
||||
"start": 50,
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 52,
|
||||
"end": 54,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 50
|
||||
"column": 52
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 54
|
||||
}
|
||||
},
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 52,
|
||||
"end": 54,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 52
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 54
|
||||
}
|
||||
},
|
||||
"body": []
|
||||
}
|
||||
"body": [],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -75,7 +75,7 @@
|
||||
},
|
||||
"body": [
|
||||
{
|
||||
"type": "MethodDefinition",
|
||||
"type": "ClassMethod",
|
||||
"start": 9,
|
||||
"end": 33,
|
||||
"loc": {
|
||||
@ -111,41 +111,26 @@
|
||||
},
|
||||
"static": true,
|
||||
"kind": "method",
|
||||
"value": {
|
||||
"type": "FunctionExpression",
|
||||
"start": 29,
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 31,
|
||||
"end": 33,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 29
|
||||
"column": 31
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 33
|
||||
}
|
||||
},
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 31,
|
||||
"end": 33,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 31
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 33
|
||||
}
|
||||
},
|
||||
"body": [],
|
||||
"directives": []
|
||||
}
|
||||
"body": [],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@ -89,7 +89,7 @@
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"type": "Property",
|
||||
"type": "ObjectProperty",
|
||||
"start": 6,
|
||||
"end": 25,
|
||||
"loc": {
|
||||
@ -208,8 +208,7 @@
|
||||
"body": [],
|
||||
"directives": []
|
||||
}
|
||||
},
|
||||
"kind": "init"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -88,7 +88,7 @@
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"type": "Property",
|
||||
"type": "ObjectProperty",
|
||||
"start": 2,
|
||||
"end": 5,
|
||||
"loc": {
|
||||
@ -120,7 +120,6 @@
|
||||
},
|
||||
"name": "a"
|
||||
},
|
||||
"kind": "init",
|
||||
"value": {
|
||||
"type": "AssignmentPattern",
|
||||
"start": 2,
|
||||
|
||||
@ -373,7 +373,7 @@
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"type": "Property",
|
||||
"type": "ObjectProperty",
|
||||
"start": 21,
|
||||
"end": 27,
|
||||
"loc": {
|
||||
@ -405,7 +405,6 @@
|
||||
},
|
||||
"name": "a"
|
||||
},
|
||||
"kind": "init",
|
||||
"value": {
|
||||
"type": "AssignmentPattern",
|
||||
"start": 21,
|
||||
|
||||
@ -73,7 +73,7 @@
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"type": "Property",
|
||||
"type": "ObjectProperty",
|
||||
"start": 7,
|
||||
"end": 8,
|
||||
"loc": {
|
||||
@ -105,7 +105,6 @@
|
||||
},
|
||||
"name": "a"
|
||||
},
|
||||
"kind": "init",
|
||||
"value": {
|
||||
"type": "Identifier",
|
||||
"start": 7,
|
||||
@ -124,7 +123,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Property",
|
||||
"type": "ObjectProperty",
|
||||
"start": 14,
|
||||
"end": 17,
|
||||
"loc": {
|
||||
@ -171,11 +170,10 @@
|
||||
}
|
||||
},
|
||||
"name": "a"
|
||||
},
|
||||
"kind": "init"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Property",
|
||||
"type": "ObjectProperty",
|
||||
"start": 23,
|
||||
"end": 28,
|
||||
"loc": {
|
||||
@ -253,11 +251,10 @@
|
||||
},
|
||||
"name": "a"
|
||||
}
|
||||
},
|
||||
"kind": "init"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Property",
|
||||
"type": "ObjectProperty",
|
||||
"start": 34,
|
||||
"end": 41,
|
||||
"loc": {
|
||||
@ -305,7 +302,7 @@
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"type": "Property",
|
||||
"type": "ObjectProperty",
|
||||
"start": 39,
|
||||
"end": 40,
|
||||
"loc": {
|
||||
@ -337,7 +334,6 @@
|
||||
},
|
||||
"name": "a"
|
||||
},
|
||||
"kind": "init",
|
||||
"value": {
|
||||
"type": "Identifier",
|
||||
"start": 39,
|
||||
@ -356,11 +352,10 @@
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"kind": "init"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Property",
|
||||
"type": "ObjectProperty",
|
||||
"start": 47,
|
||||
"end": 63,
|
||||
"loc": {
|
||||
@ -455,11 +450,10 @@
|
||||
"name": "a"
|
||||
},
|
||||
"computed": true
|
||||
},
|
||||
"kind": "init"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Property",
|
||||
"type": "ObjectProperty",
|
||||
"start": 69,
|
||||
"end": 77,
|
||||
"loc": {
|
||||
@ -537,8 +531,7 @@
|
||||
"name": "a"
|
||||
},
|
||||
"computed": false
|
||||
},
|
||||
"kind": "init"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@ -58,7 +58,7 @@
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"type": "Property",
|
||||
"type": "ObjectProperty",
|
||||
"start": 17,
|
||||
"end": 23,
|
||||
"loc": {
|
||||
@ -109,8 +109,7 @@
|
||||
"raw": "1"
|
||||
},
|
||||
"value": 1
|
||||
},
|
||||
"kind": "init"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -87,7 +87,7 @@
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"type": "Property",
|
||||
"type": "ObjectProperty",
|
||||
"start": 12,
|
||||
"end": 13,
|
||||
"loc": {
|
||||
@ -119,7 +119,6 @@
|
||||
},
|
||||
"name": "x"
|
||||
},
|
||||
"kind": "init",
|
||||
"value": {
|
||||
"type": "Identifier",
|
||||
"start": 12,
|
||||
@ -138,7 +137,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Property",
|
||||
"type": "ObjectProperty",
|
||||
"start": 15,
|
||||
"end": 16,
|
||||
"loc": {
|
||||
@ -170,7 +169,6 @@
|
||||
},
|
||||
"name": "y"
|
||||
},
|
||||
"kind": "init",
|
||||
"value": {
|
||||
"type": "Identifier",
|
||||
"start": 15,
|
||||
@ -227,6 +225,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -58,7 +58,7 @@
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"type": "Property",
|
||||
"type": "ObjectProperty",
|
||||
"start": 6,
|
||||
"end": 7,
|
||||
"loc": {
|
||||
@ -90,7 +90,6 @@
|
||||
},
|
||||
"name": "x"
|
||||
},
|
||||
"kind": "init",
|
||||
"value": {
|
||||
"type": "Identifier",
|
||||
"start": 6,
|
||||
@ -109,7 +108,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Property",
|
||||
"type": "ObjectProperty",
|
||||
"start": 9,
|
||||
"end": 10,
|
||||
"loc": {
|
||||
@ -141,7 +140,6 @@
|
||||
},
|
||||
"name": "y"
|
||||
},
|
||||
"kind": "init",
|
||||
"value": {
|
||||
"type": "Identifier",
|
||||
"start": 9,
|
||||
@ -193,6 +191,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -58,7 +58,7 @@
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"type": "Property",
|
||||
"type": "ObjectMethod",
|
||||
"start": 3,
|
||||
"end": 19,
|
||||
"loc": {
|
||||
@ -90,91 +90,76 @@
|
||||
},
|
||||
"name": "foo"
|
||||
},
|
||||
"kind": "init",
|
||||
"value": {
|
||||
"type": "FunctionExpression",
|
||||
"start": 7,
|
||||
"kind": "method",
|
||||
"id": null,
|
||||
"generator": true,
|
||||
"expression": false,
|
||||
"params": [
|
||||
{
|
||||
"type": "Identifier",
|
||||
"start": 8,
|
||||
"end": 9,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 8
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 9
|
||||
}
|
||||
},
|
||||
"name": "x"
|
||||
},
|
||||
{
|
||||
"type": "Identifier",
|
||||
"start": 11,
|
||||
"end": 12,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 11
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 12
|
||||
}
|
||||
},
|
||||
"name": "y"
|
||||
},
|
||||
{
|
||||
"type": "Identifier",
|
||||
"start": 14,
|
||||
"end": 15,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 14
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 15
|
||||
}
|
||||
},
|
||||
"name": "z"
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 17,
|
||||
"end": 19,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 7
|
||||
"column": 17
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 19
|
||||
}
|
||||
},
|
||||
"id": null,
|
||||
"generator": true,
|
||||
"expression": false,
|
||||
"params": [
|
||||
{
|
||||
"type": "Identifier",
|
||||
"start": 8,
|
||||
"end": 9,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 8
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 9
|
||||
}
|
||||
},
|
||||
"name": "x"
|
||||
},
|
||||
{
|
||||
"type": "Identifier",
|
||||
"start": 11,
|
||||
"end": 12,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 11
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 12
|
||||
}
|
||||
},
|
||||
"name": "y"
|
||||
},
|
||||
{
|
||||
"type": "Identifier",
|
||||
"start": 14,
|
||||
"end": 15,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 14
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 15
|
||||
}
|
||||
},
|
||||
"name": "z"
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 17,
|
||||
"end": 19,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 17
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 19
|
||||
}
|
||||
},
|
||||
"body": [],
|
||||
"directives": []
|
||||
}
|
||||
"body": [],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
@ -58,7 +58,7 @@
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"type": "Property",
|
||||
"type": "ObjectMethod",
|
||||
"start": 3,
|
||||
"end": 23,
|
||||
"loc": {
|
||||
@ -90,44 +90,44 @@
|
||||
},
|
||||
"name": "foo"
|
||||
},
|
||||
"kind": "init",
|
||||
"value": {
|
||||
"type": "FunctionExpression",
|
||||
"start": 7,
|
||||
"kind": "method",
|
||||
"id": null,
|
||||
"generator": true,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 10,
|
||||
"end": 23,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 7
|
||||
"column": 10
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 23
|
||||
}
|
||||
},
|
||||
"id": null,
|
||||
"generator": true,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 10,
|
||||
"end": 23,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 10
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"start": 12,
|
||||
"end": 21,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 12
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 21
|
||||
}
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 23
|
||||
}
|
||||
},
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"expression": {
|
||||
"type": "YieldExpression",
|
||||
"start": 12,
|
||||
"end": 21,
|
||||
"end": 20,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
@ -135,49 +135,34 @@
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 21
|
||||
"column": 20
|
||||
}
|
||||
},
|
||||
"expression": {
|
||||
"type": "YieldExpression",
|
||||
"start": 12,
|
||||
"delegate": true,
|
||||
"argument": {
|
||||
"type": "NumberLiteral",
|
||||
"start": 19,
|
||||
"end": 20,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 12
|
||||
"column": 19
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 20
|
||||
}
|
||||
},
|
||||
"delegate": true,
|
||||
"argument": {
|
||||
"type": "NumberLiteral",
|
||||
"start": 19,
|
||||
"end": 20,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 19
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 20
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"rawValue": 3,
|
||||
"raw": "3"
|
||||
},
|
||||
"value": 3
|
||||
}
|
||||
"extra": {
|
||||
"rawValue": 3,
|
||||
"raw": "3"
|
||||
},
|
||||
"value": 3
|
||||
}
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
@ -58,7 +58,7 @@
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"type": "Property",
|
||||
"type": "ObjectMethod",
|
||||
"start": 3,
|
||||
"end": 22,
|
||||
"loc": {
|
||||
@ -90,44 +90,44 @@
|
||||
},
|
||||
"name": "foo"
|
||||
},
|
||||
"kind": "init",
|
||||
"value": {
|
||||
"type": "FunctionExpression",
|
||||
"start": 7,
|
||||
"kind": "method",
|
||||
"id": null,
|
||||
"generator": true,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 10,
|
||||
"end": 22,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 7
|
||||
"column": 10
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 22
|
||||
}
|
||||
},
|
||||
"id": null,
|
||||
"generator": true,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 10,
|
||||
"end": 22,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 10
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"start": 12,
|
||||
"end": 20,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 12
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 20
|
||||
}
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 22
|
||||
}
|
||||
},
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"expression": {
|
||||
"type": "YieldExpression",
|
||||
"start": 12,
|
||||
"end": 20,
|
||||
"end": 19,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
@ -135,49 +135,34 @@
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 20
|
||||
"column": 19
|
||||
}
|
||||
},
|
||||
"expression": {
|
||||
"type": "YieldExpression",
|
||||
"start": 12,
|
||||
"delegate": false,
|
||||
"argument": {
|
||||
"type": "NumberLiteral",
|
||||
"start": 18,
|
||||
"end": 19,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 12
|
||||
"column": 18
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 19
|
||||
}
|
||||
},
|
||||
"delegate": false,
|
||||
"argument": {
|
||||
"type": "NumberLiteral",
|
||||
"start": 18,
|
||||
"end": 19,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 18
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 19
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"rawValue": 3,
|
||||
"raw": "3"
|
||||
},
|
||||
"value": 3
|
||||
}
|
||||
"extra": {
|
||||
"rawValue": 3,
|
||||
"raw": "3"
|
||||
},
|
||||
"value": 3
|
||||
}
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
@ -58,7 +58,7 @@
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"type": "Property",
|
||||
"type": "ObjectMethod",
|
||||
"start": 3,
|
||||
"end": 26,
|
||||
"loc": {
|
||||
@ -90,42 +90,42 @@
|
||||
},
|
||||
"name": "foo"
|
||||
},
|
||||
"kind": "init",
|
||||
"value": {
|
||||
"type": "FunctionExpression",
|
||||
"start": 7,
|
||||
"kind": "method",
|
||||
"id": null,
|
||||
"generator": true,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 10,
|
||||
"end": 26,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 7
|
||||
"column": 10
|
||||
},
|
||||
"end": {
|
||||
"line": 4,
|
||||
"column": 1
|
||||
}
|
||||
},
|
||||
"id": null,
|
||||
"generator": true,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 10,
|
||||
"end": 26,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 10
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"start": 15,
|
||||
"end": 20,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 2
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 7
|
||||
}
|
||||
},
|
||||
"end": {
|
||||
"line": 4,
|
||||
"column": 1
|
||||
}
|
||||
},
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"expression": {
|
||||
"type": "YieldExpression",
|
||||
"start": 15,
|
||||
"end": 20,
|
||||
"loc": {
|
||||
@ -138,26 +138,26 @@
|
||||
"column": 7
|
||||
}
|
||||
},
|
||||
"expression": {
|
||||
"type": "YieldExpression",
|
||||
"start": 15,
|
||||
"end": 20,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 2
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 7
|
||||
}
|
||||
},
|
||||
"delegate": false,
|
||||
"argument": null
|
||||
"delegate": false,
|
||||
"argument": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"start": 23,
|
||||
"end": 24,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 3,
|
||||
"column": 2
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 3
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"expression": {
|
||||
"type": "NumberLiteral",
|
||||
"start": 23,
|
||||
"end": 24,
|
||||
"loc": {
|
||||
@ -170,30 +170,15 @@
|
||||
"column": 3
|
||||
}
|
||||
},
|
||||
"expression": {
|
||||
"type": "NumberLiteral",
|
||||
"start": 23,
|
||||
"end": 24,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 3,
|
||||
"column": 2
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 3
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"rawValue": 3,
|
||||
"raw": "3"
|
||||
},
|
||||
"value": 3
|
||||
}
|
||||
"extra": {
|
||||
"rawValue": 3,
|
||||
"raw": "3"
|
||||
},
|
||||
"value": 3
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
@ -58,7 +58,7 @@
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"type": "Property",
|
||||
"type": "ObjectMethod",
|
||||
"start": 3,
|
||||
"end": 20,
|
||||
"loc": {
|
||||
@ -90,44 +90,44 @@
|
||||
},
|
||||
"name": "foo"
|
||||
},
|
||||
"kind": "init",
|
||||
"value": {
|
||||
"type": "FunctionExpression",
|
||||
"start": 7,
|
||||
"kind": "method",
|
||||
"id": null,
|
||||
"generator": true,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 10,
|
||||
"end": 20,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 7
|
||||
"column": 10
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 20
|
||||
}
|
||||
},
|
||||
"id": null,
|
||||
"generator": true,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 10,
|
||||
"end": 20,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 10
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"start": 12,
|
||||
"end": 18,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 12
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 18
|
||||
}
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 20
|
||||
}
|
||||
},
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"expression": {
|
||||
"type": "YieldExpression",
|
||||
"start": 12,
|
||||
"end": 18,
|
||||
"end": 17,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
@ -135,30 +135,15 @@
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 18
|
||||
"column": 17
|
||||
}
|
||||
},
|
||||
"expression": {
|
||||
"type": "YieldExpression",
|
||||
"start": 12,
|
||||
"end": 17,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 12
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 17
|
||||
}
|
||||
},
|
||||
"delegate": false,
|
||||
"argument": null
|
||||
}
|
||||
"delegate": false,
|
||||
"argument": null
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
@ -58,7 +58,7 @@
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"type": "Property",
|
||||
"type": "ObjectMethod",
|
||||
"start": 3,
|
||||
"end": 12,
|
||||
"loc": {
|
||||
@ -90,42 +90,27 @@
|
||||
},
|
||||
"name": "foo"
|
||||
},
|
||||
"kind": "init",
|
||||
"value": {
|
||||
"type": "FunctionExpression",
|
||||
"start": 7,
|
||||
"kind": "method",
|
||||
"id": null,
|
||||
"generator": true,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 10,
|
||||
"end": 12,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 7
|
||||
"column": 10
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 12
|
||||
}
|
||||
},
|
||||
"id": null,
|
||||
"generator": true,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 10,
|
||||
"end": 12,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 10
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 12
|
||||
}
|
||||
},
|
||||
"body": [],
|
||||
"directives": []
|
||||
}
|
||||
"body": [],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
@ -75,7 +75,7 @@
|
||||
},
|
||||
"body": [
|
||||
{
|
||||
"type": "MethodDefinition",
|
||||
"type": "ClassMethod",
|
||||
"start": 12,
|
||||
"end": 30,
|
||||
"loc": {
|
||||
@ -107,45 +107,32 @@
|
||||
},
|
||||
"static": true,
|
||||
"kind": "method",
|
||||
"value": {
|
||||
"type": "FunctionExpression",
|
||||
"start": 25,
|
||||
"id": null,
|
||||
"generator": true,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 28,
|
||||
"end": 30,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 25
|
||||
"column": 28
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 30
|
||||
}
|
||||
},
|
||||
"id": null,
|
||||
"generator": true,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 28,
|
||||
"end": 30,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 28
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 30
|
||||
}
|
||||
},
|
||||
"body": []
|
||||
}
|
||||
"body": [],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -75,7 +75,7 @@
|
||||
},
|
||||
"body": [
|
||||
{
|
||||
"type": "MethodDefinition",
|
||||
"type": "ClassMethod",
|
||||
"start": 12,
|
||||
"end": 28,
|
||||
"loc": {
|
||||
@ -107,45 +107,32 @@
|
||||
},
|
||||
"static": true,
|
||||
"kind": "method",
|
||||
"value": {
|
||||
"type": "FunctionExpression",
|
||||
"start": 23,
|
||||
"id": null,
|
||||
"generator": true,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 26,
|
||||
"end": 28,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 23
|
||||
"column": 26
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 28
|
||||
}
|
||||
},
|
||||
"id": null,
|
||||
"generator": true,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 26,
|
||||
"end": 28,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 26
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 28
|
||||
}
|
||||
},
|
||||
"body": []
|
||||
}
|
||||
"body": [],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -89,7 +89,7 @@
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"type": "Property",
|
||||
"type": "ObjectMethod",
|
||||
"start": 6,
|
||||
"end": 18,
|
||||
"loc": {
|
||||
@ -121,47 +121,34 @@
|
||||
},
|
||||
"name": "method"
|
||||
},
|
||||
"kind": "init",
|
||||
"value": {
|
||||
"type": "FunctionExpression",
|
||||
"start": 12,
|
||||
"kind": "method",
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 15,
|
||||
"end": 18,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 12
|
||||
"column": 15
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 18
|
||||
}
|
||||
},
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 15,
|
||||
"end": 18,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 15
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 18
|
||||
}
|
||||
},
|
||||
"body": []
|
||||
}
|
||||
"body": [],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -89,7 +89,7 @@
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"type": "Property",
|
||||
"type": "ObjectMethod",
|
||||
"start": 6,
|
||||
"end": 22,
|
||||
"loc": {
|
||||
@ -121,64 +121,51 @@
|
||||
},
|
||||
"name": "method"
|
||||
},
|
||||
"kind": "init",
|
||||
"value": {
|
||||
"type": "FunctionExpression",
|
||||
"start": 12,
|
||||
"kind": "method",
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [
|
||||
{
|
||||
"type": "Identifier",
|
||||
"start": 13,
|
||||
"end": 17,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 13
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 17
|
||||
}
|
||||
},
|
||||
"name": "test"
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 19,
|
||||
"end": 22,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 12
|
||||
"column": 19
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 22
|
||||
}
|
||||
},
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [
|
||||
{
|
||||
"type": "Identifier",
|
||||
"start": 13,
|
||||
"end": 17,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 13
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 17
|
||||
}
|
||||
},
|
||||
"name": "test"
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 19,
|
||||
"end": 22,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 19
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 22
|
||||
}
|
||||
},
|
||||
"body": []
|
||||
}
|
||||
"body": [],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -89,7 +89,7 @@
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"type": "Property",
|
||||
"type": "ObjectMethod",
|
||||
"start": 6,
|
||||
"end": 20,
|
||||
"loc": {
|
||||
@ -125,42 +125,27 @@
|
||||
},
|
||||
"value": "method"
|
||||
},
|
||||
"kind": "init",
|
||||
"value": {
|
||||
"type": "FunctionExpression",
|
||||
"start": 14,
|
||||
"kind": "method",
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 17,
|
||||
"end": 20,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 14
|
||||
"column": 17
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 20
|
||||
}
|
||||
},
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 17,
|
||||
"end": 20,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 17
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 20
|
||||
}
|
||||
},
|
||||
"body": [],
|
||||
"directives": []
|
||||
}
|
||||
"body": [],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user