From fe3cd4a410582b75e99387348ec48b71fc220b1e Mon Sep 17 00:00:00 2001 From: Ger Hobbelt Date: Fri, 13 Oct 2017 17:53:36 +0200 Subject: [PATCH] correct spec file for commit SHA-1: 2617445bc30cefe39e945b53d4e95301fea4c657 :: fix #1829, returnstatement with multiline template literal string --- .../statement/return/migrated_0004.tree.json | 360 ++++++++++++++++-- 1 file changed, 318 insertions(+), 42 deletions(-) diff --git a/test/fixtures/statement/return/migrated_0004.tree.json b/test/fixtures/statement/return/migrated_0004.tree.json index 40f6b767e..7ad01460d 100644 --- a/test/fixtures/statement/return/migrated_0004.tree.json +++ b/test/fixtures/statement/return/migrated_0004.tree.json @@ -1,43 +1,319 @@ -{ - "type": "Program", - "body": [ { - "type": "FunctionDeclaration", - "id": { - "type": "Identifier", - "name": "a" - }, - "params": [], - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ReturnStatement", - "argument": null - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "TemplateLiteral", - "quasis": [ - { - "type": "TemplateElement", - "value": { - "raw": "s\n test\n ", - "cooked": "s\n test\n " - }, - "tail": true - } - ], - "expressions": [] - } - } - ] - }, - "generator": false, - "expression": false, - "async": false - } - ], - "sourceType": "script" -} \ No newline at end of file + "range": [ + 0, + 41 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "type": "Program", + "body": [ + { + "range": [ + 0, + 41 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "type": "FunctionDeclaration", + "id": { + "range": [ + 9, + 10 + ], + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "type": "Identifier", + "name": "a" + }, + "params": [], + "body": { + "range": [ + 13, + 41 + ], + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "type": "BlockStatement", + "body": [ + { + "range": [ + 17, + 23 + ], + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "type": "ReturnStatement", + "argument": null + }, + { + "range": [ + 24, + 39 + ], + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 4, + "column": 4 + } + }, + "type": "ExpressionStatement", + "expression": { + "range": [ + 24, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "type": "TemplateLiteral", + "quasis": [ + { + "range": [ + 24, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "type": "TemplateElement", + "value": { + "raw": "\n test\n ", + "cooked": "\n test\n " + }, + "tail": true + } + ], + "expressions": [] + } + } + ] + }, + "generator": false, + "expression": false, + "async": false + } + ], + "sourceType": "script", + "tokens": [ + { + "range": [ + 0, + 8 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "type": "Keyword", + "value": "function" + }, + { + "range": [ + 9, + 10 + ], + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "type": "Identifier", + "value": "a" + }, + { + "range": [ + 10, + 11 + ], + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "type": "Punctuator", + "value": "(" + }, + { + "range": [ + 11, + 12 + ], + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "type": "Punctuator", + "value": ")" + }, + { + "range": [ + 13, + 14 + ], + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "type": "Punctuator", + "value": "{" + }, + { + "range": [ + 17, + 23 + ], + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "type": "Keyword", + "value": "return" + }, + { + "range": [ + 24, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "type": "Template", + "value": "`\n test\n `" + }, + { + "range": [ + 38, + 39 + ], + "loc": { + "start": { + "line": 4, + "column": 3 + }, + "end": { + "line": 4, + "column": 4 + } + }, + "type": "Punctuator", + "value": ";" + }, + { + "range": [ + 40, + 41 + ], + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "type": "Punctuator", + "value": "}" + } + ] +}