WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
177218
test262: test262/harness/assert-throws-early-referenceerror.js test failure
https://bugs.webkit.org/show_bug.cgi?id=177218
Summary
test262: test262/harness/assert-throws-early-referenceerror.js test failure
Joseph Pecoraro
Reported
2017-09-19 19:46:57 PDT
test262: test262/harness/assert-throws-early-referenceerror.js test failure This is used by only a few tests. These tests look for "Early Errors" that are ReferenceErrors, not SyntaxErrors. And they must be thrown early (approximately parse time not evaluation). For example, each of these would throw a ReferenceError without even executing the function: Function("1=1;") Function("function f() { 1=1; }") The only cases of Early Error ReferenceErrors:
https://tc39.github.io/ecma262/#sec-update-expressions-static-semantics-early-errors
https://tc39.github.io/ecma262/#sec-assignment-operators-static-semantics-early-errors
And `Function(...)` is a case where early errors are reported. See step 19:
https://tc39.github.io/ecma262/#sec-createdynamicfunction
> ... > 17. Let body be the result of parsing bodyText, interpreted as UTF-16 encoded Unicode text as described in 6.1.4, using goal as the goal symbol. Throw a SyntaxError exception if the parse fails. > 18. Let strict be ContainsUseStrict of body. > 19. If any static semantics errors are detected for parameters or body, throw a SyntaxError or a ReferenceError exception, depending on the type of the error. If strict is true, the Early Error rules for UniqueFormalParameters:FormalParameters are applied. Parsing and early error detection may be interweaved in an implementation-dependent manner. > ...
Attachments
Add attachment
proposed patch, testcase, etc.
Ross Kirsling
Comment 1
2018-11-28 12:49:11 PST
Aside from the harness-level check, there appear to be 62 regular tests which are failing due to JSC's lack of early ReferenceErrors: language/asi/S7.9_A5.7_T1.js language/expressions/assignment/non-simple-target.js language/expressions/assignment/target-boolean.js language/expressions/assignment/target-cover-newtarget.js language/expressions/assignment/target-cover-yieldexpr.js language/expressions/assignment/target-newtarget.js language/expressions/assignment/target-null.js language/expressions/assignment/target-number.js language/expressions/assignment/target-string.js language/expressions/async-function/early-errors-expression-not-simple-assignment-target.js language/expressions/async-generator/early-errors-expression-not-simple-assignment-target.js language/expressions/await/early-errors-await-not-simple-assignment-target.js language/expressions/compound-assignment/add-non-simple.js language/expressions/compound-assignment/btws-and-non-simple.js language/expressions/compound-assignment/btws-or-non-simple.js language/expressions/compound-assignment/btws-xor-non-simple.js language/expressions/compound-assignment/div-non-simple.js language/expressions/compound-assignment/left-shift-non-simple.js language/expressions/compound-assignment/mod-div-non-simple.js language/expressions/compound-assignment/mult-non-simple.js language/expressions/compound-assignment/right-shift-non-simple.js language/expressions/compound-assignment/subtract-non-simple.js language/expressions/compound-assignment/u-right-shift-non-simple.js language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-1-update-expression.js language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-10-lhs-assignment-operator-assignment-expression.js language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-11-lhs-assignment-operator-assignment-expression.js language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-12-lhs-assignment-operator-assignment-expression.js language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-13-lhs-assignment-operator-assignment-expression.js language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-14-lhs-assignment-operator-assignment-expression.js language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-15-lhs-assignment-operator-assignment-expression.js language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-16-lhs-assignment-operator-assignment-expression.js language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-17-lhs-assignment-operator-assignment-expression.js language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-2-update-expression.js language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-3-update-expression.js language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-4-update-expression.js language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-5-lhs-equals-assignment-expression.js language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-6-lhs-assignment-operator-assignment-expression.js language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-7-lhs-assignment-operator-assignment-expression.js language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-8-lhs-assignment-operator-assignment-expression.js language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-9-lhs-assignment-operator-assignment-expression.js language/expressions/postfix-decrement/non-simple.js language/expressions/postfix-decrement/target-cover-newtarget.js language/expressions/postfix-decrement/target-cover-yieldexpr.js language/expressions/postfix-decrement/target-newtarget.js language/expressions/postfix-increment/non-simple.js language/expressions/postfix-increment/target-cover-newtarget.js language/expressions/postfix-increment/target-cover-yieldexpr.js language/expressions/postfix-increment/target-newtarget.js language/expressions/prefix-decrement/non-simple.js language/expressions/prefix-decrement/target-cover-newtarget.js language/expressions/prefix-decrement/target-cover-yieldexpr.js language/expressions/prefix-decrement/target-newtarget.js language/expressions/prefix-increment/non-simple.js language/expressions/prefix-increment/target-cover-newtarget.js language/expressions/prefix-increment/target-cover-yieldexpr.js language/expressions/prefix-increment/target-newtarget.js language/expressions/this/S11.1.1_A1.js language/module-code/parse-err-reference.js language/types/boolean/S8.3_A2.1.js language/types/boolean/S8.3_A2.2.js language/types/reference/S8.7.2_A1_T1.js language/types/reference/S8.7.2_A1_T2.js
Ross Kirsling
Comment 2
2019-05-03 21:36:47 PDT
Update: One way or another, we're still going to need to turn late errors into early errors for expressions like 0++, ++0, 0 = 0, and 0 += 0, but I've decided to be the guy to propose removing the concept of "early ReferenceError" from the spec and simply having all early errors be SyntaxErrors. :D
https://github.com/tc39/ecma262/pull/1527
Ross Kirsling
Comment 3
2019-05-16 12:40:36 PDT
Just to be explicit, I'm leaving this bug open to track the aforementioned TC39 PR. If it is accepted next month, we can just perform a test262 import here; otherwise we would need to address the lack of early ReferenceError at that time.
Ross Kirsling
Comment 4
2019-06-17 11:34:18 PDT
Woohoo -- spec update reached consensus and test262 has been updated to reflect it!
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug