diff --git a/tests/fixtures/ecma-version/6/edge-cases/var-let-declaration.result.js b/tests/fixtures/ecma-version/6/edge-cases/var-let-declaration.result.js new file mode 100644 index 00000000..3ac63833 --- /dev/null +++ b/tests/fixtures/ecma-version/6/edge-cases/var-let-declaration.result.js @@ -0,0 +1,185 @@ +module.exports = { + "type": "Program", + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 0, + 12 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 0, + 12 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 4, + 11 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 4, + 7 + ], + "name": "let" + }, + "init": { + "type": "Identifier", + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 10, + 11 + ], + "name": "a" + } + } + ], + "kind": "var" + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "range": [ + 0, + 3 + ] + }, + { + "type": "Keyword", + "value": "let", + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 4, + 7 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 8, + 9 + ] + }, + { + "type": "Identifier", + "value": "a", + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 10, + 11 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 11, + 12 + ] + } + ] +}; diff --git a/tests/fixtures/ecma-version/6/edge-cases/var-let-declaration.src.js b/tests/fixtures/ecma-version/6/edge-cases/var-let-declaration.src.js new file mode 100644 index 00000000..db1a63c4 --- /dev/null +++ b/tests/fixtures/ecma-version/6/edge-cases/var-let-declaration.src.js @@ -0,0 +1 @@ +var let = a; diff --git a/tests/fixtures/ecma-version/6/edge-cases/var-let-object.result.js b/tests/fixtures/ecma-version/6/edge-cases/var-let-object.result.js new file mode 100644 index 00000000..8406445d --- /dev/null +++ b/tests/fixtures/ecma-version/6/edge-cases/var-let-object.result.js @@ -0,0 +1,291 @@ +module.exports = { + "type": "Program", + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 0, + 13 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 0, + 13 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 1, + 11 + ], + "operator": "=", + "left": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 1, + 7 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 1, + 4 + ], + "name": "let" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "range": [ + 5, + 6 + ], + "name": "a" + }, + "computed": true + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 10, + 11 + ], + "name": "b" + } + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "range": [ + 0, + 1 + ] + }, + { + "type": "Keyword", + "value": "let", + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 1, + 4 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "range": [ + 4, + 5 + ] + }, + { + "type": "Identifier", + "value": "a", + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "range": [ + 5, + 6 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 6, + 7 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 8, + 9 + ] + }, + { + "type": "Identifier", + "value": "b", + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 10, + 11 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 11, + 12 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 12, + 13 + ] + } + ] +}; diff --git a/tests/fixtures/ecma-version/6/edge-cases/var-let-object.src.js b/tests/fixtures/ecma-version/6/edge-cases/var-let-object.src.js new file mode 100644 index 00000000..9fb08381 --- /dev/null +++ b/tests/fixtures/ecma-version/6/edge-cases/var-let-object.src.js @@ -0,0 +1 @@ +(let[a] = b); diff --git a/tests/lib/ecma-version.js b/tests/lib/ecma-version.js index d66cecc4..1e30468e 100644 --- a/tests/lib/ecma-version.js +++ b/tests/lib/ecma-version.js @@ -53,7 +53,7 @@ var scriptOnlyTestFiles = allTestFiles.filter(function(filename) { }); var moduleTestFiles = allTestFiles.filter(function(filename) { - return filename.indexOf("not-strict") === -1; + return filename.indexOf("not-strict") === -1 && filename.indexOf("edge-cases") === -1; }); //------------------------------------------------------------------------------