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

RESOLVED FIXED in Firefox 44

Status

()

defect
RESOLVED FIXED
4 years ago
6 months ago

People

(Reporter: jorendorff, Assigned: mrrrgn)

Tracking

({dev-doc-complete})

unspecified
mozilla44
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox44 fixed)

Details

(Whiteboard: [mentor=jorendorff])

Attachments

(3 attachments)

(Reporter)

Description

4 years ago
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.
(Reporter)

Updated

4 years ago
Blocks: 1JS
(Reporter)

Updated

4 years ago
Blocks: 1146532
(Assignee)

Updated

4 years ago
Assignee: nobody → winter2718
(Assignee)

Comment 1

4 years ago
Snagging this ^.^

Comment 2

4 years ago
+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.
(Reporter)

Updated

4 years ago
Whiteboard: [mentor=jorendorff]
(Reporter)

Comment 3

4 years ago
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.

Comment 4

4 years ago
This is a dupe of Bug 1173883...
Not really. Web console is not the same as the JS shell.
(Assignee)

Comment 6

4 years ago
Attachment #8677863 - Flags: review?(jorendorff)
(Assignee)

Comment 7

4 years ago
Attachment #8677864 - Flags: review?(jorendorff)
(Assignee)

Comment 8

4 years ago
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.
(Reporter)

Comment 10

4 years ago
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+
(Reporter)

Updated

4 years ago
Attachment #8677864 - Flags: review?(jorendorff) → review+
(Assignee)

Comment 12

4 years ago
This fixes the asm tests by explicitly setting a version.
Attachment #8678298 - Flags: review?(jorendorff)
(Reporter)

Comment 14

4 years ago
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+
(Assignee)

Comment 17

4 years ago
(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. :)
Depends on: 1501998
You need to log in before you can comment on or make changes to this bug.