diff --git a/.flowconfig b/.flowconfig index 10b5f18a48..ec70beff84 100644 --- a/.flowconfig +++ b/.flowconfig @@ -1,6 +1,7 @@ [ignore] .*/lib/.* .*/test/.* +.*/build/.* [include] diff --git a/ast/spec.md b/ast/spec.md index 39d20a6de9..346b7b95aa 100644 --- a/ast/spec.md +++ b/ast/spec.md @@ -3,7 +3,7 @@ These are the core Babylon AST node types. - [Node objects](#node-objects) - [Identifier](#identifier) - [Literals](#literals) - - [RegexpLiteral](#regexpliteral) + - [RegExpLiteral](#regexpliteral) - [NullLiteral](#nullliteral) - [StringLiteral](#stringliteral) - [BooleanLiteral](#booleanliteral) diff --git a/bin/generate-identifier-regex.js b/bin/generate-identifier-regex.js index 76cc7f3040..9b0ae7d6b6 100644 --- a/bin/generate-identifier-regex.js +++ b/bin/generate-identifier-regex.js @@ -50,7 +50,7 @@ function generate(chars) { at = to; } } - return {nonASCII: re, astral: astral}; + return { nonASCII: re, astral: astral }; } const startData = generate(start); diff --git a/package.json b/package.json index 5917364d73..b2b2d855d9 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,12 @@ "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", "license": "MIT", + "keywords": [ + "babel", + "javascript", + "parser", + "babylon" + ], "repository": "https://github.com/babel/babylon", "main": "lib/index.js", "files": [ @@ -28,10 +34,9 @@ "codecov": "^1.0.1", "cross-env": "^3.1.4", "eslint": "^3.7.1", - "eslint-config-babel": "^4.0.1", - "eslint-plugin-babel": "^4.0.0", + "eslint-config-babel": "^6.0.0", "eslint-plugin-flowtype": "^2.20.0", - "flow-bin": "^0.37.0", + "flow-bin": "^0.38.0", "nyc": "^10.0.0", "rimraf": "^2.5.4", "rollup": "^0.41.0", diff --git a/src/index.js b/src/index.js index 694c4e4838..ee2c587e80 100755 --- a/src/index.js +++ b/src/index.js @@ -20,4 +20,13 @@ export function parse(input, options) { return new Parser(options, input).parse(); } +export function parseExpression(input, options) { + const parser = new Parser(options, input); + if (parser.options.strictMode) { + parser.state.strict = true; + } + return parser.getExpression(); +} + + export { tokTypes }; diff --git a/src/parser/expression.js b/src/parser/expression.js index 81cb3766ed..7a8db2fc84 100644 --- a/src/parser/expression.js +++ b/src/parser/expression.js @@ -1,4 +1,3 @@ -/* eslint indent: 0 */ /* eslint max-len: 0 */ // A recursive descent parser operates by defining functions for all @@ -31,31 +30,28 @@ const pp = Parser.prototype; // strict mode, init properties are also not allowed to be repeated. pp.checkPropClash = function (prop, propHash) { - if (prop.computed) return; + if (prop.computed || prop.kind) return; const key = prop.key; - let name; - switch (key.type) { - case "Identifier": - name = key.name; - break; + // It is either an Identifier or a String/NumericLiteral + const name = key.type === "Identifier" ? key.name : String(key.value); - case "StringLiteral": - case "NumericLiteral": - name = String(key.value); - break; - - // istanbul ignore next: non-computed property keys are always one of the above - default: - return; - } - - if (name === "__proto__" && !prop.kind) { + if (name === "__proto__") { if (propHash.proto) this.raise(key.start, "Redefinition of __proto__ property"); propHash.proto = true; } }; +// Convenience method to parse an Expression only +pp.getExpression = function() { + this.nextToken(); + const expr = this.parseExpression(); + if (!this.match(tt.eof)) { + this.unexpected(); + } + return expr; +}; + // ### Expression parsing // These nest, from the most general expression type at the top to @@ -807,36 +803,61 @@ pp.parseObj = function (isPattern, refShorthandDefaultPos) { return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression"); }; -pp.parseObjPropValue = function (prop, startPos, startLoc, isGenerator, isAsync, isPattern, refShorthandDefaultPos) { +pp.isGetterOrSetterMethod = function (prop, isPattern) { + return !isPattern && + !prop.computed && + prop.key.type === "Identifier" && + (prop.key.name === "get" || prop.key.name === "set") && + ( + this.match(tt.string) || // get "string"() {} + this.match(tt.num) || // get 1() {} + this.match(tt.bracketL) || // get ["string"]() {} + this.match(tt.name) || // get foo() {} + this.state.type.keyword // get debugger() {} + ); +}; + +// get methods aren't allowed to have any parameters +// set methods must have exactly 1 parameter +pp.checkGetterSetterParamCount = function (method) { + const paramCount = method.kind === "get" ? 0 : 1; + if (method.params.length !== paramCount) { + const start = method.start; + if (method.kind === "get") { + this.raise(start, "getter should have no params"); + } else { + this.raise(start, "setter should have exactly one param"); + } + } +}; + +pp.parseObjectMethod = function (prop, isGenerator, isAsync, isPattern) { if (isAsync || isGenerator || this.match(tt.parenL)) { if (isPattern) this.unexpected(); prop.kind = "method"; prop.method = true; this.parseMethod(prop, isGenerator, isAsync); + return this.finishNode(prop, "ObjectMethod"); } - if (this.eat(tt.colon)) { - prop.value = isPattern ? this.parseMaybeDefault(this.state.start, this.state.startLoc) : this.parseMaybeAssign(false, refShorthandDefaultPos); - return this.finishNode(prop, "ObjectProperty"); - } - - if (!isPattern && !prop.computed && prop.key.type === "Identifier" && (prop.key.name === "get" || prop.key.name === "set") && (!this.match(tt.comma) && !this.match(tt.braceR))) { + if (this.isGetterOrSetterMethod(prop, isPattern)) { if (isGenerator || isAsync) this.unexpected(); prop.kind = prop.key.name; this.parsePropertyName(prop); - this.parseMethod(prop, false); - const paramCount = prop.kind === "get" ? 0 : 1; - if (prop.params.length !== paramCount) { - const 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"); - } - } + this.parseMethod(prop); + this.checkGetterSetterParamCount(prop); + return this.finishNode(prop, "ObjectMethod"); } +}; + +pp.parseObjectProperty = function (prop, startPos, startLoc, isPattern, refShorthandDefaultPos) { + if (this.eat(tt.colon)) { + prop.value = isPattern ? this.parseMaybeDefault(this.state.start, this.state.startLoc) : this.parseMaybeAssign(false, refShorthandDefaultPos); + + return this.finishNode(prop, "ObjectProperty"); + } if (!prop.computed && prop.key.type === "Identifier") { if (isPattern) { @@ -850,12 +871,20 @@ pp.parseObjPropValue = function (prop, startPos, startLoc, isGenerator, isAsync, } else { prop.value = prop.key.__clone(); } - prop.shorthand = true; + return this.finishNode(prop, "ObjectProperty"); } +}; - this.unexpected(); +pp.parseObjPropValue = function (prop, startPos, startLoc, isGenerator, isAsync, isPattern, refShorthandDefaultPos) { + const node = + this.parseObjectMethod(prop, isGenerator, isAsync, isPattern) || + this.parseObjectProperty(prop, startPos, startLoc, isPattern, refShorthandDefaultPos); + + if (!node) this.unexpected(); + + return node; }; pp.parsePropertyName = function (prop) { @@ -890,7 +919,7 @@ pp.parseMethod = function (node, isGenerator, isAsync) { this.initFunction(node, isAsync); this.expect(tt.parenL); node.params = this.parseBindingList(tt.parenR); - node.generator = isGenerator; + node.generator = !!isGenerator; this.parseFunctionBody(node); this.state.inMethod = oldInMethod; return node; @@ -905,8 +934,19 @@ pp.parseArrowExpression = function (node, params, isAsync) { return this.finishNode(node, "ArrowFunctionExpression"); }; -// Parse function body and check parameters. +pp.isStrictBody = function (node, isExpression) { + if (!isExpression && node.body.directives.length) { + for (const directive of (node.body.directives: Array)) { + if (directive.value.value === "use strict") { + return true; + } + } + } + return false; +}; + +// Parse function body and check parameters. pp.parseFunctionBody = function (node, allowExpression) { const isExpression = allowExpression && !this.match(tt.braceL); @@ -931,24 +971,10 @@ pp.parseFunctionBody = function (node, allowExpression) { // 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`. - let checkLVal = this.state.strict; - let isStrict = false; + const isStrict = this.isStrictBody(node, isExpression); + // Also check when allowExpression === true for arrow functions + const checkLVal = this.state.strict || allowExpression || isStrict; - // arrow function - if (allowExpression) checkLVal = true; - - // normal function - if (!isExpression && node.body.directives.length) { - for (const directive of (node.body.directives: Array)) { - if (directive.value.value === "use strict") { - isStrict = true; - checkLVal = true; - break; - } - } - } - - // if (isStrict && node.id && node.id.type === "Identifier" && node.id.name === "yield") { this.raise(node.id.start, "Binding yield in strict mode"); } diff --git a/src/parser/lval.js b/src/parser/lval.js index 4258506020..da712e3298 100644 --- a/src/parser/lval.js +++ b/src/parser/lval.js @@ -1,5 +1,3 @@ -/* eslint indent: 0 */ - import { types as tt } from "../tokenizer/types"; import Parser from "./index"; diff --git a/src/parser/statement.js b/src/parser/statement.js index 421b044cfc..a26d3a9a0b 100644 --- a/src/parser/statement.js +++ b/src/parser/statement.js @@ -1,4 +1,3 @@ -/* eslint indent: 0 */ /* eslint max-len: 0 */ import { types as tt } from "../tokenizer/types"; @@ -26,7 +25,7 @@ pp.parseTopLevel = function (file, program) { return this.finishNode(file, "File"); }; -const loopLabel = {kind: "loop"}, switchLabel = {kind: "switch"}; +const loopLabel = { kind: "loop" }, switchLabel = { kind: "switch" }; // TODO @@ -231,8 +230,8 @@ pp.parseForStatement = function (node) { let forAwait = false; if (this.hasPlugin("asyncGenerators") && this.state.inAsync && this.isContextual("await")) { - forAwait = true; - this.next(); + forAwait = true; + this.next(); } this.expect(tt.parenL); @@ -261,7 +260,7 @@ pp.parseForStatement = function (node) { return this.parseFor(node, init); } - const refShorthandDefaultPos = {start: 0}; + const refShorthandDefaultPos = { start: 0 }; const init = this.parseExpression(true, refShorthandDefaultPos); if (this.match(tt._in) || this.isContextual("of")) { const description = this.isContextual("of") ? "for-of statement" : "for-in statement"; @@ -441,7 +440,7 @@ pp.parseLabeledStatement = function (node, maybeName, expr) { } } - this.state.labels.push({name: maybeName, kind: kind, statementStart: this.state.start}); + this.state.labels.push({ name: maybeName, kind: kind, statementStart: this.state.start }); node.body = this.parseStatement(true); this.state.labels.pop(); node.label = expr; @@ -465,7 +464,11 @@ pp.parseBlock = function (allowDirectives?) { return this.finishNode(node, "BlockStatement"); }; -// TODO +pp.isValidDirective = function (stmt) { + return stmt.type === "ExpressionStatement" && + stmt.expression.type === "StringLiteral" && + !stmt.expression.extra.parenthesized; +}; pp.parseBlockBody = function (node, allowDirectives, topLevel, end) { node.body = []; @@ -482,9 +485,7 @@ pp.parseBlockBody = function (node, allowDirectives, topLevel, end) { const stmt = this.parseStatement(true, topLevel); - if (allowDirectives && !parsedNonDirective && - stmt.type === "ExpressionStatement" && stmt.expression.type === "StringLiteral" && - !stmt.expression.extra.parenthesized) { + if (allowDirectives && !parsedNonDirective && this.isValidDirective(stmt)) { const directive = this.stmtToDirective(stmt); node.directives.push(directive); @@ -704,8 +705,8 @@ pp.parseClassBody = function (node) { // disallow invalid constructors const isConstructor = !method.static && ( - (key.type === "Identifier" && key.name === "constructor") || - (key.type === "StringLiteral" && key.value === "constructor") + (key.name === "constructor") || // Identifier + (key.value === "constructor") // Literal ); if (isConstructor) { if (hadConstructor) this.raise(key.start, "Duplicate constructor in the same class"); @@ -718,8 +719,8 @@ pp.parseClassBody = function (node) { // disallow static prototype method const isStaticPrototype = method.static && ( - (key.type === "Identifier" && key.name === "prototype") || - (key.type === "StringLiteral" && key.value === "prototype") + (key.name === "prototype") || // Identifier + (key.value === "prototype") // Literal ); if (isStaticPrototype) { this.raise(key.start, "Classes may not have static property named prototype"); @@ -733,18 +734,8 @@ pp.parseClassBody = function (node) { this.parseClassMethod(classBody, method, isGenerator, isAsync); - // get methods aren't allowed to have any parameters - // set methods must have exactly 1 parameter if (isGetSet) { - const paramCount = method.kind === "get" ? 0 : 1; - if (method.params.length !== paramCount) { - const start = method.start; - if (method.kind === "get") { - this.raise(start, "getter should have no params"); - } else { - this.raise(start, "setter should have exactly one param"); - } - } + this.checkGetterSetterParamCount(method); } } @@ -758,8 +749,13 @@ pp.parseClassBody = function (node) { }; pp.parseClassProperty = function (node) { + const noPluginMsg = "You can only use Class Properties when the 'classProperties' plugin is enabled."; + if (!node.typeAnnotation && !this.hasPlugin("classProperties")) { + this.raise(node.start, noPluginMsg); + } + if (this.match(tt.eq)) { - if (!this.hasPlugin("classProperties")) this.unexpected(); + if (!this.hasPlugin("classProperties")) this.raise(this.state.start, noPluginMsg); this.next(); node.value = this.parseMaybeAssign(); } else { @@ -827,6 +823,8 @@ pp.parseExport = function (node) { let needsSemi = false; if (this.eat(tt._function)) { expr = this.parseFunction(expr, true, false, false, true); + } else if (this.eatContextual("async") && this.eat(tt._function)) { + expr = this.parseFunction(expr, true, false, true, true); } else if (this.match(tt._class)) { expr = this.parseClass(expr, true, true); } else { @@ -1003,7 +1001,7 @@ pp.parseExportSpecifiers = function () { // Parses import declaration. pp.parseImport = function (node) { - this.next(); + this.eat(tt._import); // import '...' if (this.match(tt.string)) { @@ -1046,6 +1044,11 @@ pp.parseImportSpecifiers = function (node) { if (first) { first = false; } else { + // Detect an attempt to deep destructure + if (this.eat(tt.colon)) { + this.unexpected(null, "ES2015 named imports do not destructure. Use another statement for destructuring after the import."); + } + this.expect(tt.comma); if (this.eat(tt.braceR)) break; } diff --git a/src/plugins/flow.js b/src/plugins/flow.js index edfff21b9e..0b1f851db0 100644 --- a/src/plugins/flow.js +++ b/src/plugins/flow.js @@ -1,10 +1,21 @@ -/* eslint indent: 0 */ /* eslint max-len: 0 */ import { types as tt } from "../tokenizer/types"; import { types as ct } from "../tokenizer/context"; import Parser from "../parser"; +const primitiveTypes = [ + "any", + "mixed", + "empty", + "bool", + "boolean", + "number", + "string", + "void", + "null" +]; + const pp = Parser.prototype; pp.flowParseTypeInitialiser = function (tok) { @@ -96,11 +107,22 @@ pp.flowParseDeclareModule = function (node) { const body = bodyNode.body = []; this.expect(tt.braceL); while (!this.match(tt.braceR)) { - const node2 = this.startNode(); + let bodyNode = this.startNode(); - this.expectContextual("declare", "Unexpected token. Only declares are allowed inside declare module"); + if (this.match(tt._import)) { + const lookahead = this.lookahead(); + if (lookahead.value !== "type" && lookahead.value !== "typeof") { + this.unexpected(null, "Imports within a `declare module` body must always be `import type` or `import typeof`"); + } - body.push(this.flowParseDeclare(node2)); + this.parseImport(bodyNode); + } else { + this.expectContextual("declare", "Only declares and type imports are allowed inside declare module"); + + bodyNode = this.flowParseDeclare(bodyNode, true); + } + + body.push(bodyNode); } this.expect(tt.braceR); @@ -178,10 +200,18 @@ pp.flowParseInterface = function (node) { return this.finishNode(node, "InterfaceDeclaration"); }; +pp.flowParseRestrictedIdentifier = function(liberal) { + if (primitiveTypes.indexOf(this.state.value) > -1) { + this.raise(this.state.start, `Cannot overwrite primitive type ${this.state.value}`); + } + + return this.parseIdentifier(liberal); +}; + // Type aliases pp.flowParseTypeAlias = function (node) { - node.id = this.parseIdentifier(); + node.id = this.flowParseRestrictedIdentifier(); if (this.isRelational("<")) { node.typeParameters = this.flowParseTypeParameterDeclaration(); @@ -209,7 +239,7 @@ pp.flowParseTypeParameter = function () { if (this.match(tt.eq)) { this.eat(tt.eq); - node.default = this.flowParseType (); + node.default = this.flowParseType(); } return this.finishNode(node, "TypeParameter"); @@ -379,7 +409,7 @@ pp.flowParseObjectType = function (allowStatic, allowExact) { if (variance) { this.unexpected(variancePos); } - nodeStart.callProperties.push(this.flowParseObjectTypeCallProperty(node, allowStatic)); + nodeStart.callProperties.push(this.flowParseObjectTypeCallProperty(node, isStatic)); } else { propertyKey = this.flowParseObjectPropertyKey(); if (this.isRelational("<") || this.match(tt.parenL)) { @@ -763,7 +793,7 @@ pp.flowParseTypeAnnotation = function () { }; pp.flowParseTypeAnnotatableIdentifier = function () { - const ident = this.parseIdentifier(); + const ident = this.flowParseRestrictedIdentifier(); if (this.match(tt.colon)) { ident.typeAnnotation = this.flowParseTypeAnnotation(); this.finishNode(ident, ident.type); @@ -1055,8 +1085,8 @@ export default function (instance) { }); // parse type parameters for class methods - instance.extend("parseClassMethod", function () { - return function (classBody, method, isGenerator, isAsync) { + instance.extend("parseClassMethod", function (inner) { + return function (classBody, method, ...args) { if (method.variance) { this.unexpected(method.variancePos); } @@ -1065,8 +1095,8 @@ export default function (instance) { if (this.isRelational("<")) { method.typeParameters = this.flowParseTypeParameterDeclaration(); } - this.parseMethod(method, isGenerator, isAsync); - classBody.body.push(this.finishNode(method, "ClassMethod")); + + inner.call(this, classBody, method, ...args); }; }); @@ -1084,9 +1114,9 @@ export default function (instance) { const node = this.startNode(); node.id = this.parseIdentifier(); if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterInstantiation(); + node.typeParameters = this.flowParseTypeParameterInstantiation(); } else { - node.typeParameters = null; + node.typeParameters = null; } implemented.push(this.finishNode(node, "ClassImplements")); } while (this.eat(tt.comma)); @@ -1227,6 +1257,13 @@ export default function (instance) { specifier.local = specifier.imported.__clone(); } + if ( + (node.importKind === "type" || node.importKind === "typeof") && + (specifier.importKind === "type" || specifier.importKind === "typeof") + ) { + this.raise(firstIdentLoc, "`The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements`"); + } + this.checkLVal(specifier.local, true, undefined, "import specifier"); node.specifiers.push(this.finishNode(specifier, "ImportSpecifier")); }; diff --git a/src/plugins/jsx/index.js b/src/plugins/jsx/index.js index 871de841f6..c4e363ee35 100644 --- a/src/plugins/jsx/index.js +++ b/src/plugins/jsx/index.js @@ -1,5 +1,3 @@ -/* eslint indent: 0 */ - import XHTMLEntities from "./xhtml"; import { TokenType, types as tt } from "../../tokenizer/types"; import { TokContext, types as tc } from "../../tokenizer/context"; diff --git a/src/tokenizer/index.js b/src/tokenizer/index.js index 442375a464..4c35054c2b 100644 --- a/src/tokenizer/index.js +++ b/src/tokenizer/index.js @@ -1,5 +1,4 @@ /* eslint max-len: 0 */ -/* eslint indent: 0 */ import type { TokenType } from "./types"; import { isIdentifierStart, isIdentifierChar, isKeyword } from "../util/identifier"; diff --git a/src/util/identifier.js b/src/util/identifier.js index 4c3bcf87f9..d8a9c83c49 100644 --- a/src/util/identifier.js +++ b/src/util/identifier.js @@ -49,7 +49,9 @@ 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 `bin/generate-identifier-regex.js`. +// eslint-disable-next-line comma-spacing const 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,19,35,5,35,5,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,66,18,2,1,11,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,17,111,72,56,50,14,50,785,52,76,44,33,24,27,35,42,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,54,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,86,25,391,63,32,0,449,56,264,8,2,36,18,0,50,29,881,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,881,68,12,0,67,12,65,0,32,6124,20,754,9486,1,3071,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,4149,196,60,67,1213,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,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,3,5761,10591,541]; +// eslint-disable-next-line comma-spacing const 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,10,2,4,9,83,11,7,0,161,11,6,9,7,3,57,0,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,87,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,423,9,838,7,2,7,17,9,57,21,2,13,19882,9,135,4,60,6,26,9,1016,45,17,3,19723,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,2214,6,110,6,6,9,792487,239]; // This has a complexity linear to the value of the code. The diff --git a/test/expressions/esprima/LICENSE b/test/expressions/esprima/LICENSE new file mode 100644 index 0000000000..17557eceb9 --- /dev/null +++ b/test/expressions/esprima/LICENSE @@ -0,0 +1,21 @@ +Copyright (c) jQuery Foundation, Inc. and Contributors, All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/expressions/esprima/expression-additive/migrated_0000/actual.js b/test/expressions/esprima/expression-additive/migrated_0000/actual.js new file mode 100644 index 0000000000..beeb1e5903 --- /dev/null +++ b/test/expressions/esprima/expression-additive/migrated_0000/actual.js @@ -0,0 +1 @@ +x + y diff --git a/test/expressions/esprima/expression-additive/migrated_0000/expected.json b/test/expressions/esprima/expression-additive/migrated_0000/expected.json new file mode 100644 index 0000000000..8a58af3771 --- /dev/null +++ b/test/expressions/esprima/expression-additive/migrated_0000/expected.json @@ -0,0 +1,50 @@ +{ + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "+", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "y" + }, + "name": "y" + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-additive/migrated_0001/actual.js b/test/expressions/esprima/expression-additive/migrated_0001/actual.js new file mode 100644 index 0000000000..82b2d8de84 --- /dev/null +++ b/test/expressions/esprima/expression-additive/migrated_0001/actual.js @@ -0,0 +1 @@ +x - y diff --git a/test/expressions/esprima/expression-additive/migrated_0001/expected.json b/test/expressions/esprima/expression-additive/migrated_0001/expected.json new file mode 100644 index 0000000000..2c7682f5b1 --- /dev/null +++ b/test/expressions/esprima/expression-additive/migrated_0001/expected.json @@ -0,0 +1,50 @@ +{ + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "-", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "y" + }, + "name": "y" + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-additive/migrated_0002/actual.js b/test/expressions/esprima/expression-additive/migrated_0002/actual.js new file mode 100644 index 0000000000..dcc0e169ca --- /dev/null +++ b/test/expressions/esprima/expression-additive/migrated_0002/actual.js @@ -0,0 +1 @@ +"use strict" + 42 diff --git a/test/expressions/esprima/expression-additive/migrated_0002/expected.json b/test/expressions/esprima/expression-additive/migrated_0002/expected.json new file mode 100644 index 0000000000..52fac917f7 --- /dev/null +++ b/test/expressions/esprima/expression-additive/migrated_0002/expected.json @@ -0,0 +1,56 @@ +{ + "type": "BinaryExpression", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "left": { + "type": "StringLiteral", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "extra": { + "rawValue": "use strict", + "raw": "\"use strict\"" + }, + "value": "use strict" + }, + "operator": "+", + "right": { + "type": "NumericLiteral", + "start": 15, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-assignment/migrated_0000/actual.js b/test/expressions/esprima/expression-assignment/migrated_0000/actual.js new file mode 100644 index 0000000000..2d76abaa89 --- /dev/null +++ b/test/expressions/esprima/expression-assignment/migrated_0000/actual.js @@ -0,0 +1 @@ +x = 42 diff --git a/test/expressions/esprima/expression-assignment/migrated_0000/expected.json b/test/expressions/esprima/expression-assignment/migrated_0000/expected.json new file mode 100644 index 0000000000..71da2d7c41 --- /dev/null +++ b/test/expressions/esprima/expression-assignment/migrated_0000/expected.json @@ -0,0 +1,53 @@ +{ + "type": "AssignmentExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "right": { + "type": "NumericLiteral", + "start": 4, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-assignment/migrated_0001/actual.js b/test/expressions/esprima/expression-assignment/migrated_0001/actual.js new file mode 100644 index 0000000000..ec77db7c41 --- /dev/null +++ b/test/expressions/esprima/expression-assignment/migrated_0001/actual.js @@ -0,0 +1 @@ +eval = 42 diff --git a/test/expressions/esprima/expression-assignment/migrated_0001/expected.json b/test/expressions/esprima/expression-assignment/migrated_0001/expected.json new file mode 100644 index 0000000000..19fdd30f2f --- /dev/null +++ b/test/expressions/esprima/expression-assignment/migrated_0001/expected.json @@ -0,0 +1,53 @@ +{ + "type": "AssignmentExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + }, + "identifierName": "eval" + }, + "name": "eval" + }, + "right": { + "type": "NumericLiteral", + "start": 7, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-assignment/migrated_0002/actual.js b/test/expressions/esprima/expression-assignment/migrated_0002/actual.js new file mode 100644 index 0000000000..8915ea9874 --- /dev/null +++ b/test/expressions/esprima/expression-assignment/migrated_0002/actual.js @@ -0,0 +1 @@ +arguments = 42 diff --git a/test/expressions/esprima/expression-assignment/migrated_0002/expected.json b/test/expressions/esprima/expression-assignment/migrated_0002/expected.json new file mode 100644 index 0000000000..beb1fc3fcb --- /dev/null +++ b/test/expressions/esprima/expression-assignment/migrated_0002/expected.json @@ -0,0 +1,53 @@ +{ + "type": "AssignmentExpression", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "arguments" + }, + "name": "arguments" + }, + "right": { + "type": "NumericLiteral", + "start": 12, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-assignment/migrated_0003/actual.js b/test/expressions/esprima/expression-assignment/migrated_0003/actual.js new file mode 100644 index 0000000000..800fe89767 --- /dev/null +++ b/test/expressions/esprima/expression-assignment/migrated_0003/actual.js @@ -0,0 +1 @@ +x *= 42 diff --git a/test/expressions/esprima/expression-assignment/migrated_0003/expected.json b/test/expressions/esprima/expression-assignment/migrated_0003/expected.json new file mode 100644 index 0000000000..6363a8fa0e --- /dev/null +++ b/test/expressions/esprima/expression-assignment/migrated_0003/expected.json @@ -0,0 +1,53 @@ +{ + "type": "AssignmentExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "operator": "*=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "right": { + "type": "NumericLiteral", + "start": 5, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-assignment/migrated_0004/actual.js b/test/expressions/esprima/expression-assignment/migrated_0004/actual.js new file mode 100644 index 0000000000..e6d4af128c --- /dev/null +++ b/test/expressions/esprima/expression-assignment/migrated_0004/actual.js @@ -0,0 +1 @@ +x /= 42 diff --git a/test/expressions/esprima/expression-assignment/migrated_0004/expected.json b/test/expressions/esprima/expression-assignment/migrated_0004/expected.json new file mode 100644 index 0000000000..0db0d4d7f4 --- /dev/null +++ b/test/expressions/esprima/expression-assignment/migrated_0004/expected.json @@ -0,0 +1,53 @@ +{ + "type": "AssignmentExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "operator": "/=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "right": { + "type": "NumericLiteral", + "start": 5, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-assignment/migrated_0005/actual.js b/test/expressions/esprima/expression-assignment/migrated_0005/actual.js new file mode 100644 index 0000000000..1fdb8c843b --- /dev/null +++ b/test/expressions/esprima/expression-assignment/migrated_0005/actual.js @@ -0,0 +1 @@ +x %= 42 diff --git a/test/expressions/esprima/expression-assignment/migrated_0005/expected.json b/test/expressions/esprima/expression-assignment/migrated_0005/expected.json new file mode 100644 index 0000000000..8a143f0086 --- /dev/null +++ b/test/expressions/esprima/expression-assignment/migrated_0005/expected.json @@ -0,0 +1,53 @@ +{ + "type": "AssignmentExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "operator": "%=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "right": { + "type": "NumericLiteral", + "start": 5, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-assignment/migrated_0006/actual.js b/test/expressions/esprima/expression-assignment/migrated_0006/actual.js new file mode 100644 index 0000000000..76d0126c78 --- /dev/null +++ b/test/expressions/esprima/expression-assignment/migrated_0006/actual.js @@ -0,0 +1 @@ +x += 42 diff --git a/test/expressions/esprima/expression-assignment/migrated_0006/expected.json b/test/expressions/esprima/expression-assignment/migrated_0006/expected.json new file mode 100644 index 0000000000..97f9783ef4 --- /dev/null +++ b/test/expressions/esprima/expression-assignment/migrated_0006/expected.json @@ -0,0 +1,53 @@ +{ + "type": "AssignmentExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "operator": "+=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "right": { + "type": "NumericLiteral", + "start": 5, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-assignment/migrated_0007/actual.js b/test/expressions/esprima/expression-assignment/migrated_0007/actual.js new file mode 100644 index 0000000000..9efddfe799 --- /dev/null +++ b/test/expressions/esprima/expression-assignment/migrated_0007/actual.js @@ -0,0 +1 @@ +x -= 42 diff --git a/test/expressions/esprima/expression-assignment/migrated_0007/expected.json b/test/expressions/esprima/expression-assignment/migrated_0007/expected.json new file mode 100644 index 0000000000..096ad6ea66 --- /dev/null +++ b/test/expressions/esprima/expression-assignment/migrated_0007/expected.json @@ -0,0 +1,53 @@ +{ + "type": "AssignmentExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "operator": "-=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "right": { + "type": "NumericLiteral", + "start": 5, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-assignment/migrated_0008/actual.js b/test/expressions/esprima/expression-assignment/migrated_0008/actual.js new file mode 100644 index 0000000000..0ec003b342 --- /dev/null +++ b/test/expressions/esprima/expression-assignment/migrated_0008/actual.js @@ -0,0 +1 @@ +x <<= 42 diff --git a/test/expressions/esprima/expression-assignment/migrated_0008/expected.json b/test/expressions/esprima/expression-assignment/migrated_0008/expected.json new file mode 100644 index 0000000000..abdc6b00d8 --- /dev/null +++ b/test/expressions/esprima/expression-assignment/migrated_0008/expected.json @@ -0,0 +1,53 @@ +{ + "type": "AssignmentExpression", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "operator": "<<=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "right": { + "type": "NumericLiteral", + "start": 6, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-assignment/migrated_0009/actual.js b/test/expressions/esprima/expression-assignment/migrated_0009/actual.js new file mode 100644 index 0000000000..985184e363 --- /dev/null +++ b/test/expressions/esprima/expression-assignment/migrated_0009/actual.js @@ -0,0 +1 @@ +x >>= 42 diff --git a/test/expressions/esprima/expression-assignment/migrated_0009/expected.json b/test/expressions/esprima/expression-assignment/migrated_0009/expected.json new file mode 100644 index 0000000000..bada0183f2 --- /dev/null +++ b/test/expressions/esprima/expression-assignment/migrated_0009/expected.json @@ -0,0 +1,53 @@ +{ + "type": "AssignmentExpression", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "operator": ">>=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "right": { + "type": "NumericLiteral", + "start": 6, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-assignment/migrated_0010/actual.js b/test/expressions/esprima/expression-assignment/migrated_0010/actual.js new file mode 100644 index 0000000000..4ddbf45b90 --- /dev/null +++ b/test/expressions/esprima/expression-assignment/migrated_0010/actual.js @@ -0,0 +1 @@ +x >>>= 42 diff --git a/test/expressions/esprima/expression-assignment/migrated_0010/expected.json b/test/expressions/esprima/expression-assignment/migrated_0010/expected.json new file mode 100644 index 0000000000..6495a0a87d --- /dev/null +++ b/test/expressions/esprima/expression-assignment/migrated_0010/expected.json @@ -0,0 +1,53 @@ +{ + "type": "AssignmentExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "operator": ">>>=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "right": { + "type": "NumericLiteral", + "start": 7, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-assignment/migrated_0011/actual.js b/test/expressions/esprima/expression-assignment/migrated_0011/actual.js new file mode 100644 index 0000000000..021d2208ec --- /dev/null +++ b/test/expressions/esprima/expression-assignment/migrated_0011/actual.js @@ -0,0 +1 @@ +x &= 42 diff --git a/test/expressions/esprima/expression-assignment/migrated_0011/expected.json b/test/expressions/esprima/expression-assignment/migrated_0011/expected.json new file mode 100644 index 0000000000..1689f0de35 --- /dev/null +++ b/test/expressions/esprima/expression-assignment/migrated_0011/expected.json @@ -0,0 +1,53 @@ +{ + "type": "AssignmentExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "operator": "&=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "right": { + "type": "NumericLiteral", + "start": 5, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-assignment/migrated_0012/actual.js b/test/expressions/esprima/expression-assignment/migrated_0012/actual.js new file mode 100644 index 0000000000..77975a2659 --- /dev/null +++ b/test/expressions/esprima/expression-assignment/migrated_0012/actual.js @@ -0,0 +1 @@ +x ^= 42 diff --git a/test/expressions/esprima/expression-assignment/migrated_0012/expected.json b/test/expressions/esprima/expression-assignment/migrated_0012/expected.json new file mode 100644 index 0000000000..2992f0e90d --- /dev/null +++ b/test/expressions/esprima/expression-assignment/migrated_0012/expected.json @@ -0,0 +1,53 @@ +{ + "type": "AssignmentExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "operator": "^=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "right": { + "type": "NumericLiteral", + "start": 5, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-assignment/migrated_0013/actual.js b/test/expressions/esprima/expression-assignment/migrated_0013/actual.js new file mode 100644 index 0000000000..8bbad8cd9f --- /dev/null +++ b/test/expressions/esprima/expression-assignment/migrated_0013/actual.js @@ -0,0 +1 @@ +x |= 42 diff --git a/test/expressions/esprima/expression-assignment/migrated_0013/expected.json b/test/expressions/esprima/expression-assignment/migrated_0013/expected.json new file mode 100644 index 0000000000..3e04af9fc5 --- /dev/null +++ b/test/expressions/esprima/expression-assignment/migrated_0013/expected.json @@ -0,0 +1,53 @@ +{ + "type": "AssignmentExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "operator": "|=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "right": { + "type": "NumericLiteral", + "start": 5, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-binary-bitwise/migrated_0000/actual.js b/test/expressions/esprima/expression-binary-bitwise/migrated_0000/actual.js new file mode 100644 index 0000000000..9d87069548 --- /dev/null +++ b/test/expressions/esprima/expression-binary-bitwise/migrated_0000/actual.js @@ -0,0 +1 @@ +x & y diff --git a/test/expressions/esprima/expression-binary-bitwise/migrated_0000/expected.json b/test/expressions/esprima/expression-binary-bitwise/migrated_0000/expected.json new file mode 100644 index 0000000000..481699552e --- /dev/null +++ b/test/expressions/esprima/expression-binary-bitwise/migrated_0000/expected.json @@ -0,0 +1,50 @@ +{ + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "&", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "y" + }, + "name": "y" + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-binary-bitwise/migrated_0001/actual.js b/test/expressions/esprima/expression-binary-bitwise/migrated_0001/actual.js new file mode 100644 index 0000000000..460a89ecfa --- /dev/null +++ b/test/expressions/esprima/expression-binary-bitwise/migrated_0001/actual.js @@ -0,0 +1 @@ +x ^ y diff --git a/test/expressions/esprima/expression-binary-bitwise/migrated_0001/expected.json b/test/expressions/esprima/expression-binary-bitwise/migrated_0001/expected.json new file mode 100644 index 0000000000..a0a6729cdc --- /dev/null +++ b/test/expressions/esprima/expression-binary-bitwise/migrated_0001/expected.json @@ -0,0 +1,50 @@ +{ + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "^", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "y" + }, + "name": "y" + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-binary-bitwise/migrated_0002/actual.js b/test/expressions/esprima/expression-binary-bitwise/migrated_0002/actual.js new file mode 100644 index 0000000000..07736e61c3 --- /dev/null +++ b/test/expressions/esprima/expression-binary-bitwise/migrated_0002/actual.js @@ -0,0 +1 @@ +x | y diff --git a/test/expressions/esprima/expression-binary-bitwise/migrated_0002/expected.json b/test/expressions/esprima/expression-binary-bitwise/migrated_0002/expected.json new file mode 100644 index 0000000000..8a3dd3fcd8 --- /dev/null +++ b/test/expressions/esprima/expression-binary-bitwise/migrated_0002/expected.json @@ -0,0 +1,50 @@ +{ + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "|", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "y" + }, + "name": "y" + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-binary-logical/migrated_0000/actual.js b/test/expressions/esprima/expression-binary-logical/migrated_0000/actual.js new file mode 100644 index 0000000000..d3891c2c9c --- /dev/null +++ b/test/expressions/esprima/expression-binary-logical/migrated_0000/actual.js @@ -0,0 +1 @@ +x || y diff --git a/test/expressions/esprima/expression-binary-logical/migrated_0000/expected.json b/test/expressions/esprima/expression-binary-logical/migrated_0000/expected.json new file mode 100644 index 0000000000..ad159d9849 --- /dev/null +++ b/test/expressions/esprima/expression-binary-logical/migrated_0000/expected.json @@ -0,0 +1,50 @@ +{ + "type": "LogicalExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "||", + "right": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "y" + }, + "name": "y" + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-binary-logical/migrated_0001/actual.js b/test/expressions/esprima/expression-binary-logical/migrated_0001/actual.js new file mode 100644 index 0000000000..7d5be6bfd1 --- /dev/null +++ b/test/expressions/esprima/expression-binary-logical/migrated_0001/actual.js @@ -0,0 +1 @@ +x && y diff --git a/test/expressions/esprima/expression-binary-logical/migrated_0001/expected.json b/test/expressions/esprima/expression-binary-logical/migrated_0001/expected.json new file mode 100644 index 0000000000..864870d629 --- /dev/null +++ b/test/expressions/esprima/expression-binary-logical/migrated_0001/expected.json @@ -0,0 +1,50 @@ +{ + "type": "LogicalExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "&&", + "right": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "y" + }, + "name": "y" + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-binary-logical/migrated_0002/actual.js b/test/expressions/esprima/expression-binary-logical/migrated_0002/actual.js new file mode 100644 index 0000000000..90e7cf52f1 --- /dev/null +++ b/test/expressions/esprima/expression-binary-logical/migrated_0002/actual.js @@ -0,0 +1 @@ +x || y || z diff --git a/test/expressions/esprima/expression-binary-logical/migrated_0002/expected.json b/test/expressions/esprima/expression-binary-logical/migrated_0002/expected.json new file mode 100644 index 0000000000..05ef5675b0 --- /dev/null +++ b/test/expressions/esprima/expression-binary-logical/migrated_0002/expected.json @@ -0,0 +1,83 @@ +{ + "type": "LogicalExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "left": { + "type": "LogicalExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "||", + "right": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "y" + }, + "name": "y" + } + }, + "operator": "||", + "right": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "z" + }, + "name": "z" + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-binary-logical/migrated_0003/actual.js b/test/expressions/esprima/expression-binary-logical/migrated_0003/actual.js new file mode 100644 index 0000000000..3a9c93b39c --- /dev/null +++ b/test/expressions/esprima/expression-binary-logical/migrated_0003/actual.js @@ -0,0 +1 @@ +x && y && z diff --git a/test/expressions/esprima/expression-binary-logical/migrated_0003/expected.json b/test/expressions/esprima/expression-binary-logical/migrated_0003/expected.json new file mode 100644 index 0000000000..265d302699 --- /dev/null +++ b/test/expressions/esprima/expression-binary-logical/migrated_0003/expected.json @@ -0,0 +1,83 @@ +{ + "type": "LogicalExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "left": { + "type": "LogicalExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "&&", + "right": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "y" + }, + "name": "y" + } + }, + "operator": "&&", + "right": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "z" + }, + "name": "z" + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-binary-logical/migrated_0004/actual.js b/test/expressions/esprima/expression-binary-logical/migrated_0004/actual.js new file mode 100644 index 0000000000..ba63b00838 --- /dev/null +++ b/test/expressions/esprima/expression-binary-logical/migrated_0004/actual.js @@ -0,0 +1 @@ +x || y && z diff --git a/test/expressions/esprima/expression-binary-logical/migrated_0004/expected.json b/test/expressions/esprima/expression-binary-logical/migrated_0004/expected.json new file mode 100644 index 0000000000..613c0c1899 --- /dev/null +++ b/test/expressions/esprima/expression-binary-logical/migrated_0004/expected.json @@ -0,0 +1,83 @@ +{ + "type": "LogicalExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "||", + "right": { + "type": "LogicalExpression", + "start": 5, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "left": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "y" + }, + "name": "y" + }, + "operator": "&&", + "right": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "z" + }, + "name": "z" + } + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-binary-logical/migrated_0005/actual.js b/test/expressions/esprima/expression-binary-logical/migrated_0005/actual.js new file mode 100644 index 0000000000..6ff43831c6 --- /dev/null +++ b/test/expressions/esprima/expression-binary-logical/migrated_0005/actual.js @@ -0,0 +1 @@ +x || y ^ z diff --git a/test/expressions/esprima/expression-binary-logical/migrated_0005/expected.json b/test/expressions/esprima/expression-binary-logical/migrated_0005/expected.json new file mode 100644 index 0000000000..fc3a58edf0 --- /dev/null +++ b/test/expressions/esprima/expression-binary-logical/migrated_0005/expected.json @@ -0,0 +1,83 @@ +{ + "type": "LogicalExpression", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "||", + "right": { + "type": "BinaryExpression", + "start": 5, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "left": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "y" + }, + "name": "y" + }, + "operator": "^", + "right": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "z" + }, + "name": "z" + } + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-binary/migrated_0000/actual.js b/test/expressions/esprima/expression-binary/migrated_0000/actual.js new file mode 100644 index 0000000000..ace7e0bf2d --- /dev/null +++ b/test/expressions/esprima/expression-binary/migrated_0000/actual.js @@ -0,0 +1 @@ +x + y + z diff --git a/test/expressions/esprima/expression-binary/migrated_0000/expected.json b/test/expressions/esprima/expression-binary/migrated_0000/expected.json new file mode 100644 index 0000000000..b8805a32a5 --- /dev/null +++ b/test/expressions/esprima/expression-binary/migrated_0000/expected.json @@ -0,0 +1,83 @@ +{ + "type": "BinaryExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "+", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "y" + }, + "name": "y" + } + }, + "operator": "+", + "right": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "z" + }, + "name": "z" + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-binary/migrated_0001/actual.js b/test/expressions/esprima/expression-binary/migrated_0001/actual.js new file mode 100644 index 0000000000..689cb88717 --- /dev/null +++ b/test/expressions/esprima/expression-binary/migrated_0001/actual.js @@ -0,0 +1 @@ +x - y + z diff --git a/test/expressions/esprima/expression-binary/migrated_0001/expected.json b/test/expressions/esprima/expression-binary/migrated_0001/expected.json new file mode 100644 index 0000000000..76629aed88 --- /dev/null +++ b/test/expressions/esprima/expression-binary/migrated_0001/expected.json @@ -0,0 +1,83 @@ +{ + "type": "BinaryExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "-", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "y" + }, + "name": "y" + } + }, + "operator": "+", + "right": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "z" + }, + "name": "z" + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-binary/migrated_0002/actual.js b/test/expressions/esprima/expression-binary/migrated_0002/actual.js new file mode 100644 index 0000000000..89425f9273 --- /dev/null +++ b/test/expressions/esprima/expression-binary/migrated_0002/actual.js @@ -0,0 +1 @@ +x + y - z diff --git a/test/expressions/esprima/expression-binary/migrated_0002/expected.json b/test/expressions/esprima/expression-binary/migrated_0002/expected.json new file mode 100644 index 0000000000..9257511be1 --- /dev/null +++ b/test/expressions/esprima/expression-binary/migrated_0002/expected.json @@ -0,0 +1,83 @@ +{ + "type": "BinaryExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "+", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "y" + }, + "name": "y" + } + }, + "operator": "-", + "right": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "z" + }, + "name": "z" + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-binary/migrated_0003/actual.js b/test/expressions/esprima/expression-binary/migrated_0003/actual.js new file mode 100644 index 0000000000..8e7a45ced7 --- /dev/null +++ b/test/expressions/esprima/expression-binary/migrated_0003/actual.js @@ -0,0 +1 @@ +x - y - z diff --git a/test/expressions/esprima/expression-binary/migrated_0003/expected.json b/test/expressions/esprima/expression-binary/migrated_0003/expected.json new file mode 100644 index 0000000000..38ad3bef07 --- /dev/null +++ b/test/expressions/esprima/expression-binary/migrated_0003/expected.json @@ -0,0 +1,83 @@ +{ + "type": "BinaryExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "-", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "y" + }, + "name": "y" + } + }, + "operator": "-", + "right": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "z" + }, + "name": "z" + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-binary/migrated_0004/actual.js b/test/expressions/esprima/expression-binary/migrated_0004/actual.js new file mode 100644 index 0000000000..6908de281f --- /dev/null +++ b/test/expressions/esprima/expression-binary/migrated_0004/actual.js @@ -0,0 +1 @@ +x + y * z diff --git a/test/expressions/esprima/expression-binary/migrated_0004/expected.json b/test/expressions/esprima/expression-binary/migrated_0004/expected.json new file mode 100644 index 0000000000..72fd45dae5 --- /dev/null +++ b/test/expressions/esprima/expression-binary/migrated_0004/expected.json @@ -0,0 +1,83 @@ +{ + "type": "BinaryExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "+", + "right": { + "type": "BinaryExpression", + "start": 4, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "y" + }, + "name": "y" + }, + "operator": "*", + "right": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "z" + }, + "name": "z" + } + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-binary/migrated_0005/actual.js b/test/expressions/esprima/expression-binary/migrated_0005/actual.js new file mode 100644 index 0000000000..05c8c505cf --- /dev/null +++ b/test/expressions/esprima/expression-binary/migrated_0005/actual.js @@ -0,0 +1 @@ +x + y / z diff --git a/test/expressions/esprima/expression-binary/migrated_0005/expected.json b/test/expressions/esprima/expression-binary/migrated_0005/expected.json new file mode 100644 index 0000000000..5f0c3a5870 --- /dev/null +++ b/test/expressions/esprima/expression-binary/migrated_0005/expected.json @@ -0,0 +1,83 @@ +{ + "type": "BinaryExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "+", + "right": { + "type": "BinaryExpression", + "start": 4, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "y" + }, + "name": "y" + }, + "operator": "/", + "right": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "z" + }, + "name": "z" + } + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-binary/migrated_0006/actual.js b/test/expressions/esprima/expression-binary/migrated_0006/actual.js new file mode 100644 index 0000000000..4fde298f0f --- /dev/null +++ b/test/expressions/esprima/expression-binary/migrated_0006/actual.js @@ -0,0 +1 @@ +x - y % z diff --git a/test/expressions/esprima/expression-binary/migrated_0006/expected.json b/test/expressions/esprima/expression-binary/migrated_0006/expected.json new file mode 100644 index 0000000000..067cb4f2e1 --- /dev/null +++ b/test/expressions/esprima/expression-binary/migrated_0006/expected.json @@ -0,0 +1,83 @@ +{ + "type": "BinaryExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "-", + "right": { + "type": "BinaryExpression", + "start": 4, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "y" + }, + "name": "y" + }, + "operator": "%", + "right": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "z" + }, + "name": "z" + } + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-binary/migrated_0007/actual.js b/test/expressions/esprima/expression-binary/migrated_0007/actual.js new file mode 100644 index 0000000000..2487593dd8 --- /dev/null +++ b/test/expressions/esprima/expression-binary/migrated_0007/actual.js @@ -0,0 +1 @@ +x * y * z diff --git a/test/expressions/esprima/expression-binary/migrated_0007/expected.json b/test/expressions/esprima/expression-binary/migrated_0007/expected.json new file mode 100644 index 0000000000..09e30653e1 --- /dev/null +++ b/test/expressions/esprima/expression-binary/migrated_0007/expected.json @@ -0,0 +1,83 @@ +{ + "type": "BinaryExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "*", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "y" + }, + "name": "y" + } + }, + "operator": "*", + "right": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "z" + }, + "name": "z" + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-binary/migrated_0008/actual.js b/test/expressions/esprima/expression-binary/migrated_0008/actual.js new file mode 100644 index 0000000000..0bfe2ae559 --- /dev/null +++ b/test/expressions/esprima/expression-binary/migrated_0008/actual.js @@ -0,0 +1 @@ +x * y / z diff --git a/test/expressions/esprima/expression-binary/migrated_0008/expected.json b/test/expressions/esprima/expression-binary/migrated_0008/expected.json new file mode 100644 index 0000000000..54d5eea438 --- /dev/null +++ b/test/expressions/esprima/expression-binary/migrated_0008/expected.json @@ -0,0 +1,83 @@ +{ + "type": "BinaryExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "*", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "y" + }, + "name": "y" + } + }, + "operator": "/", + "right": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "z" + }, + "name": "z" + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-binary/migrated_0009/actual.js b/test/expressions/esprima/expression-binary/migrated_0009/actual.js new file mode 100644 index 0000000000..862069a198 --- /dev/null +++ b/test/expressions/esprima/expression-binary/migrated_0009/actual.js @@ -0,0 +1 @@ +x * y % z diff --git a/test/expressions/esprima/expression-binary/migrated_0009/expected.json b/test/expressions/esprima/expression-binary/migrated_0009/expected.json new file mode 100644 index 0000000000..f390eee62e --- /dev/null +++ b/test/expressions/esprima/expression-binary/migrated_0009/expected.json @@ -0,0 +1,83 @@ +{ + "type": "BinaryExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "*", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "y" + }, + "name": "y" + } + }, + "operator": "%", + "right": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "z" + }, + "name": "z" + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-binary/migrated_0010/actual.js b/test/expressions/esprima/expression-binary/migrated_0010/actual.js new file mode 100644 index 0000000000..77b5290486 --- /dev/null +++ b/test/expressions/esprima/expression-binary/migrated_0010/actual.js @@ -0,0 +1 @@ +x % y * z diff --git a/test/expressions/esprima/expression-binary/migrated_0010/expected.json b/test/expressions/esprima/expression-binary/migrated_0010/expected.json new file mode 100644 index 0000000000..26718a96d2 --- /dev/null +++ b/test/expressions/esprima/expression-binary/migrated_0010/expected.json @@ -0,0 +1,83 @@ +{ + "type": "BinaryExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "%", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "y" + }, + "name": "y" + } + }, + "operator": "*", + "right": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "z" + }, + "name": "z" + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-binary/migrated_0011/actual.js b/test/expressions/esprima/expression-binary/migrated_0011/actual.js new file mode 100644 index 0000000000..3e63d20011 --- /dev/null +++ b/test/expressions/esprima/expression-binary/migrated_0011/actual.js @@ -0,0 +1 @@ +x << y << z diff --git a/test/expressions/esprima/expression-binary/migrated_0011/expected.json b/test/expressions/esprima/expression-binary/migrated_0011/expected.json new file mode 100644 index 0000000000..20b9316e9a --- /dev/null +++ b/test/expressions/esprima/expression-binary/migrated_0011/expected.json @@ -0,0 +1,83 @@ +{ + "type": "BinaryExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "left": { + "type": "BinaryExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "<<", + "right": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "y" + }, + "name": "y" + } + }, + "operator": "<<", + "right": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "z" + }, + "name": "z" + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-binary/migrated_0012/actual.js b/test/expressions/esprima/expression-binary/migrated_0012/actual.js new file mode 100644 index 0000000000..7d90d68915 --- /dev/null +++ b/test/expressions/esprima/expression-binary/migrated_0012/actual.js @@ -0,0 +1 @@ +x | y | z diff --git a/test/expressions/esprima/expression-binary/migrated_0012/expected.json b/test/expressions/esprima/expression-binary/migrated_0012/expected.json new file mode 100644 index 0000000000..ee23896542 --- /dev/null +++ b/test/expressions/esprima/expression-binary/migrated_0012/expected.json @@ -0,0 +1,83 @@ +{ + "type": "BinaryExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "|", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "y" + }, + "name": "y" + } + }, + "operator": "|", + "right": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "z" + }, + "name": "z" + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-binary/migrated_0013/actual.js b/test/expressions/esprima/expression-binary/migrated_0013/actual.js new file mode 100644 index 0000000000..c6fe6c5daf --- /dev/null +++ b/test/expressions/esprima/expression-binary/migrated_0013/actual.js @@ -0,0 +1 @@ +x & y & z diff --git a/test/expressions/esprima/expression-binary/migrated_0013/expected.json b/test/expressions/esprima/expression-binary/migrated_0013/expected.json new file mode 100644 index 0000000000..f7b90cffea --- /dev/null +++ b/test/expressions/esprima/expression-binary/migrated_0013/expected.json @@ -0,0 +1,83 @@ +{ + "type": "BinaryExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "&", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "y" + }, + "name": "y" + } + }, + "operator": "&", + "right": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "z" + }, + "name": "z" + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-binary/migrated_0014/actual.js b/test/expressions/esprima/expression-binary/migrated_0014/actual.js new file mode 100644 index 0000000000..c2d0bfe871 --- /dev/null +++ b/test/expressions/esprima/expression-binary/migrated_0014/actual.js @@ -0,0 +1 @@ +x ^ y ^ z diff --git a/test/expressions/esprima/expression-binary/migrated_0014/expected.json b/test/expressions/esprima/expression-binary/migrated_0014/expected.json new file mode 100644 index 0000000000..4d14054161 --- /dev/null +++ b/test/expressions/esprima/expression-binary/migrated_0014/expected.json @@ -0,0 +1,83 @@ +{ + "type": "BinaryExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "^", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "y" + }, + "name": "y" + } + }, + "operator": "^", + "right": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "z" + }, + "name": "z" + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-binary/migrated_0015/actual.js b/test/expressions/esprima/expression-binary/migrated_0015/actual.js new file mode 100644 index 0000000000..962182f597 --- /dev/null +++ b/test/expressions/esprima/expression-binary/migrated_0015/actual.js @@ -0,0 +1 @@ +x & y | z diff --git a/test/expressions/esprima/expression-binary/migrated_0015/expected.json b/test/expressions/esprima/expression-binary/migrated_0015/expected.json new file mode 100644 index 0000000000..189d6d4fa3 --- /dev/null +++ b/test/expressions/esprima/expression-binary/migrated_0015/expected.json @@ -0,0 +1,83 @@ +{ + "type": "BinaryExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "&", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "y" + }, + "name": "y" + } + }, + "operator": "|", + "right": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "z" + }, + "name": "z" + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-binary/migrated_0016/actual.js b/test/expressions/esprima/expression-binary/migrated_0016/actual.js new file mode 100644 index 0000000000..25a30410da --- /dev/null +++ b/test/expressions/esprima/expression-binary/migrated_0016/actual.js @@ -0,0 +1 @@ +x | y ^ z diff --git a/test/expressions/esprima/expression-binary/migrated_0016/expected.json b/test/expressions/esprima/expression-binary/migrated_0016/expected.json new file mode 100644 index 0000000000..79bde08c0a --- /dev/null +++ b/test/expressions/esprima/expression-binary/migrated_0016/expected.json @@ -0,0 +1,83 @@ +{ + "type": "BinaryExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "|", + "right": { + "type": "BinaryExpression", + "start": 4, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "y" + }, + "name": "y" + }, + "operator": "^", + "right": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "z" + }, + "name": "z" + } + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-binary/migrated_0017/actual.js b/test/expressions/esprima/expression-binary/migrated_0017/actual.js new file mode 100644 index 0000000000..4e4b638c97 --- /dev/null +++ b/test/expressions/esprima/expression-binary/migrated_0017/actual.js @@ -0,0 +1 @@ +x | y & z diff --git a/test/expressions/esprima/expression-binary/migrated_0017/expected.json b/test/expressions/esprima/expression-binary/migrated_0017/expected.json new file mode 100644 index 0000000000..54044292b2 --- /dev/null +++ b/test/expressions/esprima/expression-binary/migrated_0017/expected.json @@ -0,0 +1,83 @@ +{ + "type": "BinaryExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "|", + "right": { + "type": "BinaryExpression", + "start": 4, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "y" + }, + "name": "y" + }, + "operator": "&", + "right": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "z" + }, + "name": "z" + } + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-bitwise-shift/migrated_0000/actual.js b/test/expressions/esprima/expression-bitwise-shift/migrated_0000/actual.js new file mode 100644 index 0000000000..9956b52bbb --- /dev/null +++ b/test/expressions/esprima/expression-bitwise-shift/migrated_0000/actual.js @@ -0,0 +1 @@ +x << y diff --git a/test/expressions/esprima/expression-bitwise-shift/migrated_0000/expected.json b/test/expressions/esprima/expression-bitwise-shift/migrated_0000/expected.json new file mode 100644 index 0000000000..8538bace1d --- /dev/null +++ b/test/expressions/esprima/expression-bitwise-shift/migrated_0000/expected.json @@ -0,0 +1,50 @@ +{ + "type": "BinaryExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "<<", + "right": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "y" + }, + "name": "y" + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-bitwise-shift/migrated_0001/actual.js b/test/expressions/esprima/expression-bitwise-shift/migrated_0001/actual.js new file mode 100644 index 0000000000..97b03e6112 --- /dev/null +++ b/test/expressions/esprima/expression-bitwise-shift/migrated_0001/actual.js @@ -0,0 +1 @@ +x >> y diff --git a/test/expressions/esprima/expression-bitwise-shift/migrated_0001/expected.json b/test/expressions/esprima/expression-bitwise-shift/migrated_0001/expected.json new file mode 100644 index 0000000000..8fc6c6e507 --- /dev/null +++ b/test/expressions/esprima/expression-bitwise-shift/migrated_0001/expected.json @@ -0,0 +1,50 @@ +{ + "type": "BinaryExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": ">>", + "right": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "y" + }, + "name": "y" + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-bitwise-shift/migrated_0002/actual.js b/test/expressions/esprima/expression-bitwise-shift/migrated_0002/actual.js new file mode 100644 index 0000000000..6605695a6b --- /dev/null +++ b/test/expressions/esprima/expression-bitwise-shift/migrated_0002/actual.js @@ -0,0 +1 @@ +x >>> y diff --git a/test/expressions/esprima/expression-bitwise-shift/migrated_0002/expected.json b/test/expressions/esprima/expression-bitwise-shift/migrated_0002/expected.json new file mode 100644 index 0000000000..3a69586a59 --- /dev/null +++ b/test/expressions/esprima/expression-bitwise-shift/migrated_0002/expected.json @@ -0,0 +1,50 @@ +{ + "type": "BinaryExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": ">>>", + "right": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "y" + }, + "name": "y" + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-complex/migrated_0000/actual.js b/test/expressions/esprima/expression-complex/migrated_0000/actual.js new file mode 100644 index 0000000000..2a769e96c3 --- /dev/null +++ b/test/expressions/esprima/expression-complex/migrated_0000/actual.js @@ -0,0 +1 @@ +a || b && c | d ^ e & f == g < h >>> i + j * k diff --git a/test/expressions/esprima/expression-complex/migrated_0000/expected.json b/test/expressions/esprima/expression-complex/migrated_0000/expected.json new file mode 100644 index 0000000000..8d705da84c --- /dev/null +++ b/test/expressions/esprima/expression-complex/migrated_0000/expected.json @@ -0,0 +1,347 @@ +{ + "type": "LogicalExpression", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "a" + }, + "name": "a" + }, + "operator": "||", + "right": { + "type": "LogicalExpression", + "start": 5, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "left": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "b" + }, + "name": "b" + }, + "operator": "&&", + "right": { + "type": "BinaryExpression", + "start": 10, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "left": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "c" + }, + "name": "c" + }, + "operator": "|", + "right": { + "type": "BinaryExpression", + "start": 14, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "left": { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + }, + "identifierName": "d" + }, + "name": "d" + }, + "operator": "^", + "right": { + "type": "BinaryExpression", + "start": 18, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "left": { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "e" + }, + "name": "e" + }, + "operator": "&", + "right": { + "type": "BinaryExpression", + "start": 22, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "left": { + "type": "Identifier", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 23 + }, + "identifierName": "f" + }, + "name": "f" + }, + "operator": "==", + "right": { + "type": "BinaryExpression", + "start": 27, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "left": { + "type": "Identifier", + "start": 27, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 28 + }, + "identifierName": "g" + }, + "name": "g" + }, + "operator": "<", + "right": { + "type": "BinaryExpression", + "start": 31, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "left": { + "type": "Identifier", + "start": 31, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 32 + }, + "identifierName": "h" + }, + "name": "h" + }, + "operator": ">>>", + "right": { + "type": "BinaryExpression", + "start": 37, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "left": { + "type": "Identifier", + "start": 37, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 38 + }, + "identifierName": "i" + }, + "name": "i" + }, + "operator": "+", + "right": { + "type": "BinaryExpression", + "start": 41, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 41 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "left": { + "type": "Identifier", + "start": 41, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 41 + }, + "end": { + "line": 1, + "column": 42 + }, + "identifierName": "j" + }, + "name": "j" + }, + "operator": "*", + "right": { + "type": "Identifier", + "start": 45, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 45 + }, + "end": { + "line": 1, + "column": 46 + }, + "identifierName": "k" + }, + "name": "k" + } + } + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-conditional/migrated_0000/actual.js b/test/expressions/esprima/expression-conditional/migrated_0000/actual.js new file mode 100644 index 0000000000..848240c6c6 --- /dev/null +++ b/test/expressions/esprima/expression-conditional/migrated_0000/actual.js @@ -0,0 +1 @@ +y ? 1 : 2 diff --git a/test/expressions/esprima/expression-conditional/migrated_0000/expected.json b/test/expressions/esprima/expression-conditional/migrated_0000/expected.json new file mode 100644 index 0000000000..433628a428 --- /dev/null +++ b/test/expressions/esprima/expression-conditional/migrated_0000/expected.json @@ -0,0 +1,72 @@ +{ + "type": "ConditionalExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "test": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "y" + }, + "name": "y" + }, + "consequent": { + "type": "NumericLiteral", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + }, + "alternate": { + "type": "NumericLiteral", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-conditional/migrated_0001/actual.js b/test/expressions/esprima/expression-conditional/migrated_0001/actual.js new file mode 100644 index 0000000000..3f29ba0e20 --- /dev/null +++ b/test/expressions/esprima/expression-conditional/migrated_0001/actual.js @@ -0,0 +1 @@ +x && y ? 1 : 2 diff --git a/test/expressions/esprima/expression-conditional/migrated_0001/expected.json b/test/expressions/esprima/expression-conditional/migrated_0001/expected.json new file mode 100644 index 0000000000..fffdd8eb2e --- /dev/null +++ b/test/expressions/esprima/expression-conditional/migrated_0001/expected.json @@ -0,0 +1,105 @@ +{ + "type": "ConditionalExpression", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "test": { + "type": "LogicalExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "&&", + "right": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "y" + }, + "name": "y" + } + }, + "consequent": { + "type": "NumericLiteral", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + }, + "alternate": { + "type": "NumericLiteral", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-conditional/migrated_0002/actual.js b/test/expressions/esprima/expression-conditional/migrated_0002/actual.js new file mode 100644 index 0000000000..c63be97a08 --- /dev/null +++ b/test/expressions/esprima/expression-conditional/migrated_0002/actual.js @@ -0,0 +1 @@ +x = (0) ? 1 : 2 diff --git a/test/expressions/esprima/expression-conditional/migrated_0002/expected.json b/test/expressions/esprima/expression-conditional/migrated_0002/expected.json new file mode 100644 index 0000000000..ec41f9385c --- /dev/null +++ b/test/expressions/esprima/expression-conditional/migrated_0002/expected.json @@ -0,0 +1,110 @@ +{ + "type": "AssignmentExpression", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "right": { + "type": "ConditionalExpression", + "start": 4, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "test": { + "type": "NumericLiteral", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "extra": { + "rawValue": 0, + "raw": "0", + "parenthesized": true, + "parenStart": 4 + }, + "value": 0 + }, + "consequent": { + "type": "NumericLiteral", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + }, + "alternate": { + "type": "NumericLiteral", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-equality/migrated_0000/actual.js b/test/expressions/esprima/expression-equality/migrated_0000/actual.js new file mode 100644 index 0000000000..04dfc84773 --- /dev/null +++ b/test/expressions/esprima/expression-equality/migrated_0000/actual.js @@ -0,0 +1 @@ +x == y diff --git a/test/expressions/esprima/expression-equality/migrated_0000/expected.json b/test/expressions/esprima/expression-equality/migrated_0000/expected.json new file mode 100644 index 0000000000..1cce6fe3bd --- /dev/null +++ b/test/expressions/esprima/expression-equality/migrated_0000/expected.json @@ -0,0 +1,50 @@ +{ + "type": "BinaryExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "==", + "right": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "y" + }, + "name": "y" + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-equality/migrated_0001/actual.js b/test/expressions/esprima/expression-equality/migrated_0001/actual.js new file mode 100644 index 0000000000..348bb48b0f --- /dev/null +++ b/test/expressions/esprima/expression-equality/migrated_0001/actual.js @@ -0,0 +1 @@ +x != y diff --git a/test/expressions/esprima/expression-equality/migrated_0001/expected.json b/test/expressions/esprima/expression-equality/migrated_0001/expected.json new file mode 100644 index 0000000000..2d85183911 --- /dev/null +++ b/test/expressions/esprima/expression-equality/migrated_0001/expected.json @@ -0,0 +1,50 @@ +{ + "type": "BinaryExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "!=", + "right": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "y" + }, + "name": "y" + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-equality/migrated_0002/actual.js b/test/expressions/esprima/expression-equality/migrated_0002/actual.js new file mode 100644 index 0000000000..8193d1149a --- /dev/null +++ b/test/expressions/esprima/expression-equality/migrated_0002/actual.js @@ -0,0 +1 @@ +x === y diff --git a/test/expressions/esprima/expression-equality/migrated_0002/expected.json b/test/expressions/esprima/expression-equality/migrated_0002/expected.json new file mode 100644 index 0000000000..4485635008 --- /dev/null +++ b/test/expressions/esprima/expression-equality/migrated_0002/expected.json @@ -0,0 +1,50 @@ +{ + "type": "BinaryExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "===", + "right": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "y" + }, + "name": "y" + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-equality/migrated_0003/actual.js b/test/expressions/esprima/expression-equality/migrated_0003/actual.js new file mode 100644 index 0000000000..9060514515 --- /dev/null +++ b/test/expressions/esprima/expression-equality/migrated_0003/actual.js @@ -0,0 +1 @@ +x !== y diff --git a/test/expressions/esprima/expression-equality/migrated_0003/expected.json b/test/expressions/esprima/expression-equality/migrated_0003/expected.json new file mode 100644 index 0000000000..bd3be8cbf9 --- /dev/null +++ b/test/expressions/esprima/expression-equality/migrated_0003/expected.json @@ -0,0 +1,50 @@ +{ + "type": "BinaryExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "!==", + "right": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "y" + }, + "name": "y" + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-grouping/migrated_0000/actual.js b/test/expressions/esprima/expression-grouping/migrated_0000/actual.js new file mode 100644 index 0000000000..42734c6592 --- /dev/null +++ b/test/expressions/esprima/expression-grouping/migrated_0000/actual.js @@ -0,0 +1 @@ +(1) + (2 ) + 3 diff --git a/test/expressions/esprima/expression-grouping/migrated_0000/expected.json b/test/expressions/esprima/expression-grouping/migrated_0000/expected.json new file mode 100644 index 0000000000..ded6b3ffc2 --- /dev/null +++ b/test/expressions/esprima/expression-grouping/migrated_0000/expected.json @@ -0,0 +1,96 @@ +{ + "type": "BinaryExpression", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "left": { + "type": "BinaryExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "left": { + "type": "NumericLiteral", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "extra": { + "rawValue": 1, + "raw": "1", + "parenthesized": true, + "parenStart": 0 + }, + "value": 1 + }, + "operator": "+", + "right": { + "type": "NumericLiteral", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 2, + "raw": "2", + "parenthesized": true, + "parenStart": 6 + }, + "value": 2 + } + }, + "operator": "+", + "right": { + "type": "NumericLiteral", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "extra": { + "rawValue": 3, + "raw": "3" + }, + "value": 3 + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-grouping/migrated_0001/actual.js b/test/expressions/esprima/expression-grouping/migrated_0001/actual.js new file mode 100644 index 0000000000..56c0cac6ce --- /dev/null +++ b/test/expressions/esprima/expression-grouping/migrated_0001/actual.js @@ -0,0 +1 @@ +4 + 5 << (6) diff --git a/test/expressions/esprima/expression-grouping/migrated_0001/expected.json b/test/expressions/esprima/expression-grouping/migrated_0001/expected.json new file mode 100644 index 0000000000..aafb58f855 --- /dev/null +++ b/test/expressions/esprima/expression-grouping/migrated_0001/expected.json @@ -0,0 +1,94 @@ +{ + "type": "BinaryExpression", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "left": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "NumericLiteral", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "extra": { + "rawValue": 4, + "raw": "4" + }, + "value": 4 + }, + "operator": "+", + "right": { + "type": "NumericLiteral", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "extra": { + "rawValue": 5, + "raw": "5" + }, + "value": 5 + } + }, + "operator": "<<", + "right": { + "type": "NumericLiteral", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "extra": { + "rawValue": 6, + "raw": "6", + "parenthesized": true, + "parenStart": 9 + }, + "value": 6 + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-left-hand-side/migrated_0000/actual.js b/test/expressions/esprima/expression-left-hand-side/migrated_0000/actual.js new file mode 100644 index 0000000000..f25591e1c1 --- /dev/null +++ b/test/expressions/esprima/expression-left-hand-side/migrated_0000/actual.js @@ -0,0 +1 @@ +new Button diff --git a/test/expressions/esprima/expression-left-hand-side/migrated_0000/expected.json b/test/expressions/esprima/expression-left-hand-side/migrated_0000/expected.json new file mode 100644 index 0000000000..7b22c9ed1e --- /dev/null +++ b/test/expressions/esprima/expression-left-hand-side/migrated_0000/expected.json @@ -0,0 +1,33 @@ +{ + "type": "NewExpression", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "callee": { + "type": "Identifier", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "Button" + }, + "name": "Button" + }, + "arguments": [] +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-left-hand-side/migrated_0001/actual.js b/test/expressions/esprima/expression-left-hand-side/migrated_0001/actual.js new file mode 100644 index 0000000000..faf1e044d7 --- /dev/null +++ b/test/expressions/esprima/expression-left-hand-side/migrated_0001/actual.js @@ -0,0 +1 @@ +new Button() diff --git a/test/expressions/esprima/expression-left-hand-side/migrated_0001/expected.json b/test/expressions/esprima/expression-left-hand-side/migrated_0001/expected.json new file mode 100644 index 0000000000..0475c36fcd --- /dev/null +++ b/test/expressions/esprima/expression-left-hand-side/migrated_0001/expected.json @@ -0,0 +1,33 @@ +{ + "type": "NewExpression", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "callee": { + "type": "Identifier", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "Button" + }, + "name": "Button" + }, + "arguments": [] +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-left-hand-side/migrated_0002/actual.js b/test/expressions/esprima/expression-left-hand-side/migrated_0002/actual.js new file mode 100644 index 0000000000..94d35b3de1 --- /dev/null +++ b/test/expressions/esprima/expression-left-hand-side/migrated_0002/actual.js @@ -0,0 +1 @@ +new new foo diff --git a/test/expressions/esprima/expression-left-hand-side/migrated_0002/expected.json b/test/expressions/esprima/expression-left-hand-side/migrated_0002/expected.json new file mode 100644 index 0000000000..d405075d1e --- /dev/null +++ b/test/expressions/esprima/expression-left-hand-side/migrated_0002/expected.json @@ -0,0 +1,49 @@ +{ + "type": "NewExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "callee": { + "type": "NewExpression", + "start": 4, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "callee": { + "type": "Identifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "arguments": [] + }, + "arguments": [] +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-left-hand-side/migrated_0003/actual.js b/test/expressions/esprima/expression-left-hand-side/migrated_0003/actual.js new file mode 100644 index 0000000000..dd7e741e59 --- /dev/null +++ b/test/expressions/esprima/expression-left-hand-side/migrated_0003/actual.js @@ -0,0 +1 @@ +new new foo() diff --git a/test/expressions/esprima/expression-left-hand-side/migrated_0003/expected.json b/test/expressions/esprima/expression-left-hand-side/migrated_0003/expected.json new file mode 100644 index 0000000000..7c0db2db5e --- /dev/null +++ b/test/expressions/esprima/expression-left-hand-side/migrated_0003/expected.json @@ -0,0 +1,49 @@ +{ + "type": "NewExpression", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "callee": { + "type": "NewExpression", + "start": 4, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "callee": { + "type": "Identifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "arguments": [] + }, + "arguments": [] +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-left-hand-side/migrated_0004/actual.js b/test/expressions/esprima/expression-left-hand-side/migrated_0004/actual.js new file mode 100644 index 0000000000..70f5f76c68 --- /dev/null +++ b/test/expressions/esprima/expression-left-hand-side/migrated_0004/actual.js @@ -0,0 +1 @@ +new foo().bar() diff --git a/test/expressions/esprima/expression-left-hand-side/migrated_0004/expected.json b/test/expressions/esprima/expression-left-hand-side/migrated_0004/expected.json new file mode 100644 index 0000000000..43d431087c --- /dev/null +++ b/test/expressions/esprima/expression-left-hand-side/migrated_0004/expected.json @@ -0,0 +1,82 @@ +{ + "type": "CallExpression", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "callee": { + "type": "MemberExpression", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "object": { + "type": "NewExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "callee": { + "type": "Identifier", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "arguments": [] + }, + "property": { + "type": "Identifier", + "start": 10, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 13 + }, + "identifierName": "bar" + }, + "name": "bar" + }, + "computed": false + }, + "arguments": [] +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-left-hand-side/migrated_0005/actual.js b/test/expressions/esprima/expression-left-hand-side/migrated_0005/actual.js new file mode 100644 index 0000000000..970159627a --- /dev/null +++ b/test/expressions/esprima/expression-left-hand-side/migrated_0005/actual.js @@ -0,0 +1 @@ +new foo[bar] diff --git a/test/expressions/esprima/expression-left-hand-side/migrated_0005/expected.json b/test/expressions/esprima/expression-left-hand-side/migrated_0005/expected.json new file mode 100644 index 0000000000..5abee818be --- /dev/null +++ b/test/expressions/esprima/expression-left-hand-side/migrated_0005/expected.json @@ -0,0 +1,66 @@ +{ + "type": "NewExpression", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "callee": { + "type": "MemberExpression", + "start": 4, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "object": { + "type": "Identifier", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "property": { + "type": "Identifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "bar" + }, + "name": "bar" + }, + "computed": true + }, + "arguments": [] +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-left-hand-side/migrated_0006/actual.js b/test/expressions/esprima/expression-left-hand-side/migrated_0006/actual.js new file mode 100644 index 0000000000..c8eaa7d3df --- /dev/null +++ b/test/expressions/esprima/expression-left-hand-side/migrated_0006/actual.js @@ -0,0 +1 @@ +new foo.bar() diff --git a/test/expressions/esprima/expression-left-hand-side/migrated_0006/expected.json b/test/expressions/esprima/expression-left-hand-side/migrated_0006/expected.json new file mode 100644 index 0000000000..d933742cf2 --- /dev/null +++ b/test/expressions/esprima/expression-left-hand-side/migrated_0006/expected.json @@ -0,0 +1,66 @@ +{ + "type": "NewExpression", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "callee": { + "type": "MemberExpression", + "start": 4, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "object": { + "type": "Identifier", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "property": { + "type": "Identifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "bar" + }, + "name": "bar" + }, + "computed": false + }, + "arguments": [] +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-left-hand-side/migrated_0007/actual.js b/test/expressions/esprima/expression-left-hand-side/migrated_0007/actual.js new file mode 100644 index 0000000000..3cfaa821f0 --- /dev/null +++ b/test/expressions/esprima/expression-left-hand-side/migrated_0007/actual.js @@ -0,0 +1 @@ +( new foo).bar() diff --git a/test/expressions/esprima/expression-left-hand-side/migrated_0007/expected.json b/test/expressions/esprima/expression-left-hand-side/migrated_0007/expected.json new file mode 100644 index 0000000000..9d4cbb59f2 --- /dev/null +++ b/test/expressions/esprima/expression-left-hand-side/migrated_0007/expected.json @@ -0,0 +1,86 @@ +{ + "type": "CallExpression", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "callee": { + "type": "MemberExpression", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "object": { + "type": "NewExpression", + "start": 2, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "callee": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "arguments": [], + "extra": { + "parenthesized": true, + "parenStart": 0 + } + }, + "property": { + "type": "Identifier", + "start": 11, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "bar" + }, + "name": "bar" + }, + "computed": false + }, + "arguments": [] +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-left-hand-side/migrated_0008/actual.js b/test/expressions/esprima/expression-left-hand-side/migrated_0008/actual.js new file mode 100644 index 0000000000..da0f4f336f --- /dev/null +++ b/test/expressions/esprima/expression-left-hand-side/migrated_0008/actual.js @@ -0,0 +1 @@ +foo(bar, baz) diff --git a/test/expressions/esprima/expression-left-hand-side/migrated_0008/expected.json b/test/expressions/esprima/expression-left-hand-side/migrated_0008/expected.json new file mode 100644 index 0000000000..b72f41c8c2 --- /dev/null +++ b/test/expressions/esprima/expression-left-hand-side/migrated_0008/expected.json @@ -0,0 +1,68 @@ +{ + "type": "CallExpression", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "callee": { + "type": "Identifier", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "arguments": [ + { + "type": "Identifier", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "bar" + }, + "name": "bar" + }, + { + "type": "Identifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "baz" + }, + "name": "baz" + } + ] +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-left-hand-side/migrated_0009/actual.js b/test/expressions/esprima/expression-left-hand-side/migrated_0009/actual.js new file mode 100644 index 0000000000..f3004e7a57 --- /dev/null +++ b/test/expressions/esprima/expression-left-hand-side/migrated_0009/actual.js @@ -0,0 +1 @@ +( foo )() diff --git a/test/expressions/esprima/expression-left-hand-side/migrated_0009/expected.json b/test/expressions/esprima/expression-left-hand-side/migrated_0009/expected.json new file mode 100644 index 0000000000..4873889321 --- /dev/null +++ b/test/expressions/esprima/expression-left-hand-side/migrated_0009/expected.json @@ -0,0 +1,37 @@ +{ + "type": "CallExpression", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "callee": { + "type": "Identifier", + "start": 5, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "foo" + }, + "name": "foo", + "extra": { + "parenthesized": true, + "parenStart": 0 + } + }, + "arguments": [] +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-left-hand-side/migrated_0010/actual.js b/test/expressions/esprima/expression-left-hand-side/migrated_0010/actual.js new file mode 100644 index 0000000000..02ad348883 --- /dev/null +++ b/test/expressions/esprima/expression-left-hand-side/migrated_0010/actual.js @@ -0,0 +1 @@ +universe.milkyway diff --git a/test/expressions/esprima/expression-left-hand-side/migrated_0010/expected.json b/test/expressions/esprima/expression-left-hand-side/migrated_0010/expected.json new file mode 100644 index 0000000000..cd2c9f9528 --- /dev/null +++ b/test/expressions/esprima/expression-left-hand-side/migrated_0010/expected.json @@ -0,0 +1,50 @@ +{ + "type": "MemberExpression", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "object": { + "type": "Identifier", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "universe" + }, + "name": "universe" + }, + "property": { + "type": "Identifier", + "start": 9, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "milkyway" + }, + "name": "milkyway" + }, + "computed": false +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-left-hand-side/migrated_0011/actual.js b/test/expressions/esprima/expression-left-hand-side/migrated_0011/actual.js new file mode 100644 index 0000000000..aafe7cd7c7 --- /dev/null +++ b/test/expressions/esprima/expression-left-hand-side/migrated_0011/actual.js @@ -0,0 +1 @@ +universe.milkyway.solarsystem diff --git a/test/expressions/esprima/expression-left-hand-side/migrated_0011/expected.json b/test/expressions/esprima/expression-left-hand-side/migrated_0011/expected.json new file mode 100644 index 0000000000..bee15d2dc8 --- /dev/null +++ b/test/expressions/esprima/expression-left-hand-side/migrated_0011/expected.json @@ -0,0 +1,83 @@ +{ + "type": "MemberExpression", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "object": { + "type": "MemberExpression", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "object": { + "type": "Identifier", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "universe" + }, + "name": "universe" + }, + "property": { + "type": "Identifier", + "start": 9, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "milkyway" + }, + "name": "milkyway" + }, + "computed": false + }, + "property": { + "type": "Identifier", + "start": 18, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 29 + }, + "identifierName": "solarsystem" + }, + "name": "solarsystem" + }, + "computed": false +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-left-hand-side/migrated_0012/actual.js b/test/expressions/esprima/expression-left-hand-side/migrated_0012/actual.js new file mode 100644 index 0000000000..eae277418a --- /dev/null +++ b/test/expressions/esprima/expression-left-hand-side/migrated_0012/actual.js @@ -0,0 +1 @@ +universe.milkyway.solarsystem.Earth diff --git a/test/expressions/esprima/expression-left-hand-side/migrated_0012/expected.json b/test/expressions/esprima/expression-left-hand-side/migrated_0012/expected.json new file mode 100644 index 0000000000..a0399b6059 --- /dev/null +++ b/test/expressions/esprima/expression-left-hand-side/migrated_0012/expected.json @@ -0,0 +1,116 @@ +{ + "type": "MemberExpression", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "object": { + "type": "MemberExpression", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "object": { + "type": "MemberExpression", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "object": { + "type": "Identifier", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "universe" + }, + "name": "universe" + }, + "property": { + "type": "Identifier", + "start": 9, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "milkyway" + }, + "name": "milkyway" + }, + "computed": false + }, + "property": { + "type": "Identifier", + "start": 18, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 29 + }, + "identifierName": "solarsystem" + }, + "name": "solarsystem" + }, + "computed": false + }, + "property": { + "type": "Identifier", + "start": 30, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 35 + }, + "identifierName": "Earth" + }, + "name": "Earth" + }, + "computed": false +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-left-hand-side/migrated_0013/actual.js b/test/expressions/esprima/expression-left-hand-side/migrated_0013/actual.js new file mode 100644 index 0000000000..3b1db67828 --- /dev/null +++ b/test/expressions/esprima/expression-left-hand-side/migrated_0013/actual.js @@ -0,0 +1 @@ +universe[galaxyName, otherUselessName] diff --git a/test/expressions/esprima/expression-left-hand-side/migrated_0013/expected.json b/test/expressions/esprima/expression-left-hand-side/migrated_0013/expected.json new file mode 100644 index 0000000000..cbe933482b --- /dev/null +++ b/test/expressions/esprima/expression-left-hand-side/migrated_0013/expected.json @@ -0,0 +1,84 @@ +{ + "type": "MemberExpression", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "object": { + "type": "Identifier", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "universe" + }, + "name": "universe" + }, + "property": { + "type": "SequenceExpression", + "start": 9, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "expressions": [ + { + "type": "Identifier", + "start": 9, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "galaxyName" + }, + "name": "galaxyName" + }, + { + "type": "Identifier", + "start": 21, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 37 + }, + "identifierName": "otherUselessName" + }, + "name": "otherUselessName" + } + ] + }, + "computed": true +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-left-hand-side/migrated_0014/actual.js b/test/expressions/esprima/expression-left-hand-side/migrated_0014/actual.js new file mode 100644 index 0000000000..47f9ec6916 --- /dev/null +++ b/test/expressions/esprima/expression-left-hand-side/migrated_0014/actual.js @@ -0,0 +1 @@ +universe[galaxyName] diff --git a/test/expressions/esprima/expression-left-hand-side/migrated_0014/expected.json b/test/expressions/esprima/expression-left-hand-side/migrated_0014/expected.json new file mode 100644 index 0000000000..1df38e2432 --- /dev/null +++ b/test/expressions/esprima/expression-left-hand-side/migrated_0014/expected.json @@ -0,0 +1,50 @@ +{ + "type": "MemberExpression", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "object": { + "type": "Identifier", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "universe" + }, + "name": "universe" + }, + "property": { + "type": "Identifier", + "start": 9, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "galaxyName" + }, + "name": "galaxyName" + }, + "computed": true +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-left-hand-side/migrated_0015/actual.js b/test/expressions/esprima/expression-left-hand-side/migrated_0015/actual.js new file mode 100644 index 0000000000..79781fb356 --- /dev/null +++ b/test/expressions/esprima/expression-left-hand-side/migrated_0015/actual.js @@ -0,0 +1 @@ +universe[42].galaxies diff --git a/test/expressions/esprima/expression-left-hand-side/migrated_0015/expected.json b/test/expressions/esprima/expression-left-hand-side/migrated_0015/expected.json new file mode 100644 index 0000000000..8d0ba0ba86 --- /dev/null +++ b/test/expressions/esprima/expression-left-hand-side/migrated_0015/expected.json @@ -0,0 +1,86 @@ +{ + "type": "MemberExpression", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "object": { + "type": "MemberExpression", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "object": { + "type": "Identifier", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "universe" + }, + "name": "universe" + }, + "property": { + "type": "NumericLiteral", + "start": 9, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + }, + "computed": true + }, + "property": { + "type": "Identifier", + "start": 13, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 21 + }, + "identifierName": "galaxies" + }, + "name": "galaxies" + }, + "computed": false +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-left-hand-side/migrated_0016/actual.js b/test/expressions/esprima/expression-left-hand-side/migrated_0016/actual.js new file mode 100644 index 0000000000..3d6d662393 --- /dev/null +++ b/test/expressions/esprima/expression-left-hand-side/migrated_0016/actual.js @@ -0,0 +1 @@ +universe(42).galaxies diff --git a/test/expressions/esprima/expression-left-hand-side/migrated_0016/expected.json b/test/expressions/esprima/expression-left-hand-side/migrated_0016/expected.json new file mode 100644 index 0000000000..5e4456c36d --- /dev/null +++ b/test/expressions/esprima/expression-left-hand-side/migrated_0016/expected.json @@ -0,0 +1,87 @@ +{ + "type": "MemberExpression", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "object": { + "type": "CallExpression", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "callee": { + "type": "Identifier", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "universe" + }, + "name": "universe" + }, + "arguments": [ + { + "type": "NumericLiteral", + "start": 9, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + ] + }, + "property": { + "type": "Identifier", + "start": 13, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 21 + }, + "identifierName": "galaxies" + }, + "name": "galaxies" + }, + "computed": false +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-left-hand-side/migrated_0017/actual.js b/test/expressions/esprima/expression-left-hand-side/migrated_0017/actual.js new file mode 100644 index 0000000000..76785c5f46 --- /dev/null +++ b/test/expressions/esprima/expression-left-hand-side/migrated_0017/actual.js @@ -0,0 +1 @@ +universe(42).galaxies(14, 3, 77).milkyway diff --git a/test/expressions/esprima/expression-left-hand-side/migrated_0017/expected.json b/test/expressions/esprima/expression-left-hand-side/migrated_0017/expected.json new file mode 100644 index 0000000000..1bbaa60ee2 --- /dev/null +++ b/test/expressions/esprima/expression-left-hand-side/migrated_0017/expected.json @@ -0,0 +1,197 @@ +{ + "type": "MemberExpression", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "object": { + "type": "CallExpression", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "callee": { + "type": "MemberExpression", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "object": { + "type": "CallExpression", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "callee": { + "type": "Identifier", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "universe" + }, + "name": "universe" + }, + "arguments": [ + { + "type": "NumericLiteral", + "start": 9, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + ] + }, + "property": { + "type": "Identifier", + "start": 13, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 21 + }, + "identifierName": "galaxies" + }, + "name": "galaxies" + }, + "computed": false + }, + "arguments": [ + { + "type": "NumericLiteral", + "start": 22, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "extra": { + "rawValue": 14, + "raw": "14" + }, + "value": 14 + }, + { + "type": "NumericLiteral", + "start": 26, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "extra": { + "rawValue": 3, + "raw": "3" + }, + "value": 3 + }, + { + "type": "NumericLiteral", + "start": 29, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "extra": { + "rawValue": 77, + "raw": "77" + }, + "value": 77 + } + ] + }, + "property": { + "type": "Identifier", + "start": 33, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 41 + }, + "identifierName": "milkyway" + }, + "name": "milkyway" + }, + "computed": false +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-left-hand-side/migrated_0018/actual.js b/test/expressions/esprima/expression-left-hand-side/migrated_0018/actual.js new file mode 100644 index 0000000000..423bc528eb --- /dev/null +++ b/test/expressions/esprima/expression-left-hand-side/migrated_0018/actual.js @@ -0,0 +1 @@ +earth.asia.Indonesia.prepareForElection(2014) diff --git a/test/expressions/esprima/expression-left-hand-side/migrated_0018/expected.json b/test/expressions/esprima/expression-left-hand-side/migrated_0018/expected.json new file mode 100644 index 0000000000..ae391d7bab --- /dev/null +++ b/test/expressions/esprima/expression-left-hand-side/migrated_0018/expected.json @@ -0,0 +1,153 @@ +{ + "type": "CallExpression", + "start": 0, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "callee": { + "type": "MemberExpression", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "object": { + "type": "MemberExpression", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "object": { + "type": "MemberExpression", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "object": { + "type": "Identifier", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "earth" + }, + "name": "earth" + }, + "property": { + "type": "Identifier", + "start": 6, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "asia" + }, + "name": "asia" + }, + "computed": false + }, + "property": { + "type": "Identifier", + "start": 11, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 20 + }, + "identifierName": "Indonesia" + }, + "name": "Indonesia" + }, + "computed": false + }, + "property": { + "type": "Identifier", + "start": 21, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 39 + }, + "identifierName": "prepareForElection" + }, + "name": "prepareForElection" + }, + "computed": false + }, + "arguments": [ + { + "type": "NumericLiteral", + "start": 40, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "extra": { + "rawValue": 2014, + "raw": "2014" + }, + "value": 2014 + } + ] +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-left-hand-side/migrated_0019/actual.js b/test/expressions/esprima/expression-left-hand-side/migrated_0019/actual.js new file mode 100644 index 0000000000..1999f5dc40 --- /dev/null +++ b/test/expressions/esprima/expression-left-hand-side/migrated_0019/actual.js @@ -0,0 +1 @@ +universe.if diff --git a/test/expressions/esprima/expression-left-hand-side/migrated_0019/expected.json b/test/expressions/esprima/expression-left-hand-side/migrated_0019/expected.json new file mode 100644 index 0000000000..5b193dce08 --- /dev/null +++ b/test/expressions/esprima/expression-left-hand-side/migrated_0019/expected.json @@ -0,0 +1,50 @@ +{ + "type": "MemberExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "object": { + "type": "Identifier", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "universe" + }, + "name": "universe" + }, + "property": { + "type": "Identifier", + "start": 9, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "if" + }, + "name": "if" + }, + "computed": false +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-left-hand-side/migrated_0020/actual.js b/test/expressions/esprima/expression-left-hand-side/migrated_0020/actual.js new file mode 100644 index 0000000000..5c90c4fefb --- /dev/null +++ b/test/expressions/esprima/expression-left-hand-side/migrated_0020/actual.js @@ -0,0 +1 @@ +universe.true diff --git a/test/expressions/esprima/expression-left-hand-side/migrated_0020/expected.json b/test/expressions/esprima/expression-left-hand-side/migrated_0020/expected.json new file mode 100644 index 0000000000..98fcf82e63 --- /dev/null +++ b/test/expressions/esprima/expression-left-hand-side/migrated_0020/expected.json @@ -0,0 +1,50 @@ +{ + "type": "MemberExpression", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "object": { + "type": "Identifier", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "universe" + }, + "name": "universe" + }, + "property": { + "type": "Identifier", + "start": 9, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 13 + }, + "identifierName": "true" + }, + "name": "true" + }, + "computed": false +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-left-hand-side/migrated_0021/actual.js b/test/expressions/esprima/expression-left-hand-side/migrated_0021/actual.js new file mode 100644 index 0000000000..5fe9f0397c --- /dev/null +++ b/test/expressions/esprima/expression-left-hand-side/migrated_0021/actual.js @@ -0,0 +1 @@ +universe.false diff --git a/test/expressions/esprima/expression-left-hand-side/migrated_0021/expected.json b/test/expressions/esprima/expression-left-hand-side/migrated_0021/expected.json new file mode 100644 index 0000000000..ac8e3e9bf2 --- /dev/null +++ b/test/expressions/esprima/expression-left-hand-side/migrated_0021/expected.json @@ -0,0 +1,50 @@ +{ + "type": "MemberExpression", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "object": { + "type": "Identifier", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "universe" + }, + "name": "universe" + }, + "property": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "false" + }, + "name": "false" + }, + "computed": false +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-left-hand-side/migrated_0022/actual.js b/test/expressions/esprima/expression-left-hand-side/migrated_0022/actual.js new file mode 100644 index 0000000000..b439c86b98 --- /dev/null +++ b/test/expressions/esprima/expression-left-hand-side/migrated_0022/actual.js @@ -0,0 +1 @@ +universe.null diff --git a/test/expressions/esprima/expression-left-hand-side/migrated_0022/expected.json b/test/expressions/esprima/expression-left-hand-side/migrated_0022/expected.json new file mode 100644 index 0000000000..93c10d6c45 --- /dev/null +++ b/test/expressions/esprima/expression-left-hand-side/migrated_0022/expected.json @@ -0,0 +1,50 @@ +{ + "type": "MemberExpression", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "object": { + "type": "Identifier", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "universe" + }, + "name": "universe" + }, + "property": { + "type": "Identifier", + "start": 9, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 13 + }, + "identifierName": "null" + }, + "name": "null" + }, + "computed": false +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-multiplicative/migrated_0000/actual.js b/test/expressions/esprima/expression-multiplicative/migrated_0000/actual.js new file mode 100644 index 0000000000..d1a067af67 --- /dev/null +++ b/test/expressions/esprima/expression-multiplicative/migrated_0000/actual.js @@ -0,0 +1 @@ +x * y diff --git a/test/expressions/esprima/expression-multiplicative/migrated_0000/expected.json b/test/expressions/esprima/expression-multiplicative/migrated_0000/expected.json new file mode 100644 index 0000000000..e5899993f5 --- /dev/null +++ b/test/expressions/esprima/expression-multiplicative/migrated_0000/expected.json @@ -0,0 +1,50 @@ +{ + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "*", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "y" + }, + "name": "y" + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-multiplicative/migrated_0001/actual.js b/test/expressions/esprima/expression-multiplicative/migrated_0001/actual.js new file mode 100644 index 0000000000..02514641d8 --- /dev/null +++ b/test/expressions/esprima/expression-multiplicative/migrated_0001/actual.js @@ -0,0 +1 @@ +x / y diff --git a/test/expressions/esprima/expression-multiplicative/migrated_0001/expected.json b/test/expressions/esprima/expression-multiplicative/migrated_0001/expected.json new file mode 100644 index 0000000000..f318b4797f --- /dev/null +++ b/test/expressions/esprima/expression-multiplicative/migrated_0001/expected.json @@ -0,0 +1,50 @@ +{ + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "/", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "y" + }, + "name": "y" + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-multiplicative/migrated_0002/actual.js b/test/expressions/esprima/expression-multiplicative/migrated_0002/actual.js new file mode 100644 index 0000000000..e5605cc2ca --- /dev/null +++ b/test/expressions/esprima/expression-multiplicative/migrated_0002/actual.js @@ -0,0 +1 @@ +x % y diff --git a/test/expressions/esprima/expression-multiplicative/migrated_0002/expected.json b/test/expressions/esprima/expression-multiplicative/migrated_0002/expected.json new file mode 100644 index 0000000000..eba8500fb9 --- /dev/null +++ b/test/expressions/esprima/expression-multiplicative/migrated_0002/expected.json @@ -0,0 +1,50 @@ +{ + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "%", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "y" + }, + "name": "y" + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-postfix/migrated_0000/actual.js b/test/expressions/esprima/expression-postfix/migrated_0000/actual.js new file mode 100644 index 0000000000..364dc43646 --- /dev/null +++ b/test/expressions/esprima/expression-postfix/migrated_0000/actual.js @@ -0,0 +1 @@ +x++ diff --git a/test/expressions/esprima/expression-postfix/migrated_0000/expected.json b/test/expressions/esprima/expression-postfix/migrated_0000/expected.json new file mode 100644 index 0000000000..e5ded60507 --- /dev/null +++ b/test/expressions/esprima/expression-postfix/migrated_0000/expected.json @@ -0,0 +1,34 @@ +{ + "type": "UpdateExpression", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "operator": "++", + "prefix": false, + "argument": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-postfix/migrated_0001/actual.js b/test/expressions/esprima/expression-postfix/migrated_0001/actual.js new file mode 100644 index 0000000000..0820536cd8 --- /dev/null +++ b/test/expressions/esprima/expression-postfix/migrated_0001/actual.js @@ -0,0 +1 @@ +x-- diff --git a/test/expressions/esprima/expression-postfix/migrated_0001/expected.json b/test/expressions/esprima/expression-postfix/migrated_0001/expected.json new file mode 100644 index 0000000000..e8e35594bb --- /dev/null +++ b/test/expressions/esprima/expression-postfix/migrated_0001/expected.json @@ -0,0 +1,34 @@ +{ + "type": "UpdateExpression", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "operator": "--", + "prefix": false, + "argument": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-postfix/migrated_0002/actual.js b/test/expressions/esprima/expression-postfix/migrated_0002/actual.js new file mode 100644 index 0000000000..71a7f25653 --- /dev/null +++ b/test/expressions/esprima/expression-postfix/migrated_0002/actual.js @@ -0,0 +1 @@ +eval++ diff --git a/test/expressions/esprima/expression-postfix/migrated_0002/expected.json b/test/expressions/esprima/expression-postfix/migrated_0002/expected.json new file mode 100644 index 0000000000..ad76b5ded9 --- /dev/null +++ b/test/expressions/esprima/expression-postfix/migrated_0002/expected.json @@ -0,0 +1,34 @@ +{ + "type": "UpdateExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "operator": "++", + "prefix": false, + "argument": { + "type": "Identifier", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + }, + "identifierName": "eval" + }, + "name": "eval" + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-postfix/migrated_0003/actual.js b/test/expressions/esprima/expression-postfix/migrated_0003/actual.js new file mode 100644 index 0000000000..798b38e212 --- /dev/null +++ b/test/expressions/esprima/expression-postfix/migrated_0003/actual.js @@ -0,0 +1 @@ +eval-- diff --git a/test/expressions/esprima/expression-postfix/migrated_0003/expected.json b/test/expressions/esprima/expression-postfix/migrated_0003/expected.json new file mode 100644 index 0000000000..8948181a21 --- /dev/null +++ b/test/expressions/esprima/expression-postfix/migrated_0003/expected.json @@ -0,0 +1,34 @@ +{ + "type": "UpdateExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "operator": "--", + "prefix": false, + "argument": { + "type": "Identifier", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + }, + "identifierName": "eval" + }, + "name": "eval" + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-postfix/migrated_0004/actual.js b/test/expressions/esprima/expression-postfix/migrated_0004/actual.js new file mode 100644 index 0000000000..cd0b1ae75a --- /dev/null +++ b/test/expressions/esprima/expression-postfix/migrated_0004/actual.js @@ -0,0 +1 @@ +arguments++ diff --git a/test/expressions/esprima/expression-postfix/migrated_0004/expected.json b/test/expressions/esprima/expression-postfix/migrated_0004/expected.json new file mode 100644 index 0000000000..1abce8df59 --- /dev/null +++ b/test/expressions/esprima/expression-postfix/migrated_0004/expected.json @@ -0,0 +1,34 @@ +{ + "type": "UpdateExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "operator": "++", + "prefix": false, + "argument": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "arguments" + }, + "name": "arguments" + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-postfix/migrated_0005/actual.js b/test/expressions/esprima/expression-postfix/migrated_0005/actual.js new file mode 100644 index 0000000000..ac1d0470da --- /dev/null +++ b/test/expressions/esprima/expression-postfix/migrated_0005/actual.js @@ -0,0 +1 @@ +arguments-- diff --git a/test/expressions/esprima/expression-postfix/migrated_0005/expected.json b/test/expressions/esprima/expression-postfix/migrated_0005/expected.json new file mode 100644 index 0000000000..3ffb1357cb --- /dev/null +++ b/test/expressions/esprima/expression-postfix/migrated_0005/expected.json @@ -0,0 +1,34 @@ +{ + "type": "UpdateExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "operator": "--", + "prefix": false, + "argument": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "arguments" + }, + "name": "arguments" + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-relational/migrated_0000/actual.js b/test/expressions/esprima/expression-relational/migrated_0000/actual.js new file mode 100644 index 0000000000..a4309450ff --- /dev/null +++ b/test/expressions/esprima/expression-relational/migrated_0000/actual.js @@ -0,0 +1 @@ +x < y diff --git a/test/expressions/esprima/expression-relational/migrated_0000/expected.json b/test/expressions/esprima/expression-relational/migrated_0000/expected.json new file mode 100644 index 0000000000..4b48ac8479 --- /dev/null +++ b/test/expressions/esprima/expression-relational/migrated_0000/expected.json @@ -0,0 +1,50 @@ +{ + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "<", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "y" + }, + "name": "y" + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-relational/migrated_0001/actual.js b/test/expressions/esprima/expression-relational/migrated_0001/actual.js new file mode 100644 index 0000000000..4cdc8cdbb2 --- /dev/null +++ b/test/expressions/esprima/expression-relational/migrated_0001/actual.js @@ -0,0 +1 @@ +x > y diff --git a/test/expressions/esprima/expression-relational/migrated_0001/expected.json b/test/expressions/esprima/expression-relational/migrated_0001/expected.json new file mode 100644 index 0000000000..9b59ead154 --- /dev/null +++ b/test/expressions/esprima/expression-relational/migrated_0001/expected.json @@ -0,0 +1,50 @@ +{ + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": ">", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "y" + }, + "name": "y" + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-relational/migrated_0002/actual.js b/test/expressions/esprima/expression-relational/migrated_0002/actual.js new file mode 100644 index 0000000000..da883403b4 --- /dev/null +++ b/test/expressions/esprima/expression-relational/migrated_0002/actual.js @@ -0,0 +1 @@ +x <= y diff --git a/test/expressions/esprima/expression-relational/migrated_0002/expected.json b/test/expressions/esprima/expression-relational/migrated_0002/expected.json new file mode 100644 index 0000000000..83b2043a45 --- /dev/null +++ b/test/expressions/esprima/expression-relational/migrated_0002/expected.json @@ -0,0 +1,50 @@ +{ + "type": "BinaryExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "<=", + "right": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "y" + }, + "name": "y" + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-relational/migrated_0003/actual.js b/test/expressions/esprima/expression-relational/migrated_0003/actual.js new file mode 100644 index 0000000000..a64436af47 --- /dev/null +++ b/test/expressions/esprima/expression-relational/migrated_0003/actual.js @@ -0,0 +1 @@ +x >= y diff --git a/test/expressions/esprima/expression-relational/migrated_0003/expected.json b/test/expressions/esprima/expression-relational/migrated_0003/expected.json new file mode 100644 index 0000000000..ab60d5d4fb --- /dev/null +++ b/test/expressions/esprima/expression-relational/migrated_0003/expected.json @@ -0,0 +1,50 @@ +{ + "type": "BinaryExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": ">=", + "right": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "y" + }, + "name": "y" + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-relational/migrated_0004/actual.js b/test/expressions/esprima/expression-relational/migrated_0004/actual.js new file mode 100644 index 0000000000..15f21b7b63 --- /dev/null +++ b/test/expressions/esprima/expression-relational/migrated_0004/actual.js @@ -0,0 +1 @@ +x in y diff --git a/test/expressions/esprima/expression-relational/migrated_0004/expected.json b/test/expressions/esprima/expression-relational/migrated_0004/expected.json new file mode 100644 index 0000000000..740b947f31 --- /dev/null +++ b/test/expressions/esprima/expression-relational/migrated_0004/expected.json @@ -0,0 +1,50 @@ +{ + "type": "BinaryExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "in", + "right": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "y" + }, + "name": "y" + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-relational/migrated_0005/actual.js b/test/expressions/esprima/expression-relational/migrated_0005/actual.js new file mode 100644 index 0000000000..ce7d945120 --- /dev/null +++ b/test/expressions/esprima/expression-relational/migrated_0005/actual.js @@ -0,0 +1 @@ +x instanceof y diff --git a/test/expressions/esprima/expression-relational/migrated_0005/expected.json b/test/expressions/esprima/expression-relational/migrated_0005/expected.json new file mode 100644 index 0000000000..4b9bd9d551 --- /dev/null +++ b/test/expressions/esprima/expression-relational/migrated_0005/expected.json @@ -0,0 +1,50 @@ +{ + "type": "BinaryExpression", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "instanceof", + "right": { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "y" + }, + "name": "y" + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-relational/migrated_0006/actual.js b/test/expressions/esprima/expression-relational/migrated_0006/actual.js new file mode 100644 index 0000000000..aad496bf6a --- /dev/null +++ b/test/expressions/esprima/expression-relational/migrated_0006/actual.js @@ -0,0 +1 @@ +x < y < z diff --git a/test/expressions/esprima/expression-relational/migrated_0006/expected.json b/test/expressions/esprima/expression-relational/migrated_0006/expected.json new file mode 100644 index 0000000000..9828724965 --- /dev/null +++ b/test/expressions/esprima/expression-relational/migrated_0006/expected.json @@ -0,0 +1,83 @@ +{ + "type": "BinaryExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "<", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "y" + }, + "name": "y" + } + }, + "operator": "<", + "right": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "z" + }, + "name": "z" + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-unary/migrated_0000/actual.js b/test/expressions/esprima/expression-unary/migrated_0000/actual.js new file mode 100644 index 0000000000..e4238dffdf --- /dev/null +++ b/test/expressions/esprima/expression-unary/migrated_0000/actual.js @@ -0,0 +1 @@ +++x diff --git a/test/expressions/esprima/expression-unary/migrated_0000/expected.json b/test/expressions/esprima/expression-unary/migrated_0000/expected.json new file mode 100644 index 0000000000..dfbe5dca2f --- /dev/null +++ b/test/expressions/esprima/expression-unary/migrated_0000/expected.json @@ -0,0 +1,37 @@ +{ + "type": "UpdateExpression", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "operator": "++", + "prefix": true, + "argument": { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + }, + "identifierName": "x" + }, + "name": "x" + }, + "extra": { + "parenthesizedArgument": false + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-unary/migrated_0001/actual.js b/test/expressions/esprima/expression-unary/migrated_0001/actual.js new file mode 100644 index 0000000000..acb2c9ff3f --- /dev/null +++ b/test/expressions/esprima/expression-unary/migrated_0001/actual.js @@ -0,0 +1 @@ +--x diff --git a/test/expressions/esprima/expression-unary/migrated_0001/expected.json b/test/expressions/esprima/expression-unary/migrated_0001/expected.json new file mode 100644 index 0000000000..0b071381bb --- /dev/null +++ b/test/expressions/esprima/expression-unary/migrated_0001/expected.json @@ -0,0 +1,37 @@ +{ + "type": "UpdateExpression", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "operator": "--", + "prefix": true, + "argument": { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + }, + "identifierName": "x" + }, + "name": "x" + }, + "extra": { + "parenthesizedArgument": false + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-unary/migrated_0002/actual.js b/test/expressions/esprima/expression-unary/migrated_0002/actual.js new file mode 100644 index 0000000000..45adb9d186 --- /dev/null +++ b/test/expressions/esprima/expression-unary/migrated_0002/actual.js @@ -0,0 +1 @@ +++eval diff --git a/test/expressions/esprima/expression-unary/migrated_0002/expected.json b/test/expressions/esprima/expression-unary/migrated_0002/expected.json new file mode 100644 index 0000000000..93b46709e6 --- /dev/null +++ b/test/expressions/esprima/expression-unary/migrated_0002/expected.json @@ -0,0 +1,37 @@ +{ + "type": "UpdateExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "operator": "++", + "prefix": true, + "argument": { + "type": "Identifier", + "start": 2, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "eval" + }, + "name": "eval" + }, + "extra": { + "parenthesizedArgument": false + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-unary/migrated_0003/actual.js b/test/expressions/esprima/expression-unary/migrated_0003/actual.js new file mode 100644 index 0000000000..09a7ca55ce --- /dev/null +++ b/test/expressions/esprima/expression-unary/migrated_0003/actual.js @@ -0,0 +1 @@ +--eval diff --git a/test/expressions/esprima/expression-unary/migrated_0003/expected.json b/test/expressions/esprima/expression-unary/migrated_0003/expected.json new file mode 100644 index 0000000000..1cc1ad09d2 --- /dev/null +++ b/test/expressions/esprima/expression-unary/migrated_0003/expected.json @@ -0,0 +1,37 @@ +{ + "type": "UpdateExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "operator": "--", + "prefix": true, + "argument": { + "type": "Identifier", + "start": 2, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "eval" + }, + "name": "eval" + }, + "extra": { + "parenthesizedArgument": false + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-unary/migrated_0004/actual.js b/test/expressions/esprima/expression-unary/migrated_0004/actual.js new file mode 100644 index 0000000000..2507513936 --- /dev/null +++ b/test/expressions/esprima/expression-unary/migrated_0004/actual.js @@ -0,0 +1 @@ +++arguments diff --git a/test/expressions/esprima/expression-unary/migrated_0004/expected.json b/test/expressions/esprima/expression-unary/migrated_0004/expected.json new file mode 100644 index 0000000000..9681136a88 --- /dev/null +++ b/test/expressions/esprima/expression-unary/migrated_0004/expected.json @@ -0,0 +1,37 @@ +{ + "type": "UpdateExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "operator": "++", + "prefix": true, + "argument": { + "type": "Identifier", + "start": 2, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "arguments" + }, + "name": "arguments" + }, + "extra": { + "parenthesizedArgument": false + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-unary/migrated_0005/actual.js b/test/expressions/esprima/expression-unary/migrated_0005/actual.js new file mode 100644 index 0000000000..0108538d3d --- /dev/null +++ b/test/expressions/esprima/expression-unary/migrated_0005/actual.js @@ -0,0 +1 @@ +--arguments diff --git a/test/expressions/esprima/expression-unary/migrated_0005/expected.json b/test/expressions/esprima/expression-unary/migrated_0005/expected.json new file mode 100644 index 0000000000..8e5d6ab5a1 --- /dev/null +++ b/test/expressions/esprima/expression-unary/migrated_0005/expected.json @@ -0,0 +1,37 @@ +{ + "type": "UpdateExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "operator": "--", + "prefix": true, + "argument": { + "type": "Identifier", + "start": 2, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "arguments" + }, + "name": "arguments" + }, + "extra": { + "parenthesizedArgument": false + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-unary/migrated_0006/actual.js b/test/expressions/esprima/expression-unary/migrated_0006/actual.js new file mode 100644 index 0000000000..0f31a64603 --- /dev/null +++ b/test/expressions/esprima/expression-unary/migrated_0006/actual.js @@ -0,0 +1 @@ ++x diff --git a/test/expressions/esprima/expression-unary/migrated_0006/expected.json b/test/expressions/esprima/expression-unary/migrated_0006/expected.json new file mode 100644 index 0000000000..5a8b768e56 --- /dev/null +++ b/test/expressions/esprima/expression-unary/migrated_0006/expected.json @@ -0,0 +1,37 @@ +{ + "type": "UnaryExpression", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "operator": "+", + "prefix": true, + "argument": { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "x" + }, + "name": "x" + }, + "extra": { + "parenthesizedArgument": false + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-unary/migrated_0007/actual.js b/test/expressions/esprima/expression-unary/migrated_0007/actual.js new file mode 100644 index 0000000000..670c7b14af --- /dev/null +++ b/test/expressions/esprima/expression-unary/migrated_0007/actual.js @@ -0,0 +1 @@ +-x diff --git a/test/expressions/esprima/expression-unary/migrated_0007/expected.json b/test/expressions/esprima/expression-unary/migrated_0007/expected.json new file mode 100644 index 0000000000..b9bd015e1b --- /dev/null +++ b/test/expressions/esprima/expression-unary/migrated_0007/expected.json @@ -0,0 +1,37 @@ +{ + "type": "UnaryExpression", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "operator": "-", + "prefix": true, + "argument": { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "x" + }, + "name": "x" + }, + "extra": { + "parenthesizedArgument": false + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-unary/migrated_0008/actual.js b/test/expressions/esprima/expression-unary/migrated_0008/actual.js new file mode 100644 index 0000000000..d5b13ed838 --- /dev/null +++ b/test/expressions/esprima/expression-unary/migrated_0008/actual.js @@ -0,0 +1 @@ +~x diff --git a/test/expressions/esprima/expression-unary/migrated_0008/expected.json b/test/expressions/esprima/expression-unary/migrated_0008/expected.json new file mode 100644 index 0000000000..b9b29cfd80 --- /dev/null +++ b/test/expressions/esprima/expression-unary/migrated_0008/expected.json @@ -0,0 +1,37 @@ +{ + "type": "UnaryExpression", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "operator": "~", + "prefix": true, + "argument": { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "x" + }, + "name": "x" + }, + "extra": { + "parenthesizedArgument": false + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-unary/migrated_0009/actual.js b/test/expressions/esprima/expression-unary/migrated_0009/actual.js new file mode 100644 index 0000000000..d1b14d778f --- /dev/null +++ b/test/expressions/esprima/expression-unary/migrated_0009/actual.js @@ -0,0 +1 @@ +!x diff --git a/test/expressions/esprima/expression-unary/migrated_0009/expected.json b/test/expressions/esprima/expression-unary/migrated_0009/expected.json new file mode 100644 index 0000000000..a4a9b3c4b9 --- /dev/null +++ b/test/expressions/esprima/expression-unary/migrated_0009/expected.json @@ -0,0 +1,37 @@ +{ + "type": "UnaryExpression", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "operator": "!", + "prefix": true, + "argument": { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "x" + }, + "name": "x" + }, + "extra": { + "parenthesizedArgument": false + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-unary/migrated_0010/actual.js b/test/expressions/esprima/expression-unary/migrated_0010/actual.js new file mode 100644 index 0000000000..6bba139bc6 --- /dev/null +++ b/test/expressions/esprima/expression-unary/migrated_0010/actual.js @@ -0,0 +1 @@ +void x diff --git a/test/expressions/esprima/expression-unary/migrated_0010/expected.json b/test/expressions/esprima/expression-unary/migrated_0010/expected.json new file mode 100644 index 0000000000..205381b8d8 --- /dev/null +++ b/test/expressions/esprima/expression-unary/migrated_0010/expected.json @@ -0,0 +1,37 @@ +{ + "type": "UnaryExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "operator": "void", + "prefix": true, + "argument": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "x" + }, + "name": "x" + }, + "extra": { + "parenthesizedArgument": false + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-unary/migrated_0011/actual.js b/test/expressions/esprima/expression-unary/migrated_0011/actual.js new file mode 100644 index 0000000000..ebeb0cb0fa --- /dev/null +++ b/test/expressions/esprima/expression-unary/migrated_0011/actual.js @@ -0,0 +1 @@ +delete x diff --git a/test/expressions/esprima/expression-unary/migrated_0011/expected.json b/test/expressions/esprima/expression-unary/migrated_0011/expected.json new file mode 100644 index 0000000000..38a2a2d5f3 --- /dev/null +++ b/test/expressions/esprima/expression-unary/migrated_0011/expected.json @@ -0,0 +1,37 @@ +{ + "type": "UnaryExpression", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "operator": "delete", + "prefix": true, + "argument": { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "x" + }, + "name": "x" + }, + "extra": { + "parenthesizedArgument": false + } +} \ No newline at end of file diff --git a/test/expressions/esprima/expression-unary/migrated_0012/actual.js b/test/expressions/esprima/expression-unary/migrated_0012/actual.js new file mode 100644 index 0000000000..e18eec452d --- /dev/null +++ b/test/expressions/esprima/expression-unary/migrated_0012/actual.js @@ -0,0 +1 @@ +typeof x diff --git a/test/expressions/esprima/expression-unary/migrated_0012/expected.json b/test/expressions/esprima/expression-unary/migrated_0012/expected.json new file mode 100644 index 0000000000..b1795b5968 --- /dev/null +++ b/test/expressions/esprima/expression-unary/migrated_0012/expected.json @@ -0,0 +1,37 @@ +{ + "type": "UnaryExpression", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "operator": "typeof", + "prefix": true, + "argument": { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "x" + }, + "name": "x" + }, + "extra": { + "parenthesizedArgument": false + } +} \ No newline at end of file diff --git a/test/expressions/is-expression-babylon/fail/1/actual.js b/test/expressions/is-expression-babylon/fail/1/actual.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/expressions/is-expression-babylon/fail/1/options.json b/test/expressions/is-expression-babylon/fail/1/options.json new file mode 100644 index 0000000000..ca189c74f6 --- /dev/null +++ b/test/expressions/is-expression-babylon/fail/1/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:0)" +} diff --git a/test/expressions/is-expression-babylon/fail/2/actual.js b/test/expressions/is-expression-babylon/fail/2/actual.js new file mode 100644 index 0000000000..2e66e78a9d --- /dev/null +++ b/test/expressions/is-expression-babylon/fail/2/actual.js @@ -0,0 +1 @@ +)a() diff --git a/test/expressions/is-expression-babylon/fail/2/options.json b/test/expressions/is-expression-babylon/fail/2/options.json new file mode 100644 index 0000000000..ca189c74f6 --- /dev/null +++ b/test/expressions/is-expression-babylon/fail/2/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:0)" +} diff --git a/test/expressions/is-expression-babylon/fail/3/actual.js b/test/expressions/is-expression-babylon/fail/3/actual.js new file mode 100644 index 0000000000..2d5581e4c3 --- /dev/null +++ b/test/expressions/is-expression-babylon/fail/3/actual.js @@ -0,0 +1 @@ +=x diff --git a/test/expressions/is-expression-babylon/fail/3/options.json b/test/expressions/is-expression-babylon/fail/3/options.json new file mode 100644 index 0000000000..ca189c74f6 --- /dev/null +++ b/test/expressions/is-expression-babylon/fail/3/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:0)" +} diff --git a/test/expressions/is-expression-babylon/fail/4/actual.js b/test/expressions/is-expression-babylon/fail/4/actual.js new file mode 100644 index 0000000000..186857b9e8 --- /dev/null +++ b/test/expressions/is-expression-babylon/fail/4/actual.js @@ -0,0 +1 @@ +var diff --git a/test/expressions/is-expression-babylon/fail/4/options.json b/test/expressions/is-expression-babylon/fail/4/options.json new file mode 100644 index 0000000000..ca189c74f6 --- /dev/null +++ b/test/expressions/is-expression-babylon/fail/4/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:0)" +} diff --git a/test/expressions/is-expression-babylon/fail/5/actual.js b/test/expressions/is-expression-babylon/fail/5/actual.js new file mode 100644 index 0000000000..fd3468349e --- /dev/null +++ b/test/expressions/is-expression-babylon/fail/5/actual.js @@ -0,0 +1 @@ +weird error diff --git a/test/expressions/is-expression-babylon/fail/5/options.json b/test/expressions/is-expression-babylon/fail/5/options.json new file mode 100644 index 0000000000..158f0af7b4 --- /dev/null +++ b/test/expressions/is-expression-babylon/fail/5/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:6)" +} diff --git a/test/expressions/is-expression-babylon/fail/6/actual.js b/test/expressions/is-expression-babylon/fail/6/actual.js new file mode 100644 index 0000000000..cf679e0305 --- /dev/null +++ b/test/expressions/is-expression-babylon/fail/6/actual.js @@ -0,0 +1 @@ +asdf } diff --git a/test/expressions/is-expression-babylon/fail/6/options.json b/test/expressions/is-expression-babylon/fail/6/options.json new file mode 100644 index 0000000000..a10e365ed5 --- /dev/null +++ b/test/expressions/is-expression-babylon/fail/6/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (2:2)" +} diff --git a/test/expressions/is-expression-babylon/fail/7/actual.js b/test/expressions/is-expression-babylon/fail/7/actual.js new file mode 100644 index 0000000000..8af6880c02 --- /dev/null +++ b/test/expressions/is-expression-babylon/fail/7/actual.js @@ -0,0 +1 @@ +function (a = "default") {"use strict";} diff --git a/test/expressions/is-expression-babylon/fail/7/options.json b/test/expressions/is-expression-babylon/fail/7/options.json new file mode 100644 index 0000000000..d58bb015bf --- /dev/null +++ b/test/expressions/is-expression-babylon/fail/7/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Non-simple parameter in strict mode (1:10)" +} diff --git a/test/expressions/is-expression-babylon/fail/8/actual.js b/test/expressions/is-expression-babylon/fail/8/actual.js new file mode 100644 index 0000000000..37f5baf125 --- /dev/null +++ b/test/expressions/is-expression-babylon/fail/8/actual.js @@ -0,0 +1 @@ + public diff --git a/test/expressions/is-expression-babylon/fail/8/options.json b/test/expressions/is-expression-babylon/fail/8/options.json new file mode 100644 index 0000000000..e2125b7041 --- /dev/null +++ b/test/expressions/is-expression-babylon/fail/8/options.json @@ -0,0 +1,4 @@ +{ + "strictMode": true, + "throws": "public is a reserved word in strict mode (2:0)" +} diff --git a/test/expressions/is-expression-babylon/pass/1/actual.js b/test/expressions/is-expression-babylon/pass/1/actual.js new file mode 100644 index 0000000000..40f42b8d56 --- /dev/null +++ b/test/expressions/is-expression-babylon/pass/1/actual.js @@ -0,0 +1 @@ +myVar diff --git a/test/expressions/is-expression-babylon/pass/1/expected.json b/test/expressions/is-expression-babylon/pass/1/expected.json new file mode 100644 index 0000000000..7b549087af --- /dev/null +++ b/test/expressions/is-expression-babylon/pass/1/expected.json @@ -0,0 +1,17 @@ +{ + "type": "Identifier", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "myVar" + }, + "name": "myVar" +} \ No newline at end of file diff --git a/test/expressions/is-expression-babylon/pass/2/actual.js b/test/expressions/is-expression-babylon/pass/2/actual.js new file mode 100644 index 0000000000..708ec24a0d --- /dev/null +++ b/test/expressions/is-expression-babylon/pass/2/actual.js @@ -0,0 +1 @@ +["an", "array", "'s"].indexOf("index") diff --git a/test/expressions/is-expression-babylon/pass/2/expected.json b/test/expressions/is-expression-babylon/pass/2/expected.json new file mode 100644 index 0000000000..ea47978c4e --- /dev/null +++ b/test/expressions/is-expression-babylon/pass/2/expected.json @@ -0,0 +1,147 @@ +{ + "type": "CallExpression", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "callee": { + "type": "MemberExpression", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "object": { + "type": "ArrayExpression", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "elements": [ + { + "type": "StringLiteral", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "extra": { + "rawValue": "an", + "raw": "\"an\"" + }, + "value": "an" + }, + { + "type": "StringLiteral", + "start": 7, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "extra": { + "rawValue": "array", + "raw": "\"array\"" + }, + "value": "array" + }, + { + "type": "StringLiteral", + "start": 16, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "extra": { + "rawValue": "'s", + "raw": "\"'s\"" + }, + "value": "'s" + } + ] + }, + "property": { + "type": "Identifier", + "start": 22, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 29 + }, + "identifierName": "indexOf" + }, + "name": "indexOf" + }, + "computed": false + }, + "arguments": [ + { + "type": "StringLiteral", + "start": 30, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "extra": { + "rawValue": "index", + "raw": "\"index\"" + }, + "value": "index" + } + ] +} \ No newline at end of file diff --git a/test/expressions/is-expression-babylon/pass/3/actual.js b/test/expressions/is-expression-babylon/pass/3/actual.js new file mode 100644 index 0000000000..43fb4863a6 --- /dev/null +++ b/test/expressions/is-expression-babylon/pass/3/actual.js @@ -0,0 +1 @@ +() => a diff --git a/test/expressions/is-expression-babylon/pass/3/expected.json b/test/expressions/is-expression-babylon/pass/3/expected.json new file mode 100644 index 0000000000..b7ffc7b6ca --- /dev/null +++ b/test/expressions/is-expression-babylon/pass/3/expected.json @@ -0,0 +1,37 @@ +{ + "type": "ArrowFunctionExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "id": null, + "generator": false, + "expression": true, + "async": false, + "params": [], + "body": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "a" + }, + "name": "a" + } +} \ No newline at end of file diff --git a/test/expressions/is-expression-babylon/pass/4/actual.js b/test/expressions/is-expression-babylon/pass/4/actual.js new file mode 100644 index 0000000000..37f5baf125 --- /dev/null +++ b/test/expressions/is-expression-babylon/pass/4/actual.js @@ -0,0 +1 @@ + public diff --git a/test/expressions/is-expression-babylon/pass/4/expected.json b/test/expressions/is-expression-babylon/pass/4/expected.json new file mode 100644 index 0000000000..9cc5083d3a --- /dev/null +++ b/test/expressions/is-expression-babylon/pass/4/expected.json @@ -0,0 +1,17 @@ +{ + "type": "Identifier", + "start": 1, + "end": 7, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 6 + }, + "identifierName": "public" + }, + "name": "public" +} \ No newline at end of file diff --git a/test/expressions/is-expression-babylon/pass/5/actual.js b/test/expressions/is-expression-babylon/pass/5/actual.js new file mode 100644 index 0000000000..52fdd32af8 --- /dev/null +++ b/test/expressions/is-expression-babylon/pass/5/actual.js @@ -0,0 +1 @@ +abc // my comment diff --git a/test/expressions/is-expression-babylon/pass/5/expected.json b/test/expressions/is-expression-babylon/pass/5/expected.json new file mode 100644 index 0000000000..161dd980e6 --- /dev/null +++ b/test/expressions/is-expression-babylon/pass/5/expected.json @@ -0,0 +1,36 @@ +{ + "type": "Identifier", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + }, + "identifierName": "abc" + }, + "name": "abc", + "leadingComments": null, + "trailingComments": [ + { + "type": "CommentLine", + "value": " my comment", + "start": 4, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 17 + } + } + } + ] +} \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/392/actual.js b/test/fixtures/es2015/uncategorised/392/actual.js new file mode 100644 index 0000000000..cd501ed903 --- /dev/null +++ b/test/fixtures/es2015/uncategorised/392/actual.js @@ -0,0 +1 @@ +import foo, { bar: { a } } from 'my-module'; diff --git a/test/fixtures/es2015/uncategorised/392/options.json b/test/fixtures/es2015/uncategorised/392/options.json new file mode 100644 index 0000000000..9f52ab64ae --- /dev/null +++ b/test/fixtures/es2015/uncategorised/392/options.json @@ -0,0 +1,4 @@ +{ + "throws": "ES2015 named imports do not destructure. Use another statement for destructuring after the import. (1:19)", + "sourceType": "module" +} diff --git a/test/fixtures/es2015/uncategorised/393/actual.js b/test/fixtures/es2015/uncategorised/393/actual.js new file mode 100644 index 0000000000..684a2cd150 --- /dev/null +++ b/test/fixtures/es2015/uncategorised/393/actual.js @@ -0,0 +1 @@ +({set = {}}) => set; diff --git a/test/fixtures/es2015/uncategorised/393/expected.json b/test/fixtures/es2015/uncategorised/393/expected.json new file mode 100644 index 0000000000..8a7f651b62 --- /dev/null +++ b/test/fixtures/es2015/uncategorised/393/expected.json @@ -0,0 +1,190 @@ +{ + "type": "File", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "id": null, + "generator": false, + "expression": true, + "async": false, + "params": [ + { + "type": "ObjectPattern", + "start": 1, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 2, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 2, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "set" + }, + "name": "set" + }, + "value": { + "type": "AssignmentPattern", + "start": 2, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "left": { + "type": "Identifier", + "start": 2, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "set" + }, + "name": "set" + }, + "right": { + "type": "ObjectExpression", + "start": 8, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "properties": [] + } + }, + "extra": { + "shorthand": true + } + } + ] + } + ], + "body": { + "type": "Identifier", + "start": 16, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "set" + }, + "name": "set" + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/es2017/async-functions/export/actual.js b/test/fixtures/es2017/async-functions/export/actual.js new file mode 100644 index 0000000000..3f043e6176 --- /dev/null +++ b/test/fixtures/es2017/async-functions/export/actual.js @@ -0,0 +1,2 @@ +export async function foo() {} +export default async function bar() {} diff --git a/test/fixtures/es2017/async-functions/export/expected.json b/test/fixtures/es2017/async-functions/export/expected.json new file mode 100644 index 0000000000..a19d6f157b --- /dev/null +++ b/test/fixtures/es2017/async-functions/export/expected.json @@ -0,0 +1,172 @@ +{ + "type": "File", + "start": 0, + "end": 69, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 38 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 69, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 38 + } + }, + "sourceType": "module", + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "FunctionDeclaration", + "start": 7, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "id": { + "type": "Identifier", + "start": 22, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 25 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "generator": false, + "expression": false, + "async": true, + "params": [], + "body": { + "type": "BlockStatement", + "start": 28, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "body": [], + "directives": [] + } + } + }, + { + "type": "ExportDefaultDeclaration", + "start": 31, + "end": 69, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 38 + } + }, + "declaration": { + "type": "FunctionDeclaration", + "start": 46, + "end": 69, + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 38 + } + }, + "id": { + "type": "Identifier", + "start": 61, + "end": 64, + "loc": { + "start": { + "line": 2, + "column": 30 + }, + "end": { + "line": 2, + "column": 33 + }, + "identifierName": "bar" + }, + "name": "bar" + }, + "generator": false, + "expression": false, + "async": true, + "params": [], + "body": { + "type": "BlockStatement", + "start": 67, + "end": 69, + "loc": { + "start": { + "line": 2, + "column": 36 + }, + "end": { + "line": 2, + "column": 38 + } + }, + "body": [], + "directives": [] + } + } + } + ], + "directives": [] + } +} diff --git a/test/fixtures/es2017/async-functions/export/options.json b/test/fixtures/es2017/async-functions/export/options.json new file mode 100644 index 0000000000..2104ca4328 --- /dev/null +++ b/test/fixtures/es2017/async-functions/export/options.json @@ -0,0 +1,3 @@ +{ + "sourceType": "module" +} diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0083/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0083/options.json index 0ab445fe47..2d4f18af3e 100644 --- a/test/fixtures/esprima/invalid-syntax/migrated_0083/options.json +++ b/test/fixtures/esprima/invalid-syntax/migrated_0083/options.json @@ -1,3 +1,3 @@ { - "throws": "Unexpected token (1:5)" -} \ No newline at end of file + "throws": "Unexpected token, expected , (1:5)" +} diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0084/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0084/options.json index 0ab445fe47..2d4f18af3e 100644 --- a/test/fixtures/esprima/invalid-syntax/migrated_0084/options.json +++ b/test/fixtures/esprima/invalid-syntax/migrated_0084/options.json @@ -1,3 +1,3 @@ { - "throws": "Unexpected token (1:5)" -} \ No newline at end of file + "throws": "Unexpected token, expected , (1:5)" +} diff --git a/test/fixtures/experimental/class-properties/with-initializer-and-type-no-plugin/actual.js b/test/fixtures/experimental/class-properties/with-initializer-and-type-no-plugin/actual.js new file mode 100644 index 0000000000..f82f8d51d7 --- /dev/null +++ b/test/fixtures/experimental/class-properties/with-initializer-and-type-no-plugin/actual.js @@ -0,0 +1,3 @@ +class Foo { + bar: string = 'bizz'; +} diff --git a/test/fixtures/experimental/class-properties/with-initializer-and-type-no-plugin/options.json b/test/fixtures/experimental/class-properties/with-initializer-and-type-no-plugin/options.json new file mode 100644 index 0000000000..e185feb80a --- /dev/null +++ b/test/fixtures/experimental/class-properties/with-initializer-and-type-no-plugin/options.json @@ -0,0 +1,4 @@ +{ + "plugins": ["flow"], + "throws": "You can only use Class Properties when the 'classProperties' plugin is enabled. (2:14)" +} diff --git a/test/fixtures/experimental/class-properties/with-initializer-missing-plugin/actual.js b/test/fixtures/experimental/class-properties/with-initializer-missing-plugin/actual.js new file mode 100644 index 0000000000..fa80e3af68 --- /dev/null +++ b/test/fixtures/experimental/class-properties/with-initializer-missing-plugin/actual.js @@ -0,0 +1,3 @@ +class Foo { + bar = 'bizz'; +} diff --git a/test/fixtures/experimental/class-properties/with-initializer-missing-plugin/options.json b/test/fixtures/experimental/class-properties/with-initializer-missing-plugin/options.json new file mode 100644 index 0000000000..af38bd1530 --- /dev/null +++ b/test/fixtures/experimental/class-properties/with-initializer-missing-plugin/options.json @@ -0,0 +1,3 @@ +{ + "throws": "You can only use Class Properties when the 'classProperties' plugin is enabled. (2:2)" +} diff --git a/test/fixtures/experimental/class-properties/without-initializer-missing-plugin/actual.js b/test/fixtures/experimental/class-properties/without-initializer-missing-plugin/actual.js new file mode 100644 index 0000000000..a36cdd975c --- /dev/null +++ b/test/fixtures/experimental/class-properties/without-initializer-missing-plugin/actual.js @@ -0,0 +1,3 @@ +class Foo { + bar; +} diff --git a/test/fixtures/experimental/class-properties/without-initializer-missing-plugin/options.json b/test/fixtures/experimental/class-properties/without-initializer-missing-plugin/options.json new file mode 100644 index 0000000000..af38bd1530 --- /dev/null +++ b/test/fixtures/experimental/class-properties/without-initializer-missing-plugin/options.json @@ -0,0 +1,3 @@ +{ + "throws": "You can only use Class Properties when the 'classProperties' plugin is enabled. (2:2)" +} diff --git a/test/fixtures/flow/declare-module/8/options.json b/test/fixtures/flow/declare-module/8/options.json index ae5e7790e2..32826163f1 100644 --- a/test/fixtures/flow/declare-module/8/options.json +++ b/test/fixtures/flow/declare-module/8/options.json @@ -1,3 +1,3 @@ { - "throws": "Unexpected token. Only declares are allowed inside declare module (2:2)" + "throws": "Only declares and type imports are allowed inside declare module (2:2)" } diff --git a/test/fixtures/flow/declare-module/import/actual.js b/test/fixtures/flow/declare-module/import/actual.js new file mode 100644 index 0000000000..58b3335922 --- /dev/null +++ b/test/fixtures/flow/declare-module/import/actual.js @@ -0,0 +1 @@ +declare module "M" { import type T from "TM"; } diff --git a/test/fixtures/flow/declare-module/import/expected.json b/test/fixtures/flow/declare-module/import/expected.json new file mode 100644 index 0000000000..391e0de595 --- /dev/null +++ b/test/fixtures/flow/declare-module/import/expected.json @@ -0,0 +1,156 @@ +{ + "type": "File", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "sourceType": "module", + "body": [ + { + "type": "DeclareModule", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "id": { + "type": "StringLiteral", + "start": 15, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "extra": { + "rawValue": "M", + "raw": "\"M\"" + }, + "value": "M" + }, + "body": { + "type": "BlockStatement", + "start": 19, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "body": [ + { + "type": "ImportDeclaration", + "start": 21, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "specifiers": [ + { + "type": "ImportDefaultSpecifier", + "start": 33, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "local": { + "type": "Identifier", + "start": 33, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 34 + }, + "identifierName": "T" + }, + "name": "T" + } + } + ], + "importKind": "type", + "source": { + "type": "StringLiteral", + "start": 40, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "extra": { + "rawValue": "TM", + "raw": "\"TM\"" + }, + "value": "TM" + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/flow/declare-module/invalid-import/actual.js b/test/fixtures/flow/declare-module/invalid-import/actual.js new file mode 100644 index 0000000000..fd091d49f7 --- /dev/null +++ b/test/fixtures/flow/declare-module/invalid-import/actual.js @@ -0,0 +1 @@ +declare module "M" { import T from "TM"; } diff --git a/test/fixtures/flow/declare-module/invalid-import/options.json b/test/fixtures/flow/declare-module/invalid-import/options.json new file mode 100644 index 0000000000..c237bb99a7 --- /dev/null +++ b/test/fixtures/flow/declare-module/invalid-import/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Imports within a `declare module` body must always be `import type` or `import typeof` (1:21)" +} diff --git a/test/fixtures/flow/declare-statements/18/actual.js b/test/fixtures/flow/declare-statements/18/actual.js new file mode 100644 index 0000000000..5f074372da --- /dev/null +++ b/test/fixtures/flow/declare-statements/18/actual.js @@ -0,0 +1,2 @@ +declare class A { static () : number } +declare class B { () : number } diff --git a/test/fixtures/flow/declare-statements/18/expected.json b/test/fixtures/flow/declare-statements/18/expected.json new file mode 100644 index 0000000000..4c3d432e19 --- /dev/null +++ b/test/fixtures/flow/declare-statements/18/expected.json @@ -0,0 +1,242 @@ +{ + "type": "File", + "start": 0, + "end": 70, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 31 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 70, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 31 + } + }, + "sourceType": "module", + "body": [ + { + "type": "DeclareClass", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "id": { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + }, + "identifierName": "A" + }, + "name": "A" + }, + "typeParameters": null, + "extends": [], + "mixins": [], + "body": { + "type": "ObjectTypeAnnotation", + "start": 16, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "callProperties": [ + { + "type": "ObjectTypeCallProperty", + "start": 18, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "static": true, + "value": { + "type": "FunctionTypeAnnotation", + "start": 25, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "params": [], + "rest": null, + "typeParameters": null, + "returnType": { + "type": "NumberTypeAnnotation", + "start": 30, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 36 + } + } + } + } + } + ], + "properties": [], + "indexers": [], + "exact": false + } + }, + { + "type": "DeclareClass", + "start": 39, + "end": 70, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 31 + } + }, + "id": { + "type": "Identifier", + "start": 53, + "end": 54, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 15 + }, + "identifierName": "B" + }, + "name": "B" + }, + "typeParameters": null, + "extends": [], + "mixins": [], + "body": { + "type": "ObjectTypeAnnotation", + "start": 55, + "end": 70, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 2, + "column": 31 + } + }, + "callProperties": [ + { + "type": "ObjectTypeCallProperty", + "start": 57, + "end": 68, + "loc": { + "start": { + "line": 2, + "column": 18 + }, + "end": { + "line": 2, + "column": 29 + } + }, + "static": false, + "value": { + "type": "FunctionTypeAnnotation", + "start": 57, + "end": 68, + "loc": { + "start": { + "line": 2, + "column": 18 + }, + "end": { + "line": 2, + "column": 29 + } + }, + "params": [], + "rest": null, + "typeParameters": null, + "returnType": { + "type": "NumberTypeAnnotation", + "start": 62, + "end": 68, + "loc": { + "start": { + "line": 2, + "column": 23 + }, + "end": { + "line": 2, + "column": 29 + } + } + } + } + } + ], + "properties": [], + "indexers": [], + "exact": false + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/131/actual.js b/test/fixtures/flow/type-annotations/131/actual.js new file mode 100644 index 0000000000..4823272478 --- /dev/null +++ b/test/fixtures/flow/type-annotations/131/actual.js @@ -0,0 +1 @@ +type number = string; diff --git a/test/fixtures/flow/type-annotations/131/options.json b/test/fixtures/flow/type-annotations/131/options.json new file mode 100644 index 0000000000..bb5c8425ac --- /dev/null +++ b/test/fixtures/flow/type-annotations/131/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Cannot overwrite primitive type number (1:5)" +} diff --git a/test/fixtures/flow/type-annotations/132/actual.js b/test/fixtures/flow/type-annotations/132/actual.js new file mode 100644 index 0000000000..3935d92d3c --- /dev/null +++ b/test/fixtures/flow/type-annotations/132/actual.js @@ -0,0 +1 @@ +type foo = string; diff --git a/test/fixtures/flow/type-annotations/132/options.json b/test/fixtures/flow/type-annotations/132/options.json new file mode 100644 index 0000000000..0148048697 --- /dev/null +++ b/test/fixtures/flow/type-annotations/132/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Cannot overwrite primitive type number (1:9)" +} diff --git a/test/fixtures/flow/type-annotations/133/actual.js b/test/fixtures/flow/type-annotations/133/actual.js new file mode 100644 index 0000000000..b8fa44f01c --- /dev/null +++ b/test/fixtures/flow/type-annotations/133/actual.js @@ -0,0 +1,3 @@ +function a(x: string): string { + return x; +} diff --git a/test/fixtures/flow/type-annotations/133/options.json b/test/fixtures/flow/type-annotations/133/options.json new file mode 100644 index 0000000000..fb0222c596 --- /dev/null +++ b/test/fixtures/flow/type-annotations/133/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Cannot overwrite primitive type string (1:11)" +} diff --git a/test/fixtures/flow/type-annotations/134/actual.js b/test/fixtures/flow/type-annotations/134/actual.js new file mode 100644 index 0000000000..e8b851175e --- /dev/null +++ b/test/fixtures/flow/type-annotations/134/actual.js @@ -0,0 +1 @@ +declare type bool = any; diff --git a/test/fixtures/flow/type-annotations/134/options.json b/test/fixtures/flow/type-annotations/134/options.json new file mode 100644 index 0000000000..839b0e04ef --- /dev/null +++ b/test/fixtures/flow/type-annotations/134/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Cannot overwrite primitive type bool (1:13)" +} diff --git a/test/fixtures/flow/type-imports/invalid-import-type-shorthand-2/actual.js b/test/fixtures/flow/type-imports/invalid-import-type-shorthand-2/actual.js new file mode 100644 index 0000000000..19d143488a --- /dev/null +++ b/test/fixtures/flow/type-imports/invalid-import-type-shorthand-2/actual.js @@ -0,0 +1 @@ +import type {type t} from "foo"; diff --git a/test/fixtures/flow/type-imports/invalid-import-type-shorthand-2/options.json b/test/fixtures/flow/type-imports/invalid-import-type-shorthand-2/options.json new file mode 100644 index 0000000000..fcf8bc0a65 --- /dev/null +++ b/test/fixtures/flow/type-imports/invalid-import-type-shorthand-2/options.json @@ -0,0 +1,3 @@ +{ + "throws": "`The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements` (1:13)" +} diff --git a/test/fixtures/flow/type-imports/invalid-import-type-shorthand/actual.js b/test/fixtures/flow/type-imports/invalid-import-type-shorthand/actual.js new file mode 100644 index 0000000000..4cff04a42b --- /dev/null +++ b/test/fixtures/flow/type-imports/invalid-import-type-shorthand/actual.js @@ -0,0 +1 @@ +import typeof {typeof t} from "foo"; diff --git a/test/fixtures/flow/type-imports/invalid-import-type-shorthand/options.json b/test/fixtures/flow/type-imports/invalid-import-type-shorthand/options.json new file mode 100644 index 0000000000..d516d5fb7b --- /dev/null +++ b/test/fixtures/flow/type-imports/invalid-import-type-shorthand/options.json @@ -0,0 +1,3 @@ +{ + "throws": "`The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements` (1:15)" +} diff --git a/test/index.js b/test/index.js index 8ff7192117..93e5e2fb39 100644 --- a/test/index.js +++ b/test/index.js @@ -1,5 +1,6 @@ import path from "path"; import runFixtureTests from "./utils/runFixtureTests"; -import { parse } from "../lib"; +import { parse, parseExpression } from "../lib"; runFixtureTests(path.join(__dirname, "fixtures"), parse); +runFixtureTests(path.join(__dirname, "expressions"), parseExpression); diff --git a/test/utils/runFixtureTests.js b/test/utils/runFixtureTests.js index ee4d10b8bc..e3ea9499b7 100644 --- a/test/utils/runFixtureTests.js +++ b/test/utils/runFixtureTests.js @@ -24,7 +24,7 @@ module.exports = function runFixtureTests(fixturesPath, parseFunction) { function save(test, ast) { delete ast.tokens; - if (!ast.comments.length) delete ast.comments; + if (ast.comments && !ast.comments.length) delete ast.comments; require("fs").writeFileSync(test.expect.loc, JSON.stringify(ast, null, " ")); } diff --git a/yarn.lock b/yarn.lock index 710e46a763..dd45cf8ffc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -54,8 +54,8 @@ ansi-escapes@^1.1.0: resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e" ansi-regex@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.0.0.tgz#c5061b6e0ef8a81775e50f5d66151bf6bf371107" + version "2.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" ansi-styles@^2.2.1: version "2.2.1" @@ -72,9 +72,11 @@ anymatch@^1.3.0: arrify "^1.0.0" micromatch "^2.1.5" -append-transform@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/append-transform/-/append-transform-0.3.0.tgz#d6933ce4a85f09445d9ccc4cc119051b7381a813" +append-transform@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/append-transform/-/append-transform-0.4.0.tgz#d76ebf8ca94d276e247a36bad44a4b74ab611991" + dependencies: + default-require-extensions "^1.0.0" aproba@^1.0.3: version "1.0.4" @@ -509,14 +511,14 @@ babel-plugin-detective@^2.0.0: resolved "https://registry.yarnpkg.com/babel-plugin-detective/-/babel-plugin-detective-2.0.0.tgz#6e642e83c22a335279754ebe2d754d2635f49f13" babel-plugin-espower@^2.3.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/babel-plugin-espower/-/babel-plugin-espower-2.3.1.tgz#d15e904bc9949b14ac233b7965c2a5dc7a19a6a9" + version "2.3.2" + resolved "https://registry.yarnpkg.com/babel-plugin-espower/-/babel-plugin-espower-2.3.2.tgz#5516b8fcdb26c9f0e1d8160749f6e4c65e71271e" dependencies: babel-generator "^6.1.0" babylon "^6.1.0" call-matcher "^1.0.0" core-js "^2.0.0" - espower-location-detector "^0.1.1" + espower-location-detector "^1.0.0" espurify "^1.6.0" estraverse "^4.1.1" @@ -1548,17 +1550,13 @@ escope@^3.6.0: esrecurse "^4.1.0" estraverse "^4.1.1" -eslint-config-babel@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/eslint-config-babel/-/eslint-config-babel-4.0.1.tgz#79647e62d82aff64872e5013d6b24f8cfe9b503b" - -eslint-plugin-babel@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-babel/-/eslint-plugin-babel-4.0.0.tgz#a92114e2c493ac3034b030d7ecf96e174a76ef3f" +eslint-config-babel@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/eslint-config-babel/-/eslint-config-babel-6.0.0.tgz#66feedf6ce6e04abe585cec1a65b5bcc96bed50a" eslint-plugin-flowtype@^2.20.0: - version "2.29.2" - resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.29.2.tgz#91b4fde0400c4c37ca4440b43bdbc95fc405bea9" + version "2.30.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.30.0.tgz#3054a265f9c8afe3046c3d41b72d32a736f9b4ae" dependencies: lodash "^4.15.0" @@ -1601,9 +1599,9 @@ eslint@^3.7.1: text-table "~0.2.0" user-home "^2.0.0" -espower-location-detector@^0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/espower-location-detector/-/espower-location-detector-0.1.2.tgz#d43be738af3e0b18197eeb5c22b95512dee6b83c" +espower-location-detector@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/espower-location-detector/-/espower-location-detector-1.0.0.tgz#a17b7ecc59d30e179e2bef73fb4137704cb331b5" dependencies: is-url "^1.2.1" path-is-absolute "^1.0.0" @@ -1753,9 +1751,9 @@ flat-cache@^1.2.1: graceful-fs "^4.1.2" write "^0.2.1" -flow-bin@^0.37.0: - version "0.37.4" - resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.37.4.tgz#3d8da2ef746e80e730d166e09040f4198969b76b" +flow-bin@^0.38.0: + version "0.38.0" + resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.38.0.tgz#3ae096d401c969cc8b5798253fb82381e2d0237a" fn-name@^2.0.0: version "2.0.1" @@ -1771,7 +1769,7 @@ for-own@^0.1.4: dependencies: for-in "^0.1.5" -foreground-child@^1.5.3, foreground-child@^1.5.6: +foreground-child@^1.3.3, foreground-child@^1.5.3: version "1.5.6" resolved "https://registry.yarnpkg.com/foreground-child/-/foreground-child-1.5.6.tgz#4fd71ad2dfde96789b980a5c0a295937cb2f5ce9" dependencies: @@ -2286,17 +2284,17 @@ isstream@~0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" -istanbul-lib-coverage@^1.0.0, istanbul-lib-coverage@^1.0.0-alpha, istanbul-lib-coverage@^1.0.0-alpha.0: +istanbul-lib-coverage@^1.0.0, istanbul-lib-coverage@^1.0.0-alpha, istanbul-lib-coverage@^1.0.0-alpha.0, istanbul-lib-coverage@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-1.0.1.tgz#f263efb519c051c5f1f3343034fc40e7b43ff212" + +istanbul-lib-hook@^1.0.0: version "1.0.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-1.0.0.tgz#c3f9b6d226da12424064cce87fce0fb57fdfa7a2" - -istanbul-lib-hook@^1.0.0-alpha.4: - version "1.0.0-alpha.4" - resolved "https://registry.yarnpkg.com/istanbul-lib-hook/-/istanbul-lib-hook-1.0.0-alpha.4.tgz#8c5bb9f6fbd8526e0ae6cf639af28266906b938f" + resolved "https://registry.yarnpkg.com/istanbul-lib-hook/-/istanbul-lib-hook-1.0.0.tgz#fc5367ee27f59268e8f060b0c7aaf051d9c425c5" dependencies: - append-transform "^0.3.0" + append-transform "^0.4.0" -istanbul-lib-instrument@^1.3.0, istanbul-lib-instrument@^1.4.2: +istanbul-lib-instrument@^1.4.2: version "1.4.2" resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.4.2.tgz#0e2fdfac93c1dabf2e31578637dc78a19089f43e" dependencies: @@ -2344,6 +2342,10 @@ js-tokens@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-2.0.0.tgz#79903f5563ee778cc1162e6dcf1a0027c97f9cb5" +js-tokens@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.0.tgz#a2f2a969caae142fb3cd56228358c89366957bd1" + js-yaml@^3.5.1: version "3.7.0" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.7.0.tgz#5c967ddd837a9bfdca5f2de84253abe8a1c03b80" @@ -2475,10 +2477,10 @@ longest@^1.0.1: resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" loose-envify@^1.0.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.0.tgz#6b26248c42f6d4fa4b0d8542f78edfcde35642a8" + version "1.3.1" + resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848" dependencies: - js-tokens "^2.0.0" + js-tokens "^3.0.0" loud-rejection@^1.0.0, loud-rejection@^1.2.0: version "1.6.0" @@ -2561,15 +2563,15 @@ micromatch@^2.1.5, micromatch@^2.3.11: parse-glob "^3.0.4" regex-cache "^0.4.2" -mime-db@~1.25.0: - version "1.25.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.25.0.tgz#c18dbd7c73a5dbf6f44a024dc0d165a1e7b1c392" +mime-db@~1.26.0: + version "1.26.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.26.0.tgz#eaffcd0e4fc6935cf8134da246e2e6c35305adff" mime-types@^2.1.12, mime-types@~2.1.7: - version "2.1.13" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.13.tgz#e07aaa9c6c6b9a7ca3012c69003ad25a39e92a88" + version "2.1.14" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.14.tgz#f7ef7d97583fcaf3b7d282b6f8b5679dab1e94ee" dependencies: - mime-db "~1.25.0" + mime-db "~1.26.0" "minimatch@2 || 3", minimatch@^3.0.0, minimatch@^3.0.2: version "3.0.3" @@ -2671,8 +2673,8 @@ number-is-nan@^1.0.0: resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" nyc@^10.0.0: - version "10.0.0" - resolved "https://registry.yarnpkg.com/nyc/-/nyc-10.0.0.tgz#95bd4a2c3487f33e1e78f213c6d5a53d88074ce6" + version "10.1.2" + resolved "https://registry.yarnpkg.com/nyc/-/nyc-10.1.2.tgz#ea7acaa20a235210101604f4e7d56d28453b0274" dependencies: archy "^1.0.0" arrify "^1.0.1" @@ -2684,9 +2686,9 @@ nyc@^10.0.0: find-up "^1.1.2" foreground-child "^1.5.3" glob "^7.0.6" - istanbul-lib-coverage "^1.0.0" - istanbul-lib-hook "^1.0.0-alpha.4" - istanbul-lib-instrument "^1.3.0" + istanbul-lib-coverage "^1.0.1" + istanbul-lib-hook "^1.0.0" + istanbul-lib-instrument "^1.4.2" istanbul-lib-report "^1.0.0-alpha.3" istanbul-lib-source-maps "^1.1.0" istanbul-reports "^1.0.0" @@ -2697,9 +2699,9 @@ nyc@^10.0.0: resolve-from "^2.0.0" rimraf "^2.5.4" signal-exit "^3.0.1" - spawn-wrap "^1.2.4" + spawn-wrap "1.2.4" test-exclude "^3.3.0" - yargs "^6.4.0" + yargs "^6.6.0" yargs-parser "^4.0.2" oauth-sign@~0.8.1: @@ -2707,8 +2709,8 @@ oauth-sign@~0.8.1: resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43" object-assign@^4.0.1, object-assign@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.0.tgz#7a3b3d0e98063d43f4c03f2e8ae6cd51a86883a0" + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" object.omit@^2.0.0: version "2.0.1" @@ -3282,8 +3284,8 @@ rollup-pluginutils@^1.5.0: minimatch "^3.0.2" rollup@^0.41.0: - version "0.41.1" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-0.41.1.tgz#5be8192c196c35977551e52ec0c98c3f83280525" + version "0.41.4" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-0.41.4.tgz#a970580176329f9ead86854d7fd4c46de752aef8" dependencies: source-map-support "^0.4.0" @@ -3356,8 +3358,8 @@ sort-keys@^1.1.1: is-plain-obj "^1.0.0" source-map-support@^0.4.0, source-map-support@^0.4.2: - version "0.4.8" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.8.tgz#4871918d8a3af07289182e974e32844327b2e98b" + version "0.4.10" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.10.tgz#d7b19038040a14c0837a18e630a196453952b378" dependencies: source-map "^0.5.3" @@ -3371,11 +3373,11 @@ source-map@^0.5.0, source-map@^0.5.3, source-map@~0.5.1: version "0.5.6" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412" -spawn-wrap@^1.2.4: - version "1.3.4" - resolved "https://registry.yarnpkg.com/spawn-wrap/-/spawn-wrap-1.3.4.tgz#5d133070fef81cd26d8259acaa07fc1a86fd45dc" +spawn-wrap@1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/spawn-wrap/-/spawn-wrap-1.2.4.tgz#920eb211a769c093eebfbd5b0e7a5d2e68ab2e40" dependencies: - foreground-child "^1.5.6" + foreground-child "^1.3.3" mkdirp "^0.5.0" os-homedir "^1.0.1" rimraf "^2.3.3" @@ -3401,8 +3403,8 @@ sprintf-js@~1.0.2: resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" sshpk@^1.7.0: - version "1.10.1" - resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.10.1.tgz#30e1a5d329244974a1af61511339d595af6638b0" + version "1.10.2" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.10.2.tgz#d5a804ce22695515638e798dbe23273de070a5fa" dependencies: asn1 "~0.2.3" assert-plus "^1.0.0" @@ -3493,8 +3495,8 @@ supports-color@^2.0.0: resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" supports-color@^3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.1.2.tgz#72a262894d9d408b956ca05ff37b2ed8a6e2a2d5" + version "3.2.3" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6" dependencies: has-flag "^1.0.0" @@ -3840,7 +3842,7 @@ yargs-parser@^4.0.2, yargs-parser@^4.2.0: dependencies: camelcase "^3.0.0" -yargs@^6.4.0: +yargs@^6.6.0: version "6.6.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-6.6.0.tgz#782ec21ef403345f830a808ca3d513af56065208" dependencies: