forked from lightscript/babylon-lightscript
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add estree test for correct order of directives
- Loading branch information
Showing
2 changed files
with
153 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
"use strict"; | ||
"use loose"; | ||
var a; |
150 changes: 150 additions & 0 deletions
150
test/fixtures/estree/directives/program-order/expected.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,150 @@ | ||
{ | ||
"type": "File", | ||
"start": 0, | ||
"end": 33, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 3, | ||
"column": 6 | ||
} | ||
}, | ||
"program": { | ||
"type": "Program", | ||
"start": 0, | ||
"end": 33, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 3, | ||
"column": 6 | ||
} | ||
}, | ||
"sourceType": "script", | ||
"body": [ | ||
{ | ||
"type": "ExpressionStatement", | ||
"start": 0, | ||
"end": 13, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 13 | ||
} | ||
}, | ||
"expression": { | ||
"type": "Literal", | ||
"start": 0, | ||
"end": 12, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 12 | ||
} | ||
}, | ||
"value": "use strict", | ||
"raw": "\"use strict\"" | ||
}, | ||
"directive": "use strict" | ||
}, | ||
{ | ||
"type": "ExpressionStatement", | ||
"start": 14, | ||
"end": 26, | ||
"loc": { | ||
"start": { | ||
"line": 2, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 2, | ||
"column": 12 | ||
} | ||
}, | ||
"expression": { | ||
"type": "Literal", | ||
"start": 14, | ||
"end": 25, | ||
"loc": { | ||
"start": { | ||
"line": 2, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 2, | ||
"column": 11 | ||
} | ||
}, | ||
"value": "use loose", | ||
"raw": "\"use loose\"" | ||
}, | ||
"directive": "use loose" | ||
}, | ||
{ | ||
"type": "VariableDeclaration", | ||
"start": 27, | ||
"end": 33, | ||
"loc": { | ||
"start": { | ||
"line": 3, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 3, | ||
"column": 6 | ||
} | ||
}, | ||
"declarations": [ | ||
{ | ||
"type": "VariableDeclarator", | ||
"start": 31, | ||
"end": 32, | ||
"loc": { | ||
"start": { | ||
"line": 3, | ||
"column": 4 | ||
}, | ||
"end": { | ||
"line": 3, | ||
"column": 5 | ||
} | ||
}, | ||
"id": { | ||
"type": "Identifier", | ||
"start": 31, | ||
"end": 32, | ||
"loc": { | ||
"start": { | ||
"line": 3, | ||
"column": 4 | ||
}, | ||
"end": { | ||
"line": 3, | ||
"column": 5 | ||
}, | ||
"identifierName": "a" | ||
}, | ||
"name": "a" | ||
}, | ||
"init": null | ||
} | ||
], | ||
"kind": "var" | ||
} | ||
] | ||
} | ||
} |