Throw early SyntaxError instead of ReferenceError for 0 = 0
Categories
(Core :: JavaScript Engine, enhancement, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox69 | --- | fixed |
People
(Reporter: evilpie, Assigned: rkirsling)
References
(Blocks 1 open bug)
Details
Attachments
(1 file, 1 obsolete file)
(deleted),
text/x-phabricator-request
|
Details |
For cases like 0 = 0
or 0 += 1
we need to start throwing SyntaxErrors.
This is changing with https://github.com/tc39/ecma262/pull/1527
https://github.com/tc39/test262/pull/2147
Updated•5 years ago
|
Assignee | ||
Comment 1•5 years ago
|
||
Assignee | ||
Comment 2•5 years ago
|
||
Thought I'd try my hand at this. Here's hoping I followed patch submission procedures correctly. :D
Assignee | ||
Comment 3•5 years ago
|
||
Depends on D35298
Assignee | ||
Comment 4•5 years ago
|
||
Ugh. I didn't see any other way to update a diff in the moz-phab documentation, but I'm pretty certain I've done the wrong thing here in having created a second commit to amend the first.
Reporter | ||
Comment 5•5 years ago
|
||
Yes, you can just amend the original commit and run moz-phab submit
again, that should update the revision on phabricator.
Updated•5 years ago
|
Comment 7•5 years ago
|
||
Backed out changeset eb8646af425c (Bug 1556818) for bustages in invalid-asssignmenttargettype-reference-error-14-lhs-assignment-operator-assignment-expression.js CLOSED TREE
Push with failures: https://treeherder.mozilla.org/#/jobs?repo=autoland&selectedJob=252655561&resultStatus=testfailed%2Cbusted%2Cexception&revision=eb8646af425c3f6410f41c4226ec70dfb60b5a44
Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=252655561&repo=autoland&lineNumber=38399
Backout: https://hg.mozilla.org/integration/autoland/rev/d7f86b3e6ca64fb7a5a3b098db0f4f7d274aa6ed
Reporter | ||
Updated•5 years ago
|
Comment 8•5 years ago
|
||
Tests failed because the test262 update hadn't landed yet (it has now): https://bugzilla.mozilla.org/show_bug.cgi?id=1560206
Comment 10•5 years ago
|
||
Backed out changeset 59f7de9c3032 for causing bustages.
Backout link: https://hg.mozilla.org/integration/autoland/rev/70070eea78d11d41970dfc4c731e0079df128ee7
Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=253070522&repo=autoland&lineNumber=40354
[task 2019-06-24T09:07:08.453Z] 09:07:08 INFO - ../testing/xpcshell/selftest.py::XPCShellTestsTests::testDoPrintWhenVerboseNotExplicit PASSED
[task 2019-06-24T09:07:08.453Z] 09:07:08 INFO - ../testing/xpcshell/selftest.py::XPCShellTestsTests::testDoReportForeignObject PASSED
[task 2019-06-24T09:07:08.453Z] 09:07:08 WARNING - ../testing/xpcshell/selftest.py::XPCShellTestsTests::testDoReportNonSyntaxError TEST-UNEXPECTED-FAIL
[task 2019-06-24T09:07:08.453Z] 09:07:08 INFO - ../testing/xpcshell/selftest.py::XPCShellTestsTests::testDoReportRefError PASSED
Assignee | ||
Comment 11•5 years ago
|
||
Looks like this breaks a test outside of SpiderMonkey too.
Comment 12•5 years ago
|
||
OK, the problem is that this line is expected to trigger a ReferenceError.
Try changing the script to say:
# A test for failure to load a test due to an error other than a syntax error
LOAD_ERROR_OTHER_ERROR = '''
"use strict";
no_such_var = "foo"; // assignment to undeclared variable
'''
and adjust the assertion here to expect the new error message, "ReferenceError: assignment to undeclared variable"
.
Comment 13•5 years ago
|
||
I really don't know if that will work!
Previously this was testing for a static ReferenceError. There's no longer any such thing, so now we'll be testing for a run-time ReferenceError. I didn't see an existing test for that, so it's good to be adding one.
Assignee | ||
Comment 14•5 years ago
|
||
Sounds good to me—I'll give that a shot as soon as I can!
Comment 15•5 years ago
|
||
ni?myself to make sure this doesn't fall through the cracks while Ashley is AFK
Comment 16•5 years ago
|
||
Comment 17•5 years ago
|
||
Backed out for web platform failures on module-error-reporting.html.
backout: https://hg.mozilla.org/integration/autoland/rev/3a6df9d54eaa812e74eea1fa2bb5ad32a9748f56
failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=254061970&repo=autoland&lineNumber=7747
09:03:05 INFO - TEST-START | /_mozilla/html/semantics/scripting-1/the-script-element/module-error-reporting.html
09:03:05 INFO - Clearing pref dom.moduleScripts.enabled
09:03:05 INFO - Setting pref dom.moduleScripts.enabled (true)
09:03:05 INFO - Closing window 6442450953
09:03:05 INFO -
09:03:05 INFO - TEST-UNEXPECTED-FAIL | /_mozilla/html/semantics/scripting-1/the-script-element/module-error-reporting.html | Test error event properties - assert_true: expected true got false
09:03:05 INFO - handleError/<@http://web-platform.test:8000/_mozilla/html/semantics/scripting-1/the-script-element/module-error-reporting.html:58:25
09:03:05 INFO - Test.prototype.step@http://web-platform.test:8000/resources/testharness.js:1594:25
09:03:05 INFO - handleError@http://web-platform.test:8000/_mozilla/html/semantics/scripting-1/the-script-element/module-error-reporting.html:58:14
09:03:05 INFO - EventListener.handleEvent*@http://web-platform.test:8000/_mozilla/html/semantics/scripting-1/the-script-element/module-error-reporting.html:13:10
09:03:05 INFO - TEST-OK | /_mozilla/html/semantics/scripting-1/the-script-element/module-error-reporting.html | took 513ms
Assignee | ||
Comment 18•5 years ago
|
||
Evidently a custom web platform test needed updating as well.
(Doesn't look like this test was ever submitted to upstream WPT? So I guess it suffices to address it here.)
Comment 19•5 years ago
|
||
Comment 20•5 years ago
|
||
bugherder |
Updated•5 years ago
|
Description
•