Closed Bug 1192329 Opened 9 years ago Closed 9 years ago

Change JS shell to default to the standard version of JS (not 1.7+)

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla44
Tracking Status
firefox44 --- fixed

People

(Reporter: jorendorff, Assigned: mrrrgn)

References

Details

(Keywords: dev-doc-complete, Whiteboard: [mentor=jorendorff])

Attachments

(3 files)

As reported in bug 1146532: js> var yield; typein:1:4 SyntaxError: yield is a reserved identifier: Nonsense. The js shell should default to standard, Web-compatible JS. The version() shell builtin is still there for testing legacy features.
Blocks: 1JS
Blocks: 1146532
Assignee: nobody → winter2718
Snagging this ^.^
+1 I encountered this when working on let in V8. I mistakenly thought SpiderMonkey reserved let as a keyword for a while. I am using the easy workaround of writing a web page for it, but it'd be great if the js repl were fixed.
Whiteboard: [mentor=jorendorff]
Start by changing JSVERSION_LATEST to JSVERSION_DEFAULT throughout js/src/shell/js.cpp. If there's an interesting part, it'll involve fixing busted tests. Broad-spectrum restoration of the old gross version for particular directories of tests is OK: the goal of this bug is to fix the shell for people using it interactively.
This is a dupe of Bug 1173883...
Not really. Web console is not the same as the JS shell.
Attached patch smshell.1.diffSplinter Review
Attachment #8677863 - Flags: review?(jorendorff)
Attached patch smshell.2.diffSplinter Review
Attachment #8677864 - Flags: review?(jorendorff)
Sorry for the long turnaround time here. The changes to JSVERSION_DEFAULT in shell/js.cpp didn't break tests because the shell tests were already calling "version(0)" before running. I went ahead and removed that since it's unnecessary now.
Comment on attachment 8677863 [details] [diff] [review] smshell.1.diff Review of attachment 8677863 [details] [diff] [review]: ----------------------------------------------------------------- Great! Glad this turned out to be easy for once.
Attachment #8677863 - Flags: review?(jorendorff) → review+
Attachment #8677864 - Flags: review?(jorendorff) → review+
Attached patch smshell.3.diffSplinter Review
This fixes the asm tests by explicitly setting a version.
Attachment #8678298 - Flags: review?(jorendorff)
Comment on attachment 8678298 [details] [diff] [review] smshell.3.diff I already gave this review on IRC, but it doesn't hurt to have it here too.
Attachment #8678298 - Attachment is patch: true
Attachment #8678298 - Flags: review?(jorendorff) → review+
(In reply to Florian Scholz [:fscholz] (MDN) from comment #16) > Added a note to > https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/ > Introduction_to_the_JavaScript_shell and > https://developer.mozilla.org/en-US/Firefox/Releases/44#JavaScript Ah, thank you! /me Takes note to always remember docs for the future. :)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: