-
Notifications
You must be signed in to change notification settings - Fork 470
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add JSON ⊂ ECMAScript tests #1543
Closed
The head ref may contain hidden characters: "json-\u2282-ecmascript"
+28
−12
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
This file was deleted.
Oops, something went wrong.
12 changes: 12 additions & 0 deletions
12
test/language/line-terminators/line-separator-string-literal.js
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,12 @@ | ||
// Copyright 2018 Mathias Bynens. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
esid: sec-literals-string-literals | ||
description: > | ||
LINE SEPARATOR (U+2028) is allowed within string literals. | ||
features: [json-superset] | ||
---*/ | ||
|
||
eval("'foo\u2028bar\u2028baz\u2028qux'"); | ||
'foo bar baz qux'; |
12 changes: 12 additions & 0 deletions
12
test/language/line-terminators/paragraph-separator-string-literal.js
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,12 @@ | ||
// Copyright 2018 Mathias Bynens. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
esid: sec-literals-string-literals | ||
description: > | ||
PARAGRAPH SEPARATOR (U+2029) is allowed within string literals. | ||
features: [json-superset] | ||
---*/ | ||
|
||
eval("'foo\u2029bar\u2029baz\u2029qux'"); | ||
'foo bar baz qux'; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should go a bit beyond here. We don't need eval for these new tests, that's only legacy we don't need to import from the removed file.
At the same time, it's also a good opportunity to duplicate these tests with the literal cases using unescaped and escaped forms in each test file. I can work in a follow up if it's such a burn to add more here, let me know and I'd be glad to help.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used
eval
to avoid having to put the raw U+2028 and U+2029 characters in the source code, which is hard to review and would be easy to accidentally break in the future. This approach seemed more maintainable.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eval
is annoying because it makes these tests not really consumable by parsers and other consumers which don't implementeval
. (See #1356 etc.) I think it's worth having the literal character in the source.