Closed
Bug 1121323
Opened 10 years ago
Closed 10 years ago
Remove nonstandard let expressions from XBL test_bug389322.xhtml
Categories
(Core :: XBL, defect)
Core
XBL
Tracking
()
RESOLVED
FIXED
mozilla38
People
(Reporter: cpeterson, Assigned: cpeterson)
References
Details
Attachments
(1 file)
3.71 KB,
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
let expressions are a nonstandard language extension we'd like to remove from SpiderMonkey.
test_bug389322.xhtml checks whether XBL uses JS version 1.7+ by trying to use `let (x=1) x`, as let expressions are only available in JS 1.7+. These checks can be simplified to just `let x = 1` because let statements are also only available in JS 1.7+.
I also wrapped the checks in eval() because `let x = 1` without eval() is a fatal SyntaxError, not a catchable run-time error as the test's try/catch logic is clearly expecting.
XBL currently uses JS 1.8.5 (JSVERSION_LATEST). It would be nice to tighten up this test to verify that XBL uses exactly JS 1.8.5 instead of just JS 1.7+, but I don't know of a simple run-time test for JS 1.8.5. I have a proof of concept that can identify JS 1.8.x (but not 1.8.5 exactly) from changes in destructuring for-in behavior [1]. I don't know how much value that provides.
Note that this test case will be broken if bug 855665 enables let without requiring version=1.7 or 1.8.
[1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/New_in_JavaScript/1.8#Changed_functionality_in_JavaScript_1.8
Attachment #8548643 -
Flags: review?(bzbarsky)
![]() |
||
Comment 1•10 years ago
|
||
Comment on attachment 8548643 [details] [diff] [review]
test_bug389322-let-expressions.patch
Yeah, seems fine.
Attachment #8548643 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Comment 2•10 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
You need to log in
before you can comment on or make changes to this bug.
Description
•