Closed Bug 1121323 Opened 9 years ago Closed 9 years ago

Remove nonstandard let expressions from XBL test_bug389322.xhtml

Categories

(Core :: XBL, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla38

People

(Reporter: cpeterson, Assigned: cpeterson)

References

Details

Attachments

(1 file)

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 on attachment 8548643 [details] [diff] [review]
test_bug389322-let-expressions.patch

Yeah, seems fine.
Attachment #8548643 - Flags: review?(bzbarsky) → review+
https://hg.mozilla.org/mozilla-central/rev/61c681281c30
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
Blocks: 1167029
No longer depends on: 855665
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: