-
Notifications
You must be signed in to change notification settings - Fork 466
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
Various test cases for cross-browser compliance bugs #1532
Conversation
It’d be helpful for es6-shim for the API cases if you could comment somehow (in the PR is fine) which engines/browsers fail these tests. |
Versions: Array/prototype/{filter,map,slice,splice}/target-array-with-non-writable-property.js -> JSC, Chakra SpiderMonkey issues (only the ones I still remember): |
|
||
a.constructor[Symbol.species] = function(len) { | ||
return new Proxy(new Array(len), new Proxy({}, { | ||
get(t, pk, r) { |
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.
wow!!! this is great!
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.
Whoa.
assert.sameValue(f(), 1); | ||
} | ||
|
||
g(); |
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.
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.
The new test case has an extra block-statement, which is not present in the linked one. And the linked test succeeds in SM/V8/JSC/Chakra, whereas the new test case only succeeds in V8.
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.
Excellent, thanks for the clarification
var f; | ||
} | ||
} | ||
} |
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.
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.
Also an extra block-statement which makes it different from the existing one. (The existing test case passes in V8/SM and fails in JSC/Chakra, the new one only passes in SM.)
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.
👍
|
||
throw "Test262: This statement should not be evaluated."; | ||
|
||
async(a = await => {}) => {}; |
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.
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.
The new test case passes only in Chakra and SM, whereas the existing one passes in all four engines. (The new test case tries to ensure arrow functions with await
as the arrow-parameter are correctly handled in async arrow function parameters.)
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.
👍
|
||
throw "Test262: This statement should not be evaluated."; | ||
|
||
async() => { (a = await/r/g) => {} }; |
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.
👍
|
||
throw "Test262: This statement should not be evaluated."; | ||
|
||
async(a = (await) => {}) => {}; |
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.
👍
|
||
throw "Test262: This statement should not be evaluated."; | ||
|
||
async(a = (...await) => {}) => {}; |
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.
👍
are to appear in a script exactly as written. All terminal symbol code points | ||
specified in this way are to be understood as the appropriate Unicode code points | ||
from the Basic Latin range, as opposed to any similar-looking code points from | ||
other Unicode ranges. |
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 description and info aren't correct for this test.
Given:
async
[no LineTerminator here] AsyncArrowBindingIdentifier
The comment in the actual test source is good:
Throws ReferenceError because reference for "async" cannot be resolved.
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.
Hmm, maybe we should cite both sections? 14.7 for the overall grammar of async arrow functions and 5.1.5 to make clear that \u0061sync
shouldn't actually be considered as an async arrow function in the first place.
|
||
It is a Syntax Error if this phrase is contained in strict mode code and the | ||
StringValue of IdentifierName is: "implements", "interface", "let", "package", | ||
"private", "protected", "public", "static", or "yield". |
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'd like to add this section: https://tc39.github.io/ecma262/#sec-strict-mode-code, but you don't have to do it if it's a pain (I don't mind doing it in a follow up)
info: | | ||
12.1.1 Static Semantics: Early Errors | ||
|
||
IdentifierReference : yield |
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.
?
info: | | ||
12.1.1 Static Semantics: Early Errors | ||
|
||
IdentifierReference : yield |
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.
?
LGTM, waiting for @rwaldron to confirm the changes after his review. |
I've folded the updates in original patch, because it only updated yaml code. Complete diff.diff --git a/test/language/expressions/async-arrow-function/escaped-async-line-terminator.js b/test/language/expressions/async-arrow-function/escaped-async-line-terminator.js
index 0182fac..ee3a7a0 100644
--- a/test/language/expressions/async-arrow-function/escaped-async-line-terminator.js
+++ b/test/language/expressions/async-arrow-function/escaped-async-line-terminator.js
@@ -2,10 +2,16 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
-esid: sec-grammar-notation
+esid: sec-async-arrow-function-definitions
description: >
- The `async` contextual keyword must not contain Unicode escape sequences.
+ Escaped "async" followed by a line-terminator is not misinterpreted as an AsyncArrowFunction.
info: |
+ 14.7 Async Function Definitions
+
+ async [no LineTerminator here] AsyncArrowBindingIdentifier[?Yield] [no LineTerminator here] => AsyncConciseBody[?In]
+
+ 5.1.5 Grammar Notation
+
Terminal symbols of the lexical, RegExp, and numeric string grammars are shown
in fixed width font, both in the productions of the grammars and throughout this
specification whenever the text directly refers to such a terminal symbol. These
diff --git a/test/language/expressions/class/class-name-ident-let-escaped.js b/test/language/expressions/class/class-name-ident-let-escaped.js
index 42faf32..e9beb52 100644
--- a/test/language/expressions/class/class-name-ident-let-escaped.js
+++ b/test/language/expressions/class/class-name-ident-let-escaped.js
@@ -13,6 +13,10 @@ info: |
It is a Syntax Error if this phrase is contained in strict mode code and the
StringValue of IdentifierName is: "implements", "interface", "let", "package",
"private", "protected", "public", "static", or "yield".
+
+ 10.2.1 Strict Mode Code
+
+ All parts of a ClassDeclaration or a ClassExpression are strict mode code.
negative:
phase: parse
type: SyntaxError
diff --git a/test/language/expressions/class/class-name-ident-let.js b/test/language/expressions/class/class-name-ident-let.js
index 2224fa3..d08620f 100644
--- a/test/language/expressions/class/class-name-ident-let.js
+++ b/test/language/expressions/class/class-name-ident-let.js
@@ -13,6 +13,10 @@ info: |
It is a Syntax Error if this phrase is contained in strict mode code and the
StringValue of IdentifierName is: "implements", "interface", "let", "package",
"private", "protected", "public", "static", or "yield".
+
+ 10.2.1 Strict Mode Code
+
+ All parts of a ClassDeclaration or a ClassExpression are strict mode code.
negative:
phase: parse
type: SyntaxError
diff --git a/test/language/expressions/class/class-name-ident-static-escaped.js b/test/language/expressions/class/class-name-ident-static-escaped.js
index fb519a1..8680e69 100644
--- a/test/language/expressions/class/class-name-ident-static-escaped.js
+++ b/test/language/expressions/class/class-name-ident-static-escaped.js
@@ -13,6 +13,10 @@ info: |
It is a Syntax Error if this phrase is contained in strict mode code and the
StringValue of IdentifierName is: "implements", "interface", "let", "package",
"private", "protected", "public", "static", or "yield".
+
+ 10.2.1 Strict Mode Code
+
+ All parts of a ClassDeclaration or a ClassExpression are strict mode code.
negative:
phase: parse
type: SyntaxError
diff --git a/test/language/expressions/class/class-name-ident-static.js b/test/language/expressions/class/class-name-ident-static.js
index 1b8c23f..a914e59 100644
--- a/test/language/expressions/class/class-name-ident-static.js
+++ b/test/language/expressions/class/class-name-ident-static.js
@@ -13,6 +13,10 @@ info: |
It is a Syntax Error if this phrase is contained in strict mode code and the
StringValue of IdentifierName is: "implements", "interface", "let", "package",
"private", "protected", "public", "static", or "yield".
+
+ 10.2.1 Strict Mode Code
+
+ All parts of a ClassDeclaration or a ClassExpression are strict mode code.
negative:
phase: parse
type: SyntaxError
diff --git a/test/language/expressions/class/class-name-ident-yield-escaped.js b/test/language/expressions/class/class-name-ident-yield-escaped.js
index 445fe29..6adf12d 100644
--- a/test/language/expressions/class/class-name-ident-yield-escaped.js
+++ b/test/language/expressions/class/class-name-ident-yield-escaped.js
@@ -13,6 +13,10 @@ info: |
It is a Syntax Error if this phrase is contained in strict mode code and the
StringValue of IdentifierName is: "implements", "interface", "let", "package",
"private", "protected", "public", "static", or "yield".
+
+ 10.2.1 Strict Mode Code
+
+ All parts of a ClassDeclaration or a ClassExpression are strict mode code.
negative:
phase: parse
type: SyntaxError
diff --git a/test/language/expressions/class/class-name-ident-yield.js b/test/language/expressions/class/class-name-ident-yield.js
index 4c69296..ecc3f44 100644
--- a/test/language/expressions/class/class-name-ident-yield.js
+++ b/test/language/expressions/class/class-name-ident-yield.js
@@ -11,6 +11,10 @@ info: |
IdentifierReference : yield
It is a Syntax Error if the code matched by this production is contained in strict mode code.
+
+ 10.2.1 Strict Mode Code
+
+ All parts of a ClassDeclaration or a ClassExpression are strict mode code.
negative:
phase: parse
type: SyntaxError
diff --git a/test/language/statements/class/class-name-ident-await-module.js b/test/language/statements/class/class-name-ident-await-module.js
index 6353ac2..ec6af34 100644
--- a/test/language/statements/class/class-name-ident-await-module.js
+++ b/test/language/statements/class/class-name-ident-await-module.js
@@ -8,7 +8,7 @@ description: >
info: |
12.1.1 Static Semantics: Early Errors
- IdentifierReference : yield
+ IdentifierReference : await
It is a Syntax Error if the goal symbol of the syntactic grammar is Module.
negative:
diff --git a/test/language/statements/class/class-name-ident-await.js b/test/language/statements/class/class-name-ident-await.js
index 5deb9af..0237382 100644
--- a/test/language/statements/class/class-name-ident-await.js
+++ b/test/language/statements/class/class-name-ident-await.js
@@ -8,7 +8,7 @@ description: >
info: |
12.1.1 Static Semantics: Early Errors
- IdentifierReference : yield
+ IdentifierReference : await
It is a Syntax Error if the goal symbol of the syntactic grammar is Module.
---*/
diff --git a/test/language/statements/class/class-name-ident-let-escaped.js b/test/language/statements/class/class-name-ident-let-escaped.js
index b344a1a..eb54d47 100644
--- a/test/language/statements/class/class-name-ident-let-escaped.js
+++ b/test/language/statements/class/class-name-ident-let-escaped.js
@@ -13,6 +13,10 @@ info: |
It is a Syntax Error if this phrase is contained in strict mode code and the
StringValue of IdentifierName is: "implements", "interface", "let", "package",
"private", "protected", "public", "static", or "yield".
+
+ 10.2.1 Strict Mode Code
+
+ All parts of a ClassDeclaration or a ClassExpression are strict mode code.
negative:
phase: parse
type: SyntaxError
diff --git a/test/language/statements/class/class-name-ident-let.js b/test/language/statements/class/class-name-ident-let.js
index 0e819dc..62da254 100644
--- a/test/language/statements/class/class-name-ident-let.js
+++ b/test/language/statements/class/class-name-ident-let.js
@@ -13,6 +13,10 @@ info: |
It is a Syntax Error if this phrase is contained in strict mode code and the
StringValue of IdentifierName is: "implements", "interface", "let", "package",
"private", "protected", "public", "static", or "yield".
+
+ 10.2.1 Strict Mode Code
+
+ All parts of a ClassDeclaration or a ClassExpression are strict mode code.
negative:
phase: parse
type: SyntaxError
diff --git a/test/language/statements/class/class-name-ident-static-escaped.js b/test/language/statements/class/class-name-ident-static-escaped.js
index e1fc8cc..fe1e1e7 100644
--- a/test/language/statements/class/class-name-ident-static-escaped.js
+++ b/test/language/statements/class/class-name-ident-static-escaped.js
@@ -13,6 +13,10 @@ info: |
It is a Syntax Error if this phrase is contained in strict mode code and the
StringValue of IdentifierName is: "implements", "interface", "let", "package",
"private", "protected", "public", "static", or "yield".
+
+ 10.2.1 Strict Mode Code
+
+ All parts of a ClassDeclaration or a ClassExpression are strict mode code.
negative:
phase: parse
type: SyntaxError
diff --git a/test/language/statements/class/class-name-ident-static.js b/test/language/statements/class/class-name-ident-static.js
index 4548996..43b7c9c 100644
--- a/test/language/statements/class/class-name-ident-static.js
+++ b/test/language/statements/class/class-name-ident-static.js
@@ -13,6 +13,10 @@ info: |
It is a Syntax Error if this phrase is contained in strict mode code and the
StringValue of IdentifierName is: "implements", "interface", "let", "package",
"private", "protected", "public", "static", or "yield".
+
+ 10.2.1 Strict Mode Code
+
+ All parts of a ClassDeclaration or a ClassExpression are strict mode code.
negative:
phase: parse
type: SyntaxError
diff --git a/test/language/statements/class/class-name-ident-yield-escaped.js b/test/language/statements/class/class-name-ident-yield-escaped.js
index a94089b..e2992b5 100644
--- a/test/language/statements/class/class-name-ident-yield-escaped.js
+++ b/test/language/statements/class/class-name-ident-yield-escaped.js
@@ -13,6 +13,10 @@ info: |
It is a Syntax Error if this phrase is contained in strict mode code and the
StringValue of IdentifierName is: "implements", "interface", "let", "package",
"private", "protected", "public", "static", or "yield".
+
+ 10.2.1 Strict Mode Code
+
+ All parts of a ClassDeclaration or a ClassExpression are strict mode code.
negative:
phase: parse
type: SyntaxError
diff --git a/test/language/statements/class/class-name-ident-yield.js b/test/language/statements/class/class-name-ident-yield.js
index 6bbb9c0..6ef5165 100644
--- a/test/language/statements/class/class-name-ident-yield.js
+++ b/test/language/statements/class/class-name-ident-yield.js
@@ -11,6 +11,10 @@ info: |
IdentifierReference : yield
It is a Syntax Error if the code matched by this production is contained in strict mode code.
+
+ 10.2.1 Strict Mode Code
+
+ All parts of a ClassDeclaration or a ClassExpression are strict mode code.
negative:
phase: parse
type: SyntaxError |
Thanks! |
Some test cases where I observed cross-browser compatibility issues in the past.