diff --git a/src/Esprima/Ast/Import.cs b/src/Esprima/Ast/Import.cs index 4571e5d7..2d25cd5a 100644 --- a/src/Esprima/Ast/Import.cs +++ b/src/Esprima/Ast/Import.cs @@ -4,10 +4,17 @@ namespace Esprima.Ast { public sealed class Import : Expression { + public readonly Expression Source; + public Import() : base(Nodes.Import) { } + public Import(Expression source) : base(Nodes.Import) + { + Source = source; + } + public override NodeCollection ChildNodes => NodeCollection.Empty; protected internal override void Accept(AstVisitor visitor) diff --git a/src/Esprima/JavascriptParser.cs b/src/Esprima/JavascriptParser.cs index fd2b8869..d1f2a9f9 100644 --- a/src/Esprima/JavascriptParser.cs +++ b/src/Esprima/JavascriptParser.cs @@ -1510,8 +1510,24 @@ private bool MatchImportCall() private Import ParseImportCall() { var node = CreateNode(); - ExpectKeyword("import"); - return Finalize(node, new Import()); + ExpectKeyword("import"); + Expect("("); + + var source = this.parseAssignmentExpression(); + if (!this.Match(")") && this._config.Tolerant) + { + this.TolerateUnexpectedToken(this.NextToken()); + } + else + { + this.Expect(")"); + if (this.Match(";")) + { + this.NextToken(); + } + } + + return Finalize(node, new Import(source)); } private bool MatchImportMeta() diff --git a/src/Esprima/Utils/AstVisitor.cs b/src/Esprima/Utils/AstVisitor.cs index a5aaf6ed..6948711d 100644 --- a/src/Esprima/Utils/AstVisitor.cs +++ b/src/Esprima/Utils/AstVisitor.cs @@ -330,7 +330,8 @@ protected internal virtual void VisitExportSpecifier(ExportSpecifier exportSpeci } protected internal virtual void VisitImport(Import import) - { + { + Visit(import.Source); } protected internal virtual void VisitImportDeclaration(ImportDeclaration importDeclaration) diff --git a/test/Esprima.Tests/Fixtures/es2018/dynamic-import/await-import.tree.json b/test/Esprima.Tests/Fixtures/es2018/dynamic-import/await-import.tree.json index 282c7a91..6bef70ce 100644 --- a/test/Esprima.Tests/Fixtures/es2018/dynamic-import/await-import.tree.json +++ b/test/Esprima.Tests/Fixtures/es2018/dynamic-import/await-import.tree.json @@ -1,422 +1,148 @@ { - "type": "Program", - "body": [ - { - "type": "FunctionDeclaration", - "id": { - "type": "Identifier", - "name": "f", - "range": [ - 15, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "params": [ - { - "type": "Identifier", - "name": "x", - "range": [ - 17, - 18 - ], - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AwaitExpression", - "argument": { - "type": "CallExpression", - "callee": { - "type": "Import", - "range": [ - 28, - 34 - ], - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 34 - } - } - }, - "arguments": [ - { - "type": "Identifier", - "name": "x", - "range": [ - 35, - 36 - ], - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 36 - } - } - } - ], - "optional": false, - "range": [ - 28, - 37 - ], - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 37 - } - } - }, - "range": [ - 22, - 37 - ], - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 37 - } - } - }, - "range": [ - 22, - 38 - ], - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 38 - } - } - } - ], - "range": [ - 20, - 39 - ], - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 39 - } - } - }, - "generator": false, - "expression": false, - "async": true, - "range": [ - 0, - 39 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 39 - } - } - } - ], - "sourceType": "script", - "range": [ - 0, - 39 - ], - "loc": { - "start": { + "type": "Program", + "body": [ + { + "type": "FunctionDeclaration", + "id": { + "type": "Identifier", + "name": "f", + "range": [ + 15, + 16 + ], + "loc": { + "start": { "line": 1, - "column": 0 - }, - "end": { + "column": 15 + }, + "end": { "line": 1, - "column": 39 + "column": 16 + } } - }, - "tokens": [ - { - "type": "Identifier", - "value": "async", - "range": [ - 0, - 5 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - { - "type": "Keyword", - "value": "function", - "range": [ - 6, - 14 - ], - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - { - "type": "Identifier", - "value": "f", - "range": [ - 15, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - { - "type": "Punctuator", - "value": "(", - "range": [ - 16, - 17 - ], - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - { - "type": "Identifier", - "value": "x", - "range": [ - 17, - 18 - ], - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - { - "type": "Punctuator", - "value": ")", - "range": [ - 18, - 19 - ], - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - } - } - }, + }, + "params": [ { - "type": "Punctuator", - "value": "{", - "range": [ - 20, - 21 - ], - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - } - } - }, - { - "type": "Identifier", - "value": "await", - "range": [ - 22, - 27 - ], - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 27 - } + "type": "Identifier", + "name": "x", + "range": [ + 17, + 18 + ], + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 } - }, - { - "type": "Keyword", - "value": "import", - "range": [ - 28, - 34 - ], - "loc": { - "start": { + } + } + ], + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "AwaitExpression", + "argument": { + "type": "Import", + "range": [ + 28, + 37 + ], + "loc": { + "start": { "line": 1, "column": 28 - }, - "end": { + }, + "end": { "line": 1, - "column": 34 - } - } - }, - { - "type": "Punctuator", - "value": "(", - "range": [ - 34, - 35 - ], - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 35 - } - } - }, - { - "type": "Identifier", - "value": "x", - "range": [ - 35, - 36 - ], - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 36 + "column": 37 + } } - } - }, - { - "type": "Punctuator", - "value": ")", - "range": [ - 36, + }, + "range": [ + 22, 37 - ], - "loc": { + ], + "loc": { "start": { - "line": 1, - "column": 36 + "line": 1, + "column": 22 }, "end": { - "line": 1, - "column": 37 + "line": 1, + "column": 37 } - } - }, - { - "type": "Punctuator", - "value": "}", + } + }, "range": [ - 38, - 39 + 22, + 38 ], "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 39 - } + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 38 + } } + } + ], + "range": [ + 20, + 39 + ], + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 39 + } + } + }, + "generator": false, + "expression": false, + "async": true, + "range": [ + 0, + 39 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 } - ] + } + } + ], + "sourceType": "script", + "range": [ + 0, + 39 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + } } \ No newline at end of file diff --git a/test/Esprima.Tests/Fixtures/es2018/dynamic-import/coexist-import-call-import-declaration.module.tree.json b/test/Esprima.Tests/Fixtures/es2018/dynamic-import/coexist-import-call-import-declaration.module.tree.json index 77b07237..dc5d0f99 100644 --- a/test/Esprima.Tests/Fixtures/es2018/dynamic-import/coexist-import-call-import-declaration.module.tree.json +++ b/test/Esprima.Tests/Fixtures/es2018/dynamic-import/coexist-import-call-import-declaration.module.tree.json @@ -1,513 +1,202 @@ { - "type": "Program", - "body": [ - { - "type": "ImportDeclaration", - "specifiers": [ - { - "type": "ImportDefaultSpecifier", - "local": { - "type": "Identifier", - "name": "$", - "range": [ - 7, - 8 - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - "range": [ - 7, - 8 - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - } - } - } - ], - "source": { - "type": "Literal", - "value": "a", - "raw": "\"a\"", - "range": [ - 14, - 17 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "range": [ - 0, - 18 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "computed": false, - "object": { - "type": "CallExpression", - "callee": { - "type": "Import", - "range": [ - 19, - 25 - ], - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - } - }, - "arguments": [ - { - "type": "Literal", - "value": "b", - "raw": "\"b\"", - "range": [ - 26, - 29 - ], - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 10 - } - } - } - ], - "optional": false, - "range": [ - 19, - 30 - ], - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 11 - } - } - }, - "property": { - "type": "Identifier", - "name": "then", - "range": [ - 31, - 35 - ], - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 16 - } - } - }, - "optional": false, - "range": [ - 19, - 35 - ], - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 16 - } - } - }, - "arguments": [ - { - "type": "Identifier", - "name": "c", - "range": [ - 36, - 37 - ], - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 18 - } - } - } - ], - "optional": false, - "range": [ - 19, - 38 - ], - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 19 - } - } + "type": "Program", + "body": [ + { + "type": "ImportDeclaration", + "specifiers": [ + { + "type": "ImportDefaultSpecifier", + "local": { + "type": "Identifier", + "name": "$", + "range": [ + 7, + 8 + ], + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + } + }, + "range": [ + 7, + 8 + ], + "loc": { + "start": { + "line": 1, + "column": 7 }, - "range": [ - 19, - 39 - ], - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 20 - } + "end": { + "line": 1, + "column": 8 } + } + } + ], + "source": { + "type": "Literal", + "value": "a", + "raw": "\"a\"", + "range": [ + 14, + 17 + ], + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 17 + } } - ], - "sourceType": "module", - "range": [ + }, + "range": [ 0, - 39 - ], - "loc": { + 18 + ], + "loc": { "start": { - "line": 1, - "column": 0 + "line": 1, + "column": 0 }, "end": { - "line": 2, - "column": 20 + "line": 1, + "column": 18 } + } }, - "tokens": [ - { - "type": "Keyword", - "value": "import", - "range": [ - 0, - 6 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - { + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Import", + "range": [ + 19, + 30 + ], + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 11 + } + } + }, + "property": { "type": "Identifier", - "value": "$", - "range": [ - 7, - 8 - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - { - "type": "Identifier", - "value": "from", - "range": [ - 9, - 13 - ], - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - { - "type": "String", - "value": "\"a\"", - "range": [ - 14, - 17 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - { - "type": "Punctuator", - "value": ";", - "range": [ - 17, - 18 - ], - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - { - "type": "Keyword", - "value": "import", - "range": [ - 19, - 25 - ], - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - } - }, - { - "type": "Punctuator", - "value": "(", - "range": [ - 25, - 26 - ], - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 7 - } - } - }, - { - "type": "String", - "value": "\"b\"", - "range": [ - 26, - 29 - ], - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 10 - } - } - }, - { - "type": "Punctuator", - "value": ")", - "range": [ - 29, - 30 - ], - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - } - } - }, - { - "type": "Punctuator", - "value": ".", - "range": [ - 30, - 31 - ], - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 12 - } - } - }, - { - "type": "Identifier", - "value": "then", - "range": [ - 31, - 35 - ], - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 16 - } - } - }, - { - "type": "Punctuator", - "value": "(", - "range": [ - 35, - 36 - ], - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 17 - } + "name": "then", + "range": [ + 31, + 35 + ], + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 16 + } + } + }, + "optional": false, + "range": [ + 19, + 35 + ], + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 16 } + } }, - { + "arguments": [ + { "type": "Identifier", - "value": "c", - "range": [ - 36, - 37 - ], - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 18 - } - } - }, - { - "type": "Punctuator", - "value": ")", - "range": [ - 37, - 38 - ], - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 19 - } - } + "name": "c", + "range": [ + 36, + 37 + ], + "loc": { + "start": { + "line": 2, + "column": 17 + }, + "end": { + "line": 2, + "column": 18 + } + } + } + ], + "optional": false, + "range": [ + 19, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "range": [ + 19, + 39 + ], + "loc": { + "start": { + "line": 2, + "column": 0 }, - { - "type": "Punctuator", - "value": ";", - "range": [ - 38, - 39 - ], - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 20 - } - } + "end": { + "line": 2, + "column": 20 } - ] + } + } + ], + "sourceType": "module", + "range": [ + 0, + 39 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 20 + } + } } \ No newline at end of file diff --git a/test/Esprima.Tests/Fixtures/es2018/dynamic-import/import-call-string.tree.json b/test/Esprima.Tests/Fixtures/es2018/dynamic-import/import-call-string.tree.json index f2653fe3..2f126498 100644 --- a/test/Esprima.Tests/Fixtures/es2018/dynamic-import/import-call-string.tree.json +++ b/test/Esprima.Tests/Fixtures/es2018/dynamic-import/import-call-string.tree.json @@ -1,350 +1,129 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "computed": false, - "object": { - "type": "CallExpression", - "callee": { - "type": "Import", - "range": [ - 0, - 6 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "arguments": [ - { - "type": "Literal", - "value": "lib.js", - "raw": "'lib.js'", - "range": [ - 7, - 15 - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 15 - } - } - } - ], - "optional": false, - "range": [ - 0, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "property": { - "type": "Identifier", - "name": "then", - "range": [ - 17, - 21 - ], - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 21 - } - } - }, - "optional": false, - "range": [ - 0, - 21 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 21 - } - } - }, - "arguments": [ - { - "type": "Identifier", - "name": "doThis", - "range": [ - 22, - 28 - ], - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 28 - } - } - } - ], - "optional": false, - "range": [ - 0, - 29 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 29 - } - } - }, - "range": [ - 0, - 30 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - } - } - ], - "sourceType": "script", - "range": [ - 0, - 30 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, - "tokens": [ - { - "type": "Keyword", - "value": "import", - "range": [ - 0, - 6 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - { - "type": "Punctuator", - "value": "(", - "range": [ - 6, - 7 - ], - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - { - "type": "String", - "value": "'lib.js'", - "range": [ - 7, - 15 - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - { - "type": "Punctuator", - "value": ")", - "range": [ - 15, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - { - "type": "Punctuator", - "value": ".", + "type": "Program", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Import", "range": [ - 16, - 17 + 0, + 16 ], "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } } - }, - { + }, + "property": { "type": "Identifier", - "value": "then", + "name": "then", "range": [ - 17, - 21 + 17, + 21 ], "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 21 - } + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 21 + } } - }, - { - "type": "Punctuator", - "value": "(", - "range": [ - 21, - 22 - ], - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - } + }, + "optional": false, + "range": [ + 0, + 21 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 } + } }, - { + "arguments": [ + { "type": "Identifier", - "value": "doThis", - "range": [ - 22, - 28 - ], - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 28 - } - } - }, - { - "type": "Punctuator", - "value": ")", + "name": "doThis", "range": [ - 28, - 29 + 22, + 28 ], "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 29 - } + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 28 + } } + } + ], + "optional": false, + "range": [ + 0, + 29 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + } + }, + "range": [ + 0, + 30 + ], + "loc": { + "start": { + "line": 1, + "column": 0 }, - { - "type": "Punctuator", - "value": ";", - "range": [ - 29, - 30 - ], - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 30 - } - } + "end": { + "line": 1, + "column": 30 } - ] + } + } + ], + "sourceType": "script", + "range": [ + 0, + 30 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + } } \ No newline at end of file diff --git a/test/Esprima.Tests/Fixtures/es2018/dynamic-import/import-call-template.tree.json b/test/Esprima.Tests/Fixtures/es2018/dynamic-import/import-call-template.tree.json index 8b31c628..979408b4 100644 --- a/test/Esprima.Tests/Fixtures/es2018/dynamic-import/import-call-template.tree.json +++ b/test/Esprima.Tests/Fixtures/es2018/dynamic-import/import-call-template.tree.json @@ -1,450 +1,129 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "computed": false, - "object": { - "type": "CallExpression", - "callee": { - "type": "Import", - "range": [ - 0, - 6 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "arguments": [ - { - "type": "TemplateLiteral", - "quasis": [ - { - "type": "TemplateElement", - "value": { - "raw": "lib/", - "cooked": "lib/" - }, - "tail": false, - "range": [ - 7, - 14 - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - { - "type": "TemplateElement", - "value": { - "raw": ".js", - "cooked": ".js" - }, - "tail": true, - "range": [ - 19, - 24 - ], - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 24 - } - } - } - ], - "expressions": [ - { - "type": "Identifier", - "name": "fname", - "range": [ - 14, - 19 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 19 - } - } - } - ], - "range": [ - 7, - 24 - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 24 - } - } - } - ], - "optional": false, - "range": [ - 0, - 25 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - } - }, - "property": { - "type": "Identifier", - "name": "then", - "range": [ - 26, - 30 - ], - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 30 - } - } - }, - "optional": false, - "range": [ - 0, - 30 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - } - }, - "arguments": [ - { - "type": "Identifier", - "name": "doSomething", - "range": [ - 31, - 42 - ], - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 42 - } - } - } - ], - "optional": false, - "range": [ - 0, - 43 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - } - }, - "range": [ - 0, - 44 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - } - } - ], - "sourceType": "script", - "range": [ - 0, - 44 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, - "tokens": [ - { - "type": "Keyword", - "value": "import", - "range": [ - 0, - 6 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - { - "type": "Punctuator", - "value": "(", + "type": "Program", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Import", "range": [ - 6, - 7 + 0, + 25 ], "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } } - }, - { - "type": "Template", - "value": "`lib/${", - "range": [ - 7, - 14 - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - { + }, + "property": { "type": "Identifier", - "value": "fname", + "name": "then", "range": [ - 14, - 19 + 26, + 30 ], "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 19 - } + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 30 + } } - }, - { - "type": "Template", - "value": "}.js`", - "range": [ - 19, - 24 - ], - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 24 - } - } - }, - { - "type": "Punctuator", - "value": ")", - "range": [ - 24, - 25 - ], - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 25 - } - } - }, - { - "type": "Punctuator", - "value": ".", - "range": [ - 25, - 26 - ], - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 26 - } - } - }, - { - "type": "Identifier", - "value": "then", - "range": [ - 26, - 30 - ], - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 30 - } - } - }, - { - "type": "Punctuator", - "value": "(", - "range": [ - 30, - 31 - ], - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 31 - } + }, + "optional": false, + "range": [ + 0, + 30 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 } + } }, - { + "arguments": [ + { "type": "Identifier", - "value": "doSomething", + "name": "doSomething", "range": [ - 31, - 42 + 31, + 42 ], "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 42 - } - } - }, - { - "type": "Punctuator", - "value": ")", - "range": [ - 42, - 43 - ], - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 43 - } + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 42 + } } + } + ], + "optional": false, + "range": [ + 0, + 43 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 43 + } + } + }, + "range": [ + 0, + 44 + ], + "loc": { + "start": { + "line": 1, + "column": 0 }, - { - "type": "Punctuator", - "value": ";", - "range": [ - 43, - 44 - ], - "loc": { - "start": { - "line": 1, - "column": 43 - }, - "end": { - "line": 1, - "column": 44 - } - } + "end": { + "line": 1, + "column": 44 } - ] + } + } + ], + "sourceType": "script", + "range": [ + 0, + 44 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 44 + } + } } \ No newline at end of file diff --git a/test/Esprima.Tests/Fixtures/es2018/dynamic-import/import-call-var.tree.json b/test/Esprima.Tests/Fixtures/es2018/dynamic-import/import-call-var.tree.json index b7e024bd..2cd66e0b 100644 --- a/test/Esprima.Tests/Fixtures/es2018/dynamic-import/import-call-var.tree.json +++ b/test/Esprima.Tests/Fixtures/es2018/dynamic-import/import-call-var.tree.json @@ -1,607 +1,225 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "m", - "range": [ - 6, - 7 - ], - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "init": { - "type": "Literal", - "value": "library.js", - "raw": "'library.js'", - "range": [ - 10, - 22 - ], - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "range": [ - 6, - 22 - ], - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 22 - } - } - } - ], - "kind": "const", - "range": [ - 0, - 23 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "computed": false, - "object": { - "type": "CallExpression", - "callee": { - "type": "Import", - "range": [ - 24, - 30 - ], - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - } - }, - "arguments": [ - { - "type": "Identifier", - "name": "m", - "range": [ - 31, - 32 - ], - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 8 - } - } - } - ], - "optional": false, - "range": [ - 24, - 33 - ], - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 9 - } - } - }, - "property": { - "type": "Identifier", - "name": "then", - "range": [ - 34, - 38 - ], - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 14 - } - } - }, - "optional": false, - "range": [ - 24, - 38 - ], - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - } - }, - "arguments": [ - { - "type": "ArrowFunctionExpression", - "id": null, - "params": [], - "body": { - "type": "BlockStatement", - "body": [], - "range": [ - 45, - 47 - ], - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 23 - } - } - }, - "generator": false, - "expression": false, - "async": false, - "range": [ - 39, - 47 - ], - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 23 - } - } - } - ], - "optional": false, - "range": [ - 24, - 48 - ], - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 24 - } - } + "type": "Program", + "body": [ + { + "type": "VariableDeclaration", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "m", + "range": [ + 6, + 7 + ], + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + } + }, + "init": { + "type": "Literal", + "value": "library.js", + "raw": "'library.js'", + "range": [ + 10, + 22 + ], + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 22 + } + } + }, + "range": [ + 6, + 22 + ], + "loc": { + "start": { + "line": 1, + "column": 6 }, - "range": [ - 24, - 49 - ], - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 25 - } + "end": { + "line": 1, + "column": 22 } + } } - ], - "sourceType": "script", - "range": [ + ], + "kind": "const", + "range": [ 0, - 49 - ], - "loc": { + 23 + ], + "loc": { "start": { - "line": 1, - "column": 0 + "line": 1, + "column": 0 }, "end": { - "line": 2, - "column": 25 + "line": 1, + "column": 23 } + } }, - "tokens": [ - { - "type": "Keyword", - "value": "const", - "range": [ - 0, - 5 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - { - "type": "Identifier", - "value": "m", - "range": [ - 6, - 7 - ], - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - { - "type": "Punctuator", - "value": "=", - "range": [ - 8, - 9 - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - { - "type": "String", - "value": "'library.js'", - "range": [ - 10, - 22 - ], - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - { - "type": "Punctuator", - "value": ";", - "range": [ - 22, - 23 - ], - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - } - } - }, - { - "type": "Keyword", - "value": "import", - "range": [ - 24, - 30 - ], - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - } - }, - { - "type": "Punctuator", - "value": "(", - "range": [ - 30, - 31 - ], - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 7 - } - } - }, - { - "type": "Identifier", - "value": "m", - "range": [ - 31, - 32 - ], - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 8 - } - } - }, - { - "type": "Punctuator", - "value": ")", - "range": [ - 32, - 33 - ], - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 9 - } - } - }, - { - "type": "Punctuator", - "value": ".", - "range": [ - 33, - 34 - ], - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - } - } - }, - { + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Import", + "range": [ + 24, + 33 + ], + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 9 + } + } + }, + "property": { "type": "Identifier", - "value": "then", - "range": [ - 34, - 38 - ], - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 14 - } - } - }, - { - "type": "Punctuator", - "value": "(", - "range": [ - 38, - 39 - ], - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 15 - } - } - }, - { - "type": "Punctuator", - "value": "(", - "range": [ - 39, - 40 - ], - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 16 - } - } - }, - { - "type": "Punctuator", - "value": ")", - "range": [ - 40, - 41 - ], - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 17 - } - } - }, - { - "type": "Punctuator", - "value": "=>", - "range": [ - 42, - 44 - ], - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 20 - } - } - }, - { - "type": "Punctuator", - "value": "{", - "range": [ + "name": "then", + "range": [ + 34, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 14 + } + } + }, + "optional": false, + "range": [ + 24, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 14 + } + } + }, + "arguments": [ + { + "type": "ArrowFunctionExpression", + "id": null, + "params": [], + "body": { + "type": "BlockStatement", + "body": [], + "range": [ 45, - 46 - ], - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 22 - } - } - }, - { - "type": "Punctuator", - "value": "}", - "range": [ - 46, 47 - ], - "loc": { + ], + "loc": { "start": { - "line": 2, - "column": 22 + "line": 2, + "column": 21 }, "end": { - "line": 2, - "column": 23 + "line": 2, + "column": 23 } - } - }, - { - "type": "Punctuator", - "value": ")", - "range": [ - 47, - 48 - ], - "loc": { - "start": { - "line": 2, - "column": 23 - }, - "end": { - "line": 2, - "column": 24 - } - } + } + }, + "generator": false, + "expression": false, + "async": false, + "range": [ + 39, + 47 + ], + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 23 + } + } + } + ], + "optional": false, + "range": [ + 24, + 48 + ], + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 24 + } + } + }, + "range": [ + 24, + 49 + ], + "loc": { + "start": { + "line": 2, + "column": 0 }, - { - "type": "Punctuator", - "value": ";", - "range": [ - 48, - 49 - ], - "loc": { - "start": { - "line": 2, - "column": 24 - }, - "end": { - "line": 2, - "column": 25 - } - } + "end": { + "line": 2, + "column": 25 } - ] + } + } + ], + "sourceType": "script", + "range": [ + 0, + 49 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 25 + } + } } \ No newline at end of file diff --git a/test/Esprima.Tests/Fixtures/es2018/dynamic-import/loader-using-import.tree.json b/test/Esprima.Tests/Fixtures/es2018/dynamic-import/loader-using-import.tree.json index eb7d45a8..38c92383 100644 --- a/test/Esprima.Tests/Fixtures/es2018/dynamic-import/loader-using-import.tree.json +++ b/test/Esprima.Tests/Fixtures/es2018/dynamic-import/loader-using-import.tree.json @@ -1,460 +1,131 @@ { - "type": "Program", - "body": [ - { - "type": "FunctionDeclaration", - "id": { - "type": "Identifier", - "name": "load", - "range": [ - 9, - 13 - ], - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "params": [ - { - "type": "Identifier", - "name": "f", - "range": [ - 14, - 15 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ReturnStatement", - "argument": { - "type": "CallExpression", - "callee": { - "type": "Import", - "range": [ - 26, - 32 - ], - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 32 - } - } - }, - "arguments": [ - { - "type": "BinaryExpression", - "operator": "+", - "left": { - "type": "Literal", - "value": "lib/", - "raw": "'lib/'", - "range": [ - 33, - 39 - ], - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 39 - } - } - }, - "right": { - "type": "Identifier", - "name": "f", - "range": [ - 42, - 43 - ], - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 43 - } - } - }, - "range": [ - 33, - 43 - ], - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 43 - } - } - } - ], - "optional": false, - "range": [ - 26, - 44 - ], - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 44 - } - } - }, - "range": [ - 19, - 45 - ], - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 45 - } - } - } - ], - "range": [ - 17, - 46 - ], - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 46 - } - } - }, - "generator": false, - "expression": false, - "async": false, - "range": [ - 0, - 46 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 46 - } - } - } - ], - "sourceType": "script", - "range": [ - 0, - 46 - ], - "loc": { - "start": { + "type": "Program", + "body": [ + { + "type": "FunctionDeclaration", + "id": { + "type": "Identifier", + "name": "load", + "range": [ + 9, + 13 + ], + "loc": { + "start": { "line": 1, - "column": 0 - }, - "end": { + "column": 9 + }, + "end": { "line": 1, - "column": 46 + "column": 13 + } } - }, - "tokens": [ - { - "type": "Keyword", - "value": "function", - "range": [ - 0, - 8 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - { - "type": "Identifier", - "value": "load", - "range": [ - 9, - 13 - ], - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - { - "type": "Punctuator", - "value": "(", - "range": [ - 13, - 14 - ], - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - { - "type": "Identifier", - "value": "f", - "range": [ - 14, - 15 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - { - "type": "Punctuator", - "value": ")", - "range": [ - 15, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - { - "type": "Punctuator", - "value": "{", - "range": [ - 17, - 18 - ], - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, + }, + "params": [ { - "type": "Keyword", - "value": "return", - "range": [ - 19, - 25 - ], - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 25 - } + "type": "Identifier", + "name": "f", + "range": [ + 14, + 15 + ], + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 } - }, - { - "type": "Keyword", - "value": "import", - "range": [ + } + } + ], + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "ReturnStatement", + "argument": { + "type": "Import", + "range": [ 26, - 32 - ], - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 32 - } - } - }, - { - "type": "Punctuator", - "value": "(", - "range": [ - 32, - 33 - ], - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 33 - } - } - }, - { - "type": "String", - "value": "'lib/'", - "range": [ - 33, - 39 - ], - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 39 - } - } - }, - { - "type": "Punctuator", - "value": "+", - "range": [ - 40, - 41 - ], - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 41 - } - } - }, - { - "type": "Identifier", - "value": "f", - "range": [ - 42, - 43 - ], - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 43 - } - } - }, - { - "type": "Punctuator", - "value": ")", - "range": [ - 43, 44 - ], - "loc": { + ], + "loc": { "start": { - "line": 1, - "column": 43 + "line": 1, + "column": 26 }, "end": { - "line": 1, - "column": 44 + "line": 1, + "column": 44 } - } - }, - { - "type": "Punctuator", - "value": "}", + } + }, "range": [ - 45, - 46 + 19, + 45 ], "loc": { - "start": { - "line": 1, - "column": 45 - }, - "end": { - "line": 1, - "column": 46 - } + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 45 + } } + } + ], + "range": [ + 17, + 46 + ], + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 46 + } + } + }, + "generator": false, + "expression": false, + "async": false, + "range": [ + 0, + 46 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 46 } - ] + } + } + ], + "sourceType": "script", + "range": [ + 0, + 46 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 46 + } + } } \ No newline at end of file