Skip to content

Commit

Permalink
test: add missing test case for err 17013
Browse files Browse the repository at this point in the history
  • Loading branch information
bradzacher committed Dec 19, 2019
1 parent 1676146 commit e732a12
Show file tree
Hide file tree
Showing 4 changed files with 501 additions and 0 deletions.
156 changes: 156 additions & 0 deletions packages/parser/tests/lib/__snapshots__/typescript.ts.snap
Expand Up @@ -21170,6 +21170,162 @@ Object {
}
`;

exports[`typescript fixtures/basics/new-target-in-arrow-function-body.src 1`] = `
Object {
"$id": 4,
"block": Object {
"range": Array [
0,
28,
],
"type": "Program",
},
"childScopes": Array [
Object {
"$id": 3,
"block": Object {
"range": Array [
0,
28,
],
"type": "Program",
},
"childScopes": Array [
Object {
"$id": 2,
"block": Object {
"range": Array [
10,
26,
],
"type": "ArrowFunctionExpression",
},
"childScopes": Array [],
"functionExpressionScope": false,
"isStrict": true,
"references": Array [],
"throughReferences": Array [],
"type": "function",
"upperScope": Object {
"$ref": 3,
},
"variableMap": Object {},
"variableScope": Object {
"$ref": 2,
},
"variables": Array [],
},
],
"functionExpressionScope": false,
"isStrict": true,
"references": Array [
Object {
"$id": 1,
"from": Object {
"$ref": 3,
},
"identifier": Object {
"name": "b",
"range": Array [
6,
7,
],
"type": "Identifier",
},
"kind": "w",
"resolved": Object {
"$ref": 0,
},
"writeExpr": Object {
"range": Array [
10,
26,
],
"type": "ArrowFunctionExpression",
},
},
],
"throughReferences": Array [],
"type": "module",
"upperScope": Object {
"$ref": 4,
},
"variableMap": Object {
"b": Object {
"$ref": 0,
},
},
"variableScope": Object {
"$ref": 3,
},
"variables": Array [
Object {
"$id": 0,
"defs": Array [
Object {
"name": Object {
"name": "b",
"range": Array [
6,
7,
],
"type": "Identifier",
},
"node": Object {
"range": Array [
6,
26,
],
"type": "VariableDeclarator",
},
"parent": Object {
"range": Array [
0,
27,
],
"type": "VariableDeclaration",
},
"type": "Variable",
},
],
"eslintUsed": undefined,
"identifiers": Array [
Object {
"name": "b",
"range": Array [
6,
7,
],
"type": "Identifier",
},
],
"name": "b",
"references": Array [
Object {
"$ref": 1,
},
],
"scope": Object {
"$ref": 3,
},
},
],
},
],
"functionExpressionScope": false,
"isStrict": false,
"references": Array [],
"throughReferences": Array [],
"type": "global",
"upperScope": null,
"variableMap": Object {},
"variableScope": Object {
"$ref": 4,
},
"variables": Array [],
}
`;

exports[`typescript fixtures/basics/non-null-assertion-operator.src 1`] = `
Object {
"$id": 10,
Expand Down
@@ -0,0 +1 @@
const b = () => new.target;
Expand Up @@ -1928,6 +1928,15 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" e

exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/never-type-param.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`;

exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/new-target-in-arrow-function-body.src 1`] = `
Object {
"column": 16,
"index": 16,
"lineNumber": 1,
"message": "Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor.",
}
`;

exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/non-null-assertion-operator.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`;

exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/null-and-undefined-type-annotations.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`;
Expand Down

0 comments on commit e732a12

Please sign in to comment.