Last Comment Bug 385159 - Make the JS shell use the latest version
: Make the JS shell use the latest version
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: Trunk
: All All
: -- trivial (vote)
: mozilla1.9alpha6
Assigned To: Blake Kaplan (:mrbkap)
:
Mentors:
Depends on: 381031
Blocks:
  Show dependency treegraph
 
Reported: 2007-06-20 02:40 PDT by Blake Kaplan (:mrbkap)
Modified: 2007-09-09 11:00 PDT (History)
5 users (show)
bob: in‑testsuite-
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Fix (716 bytes, patch)
2007-06-20 02:40 PDT, Blake Kaplan (:mrbkap)
brendan: review+
bob: review+
Details | Diff | Splinter Review

Description Blake Kaplan (:mrbkap) 2007-06-20 02:40:22 PDT
Created attachment 269056 [details] [diff] [review]
Fix

I don't see the advantage of having to type -v 180 (or version(180)) anytime I want to use let, etc. in the JS shell (this isn't the web!). Of course, js -v 0 (or similar) can downgrade to older versions.
Comment 1 Brendan Eich [:brendan] 2007-06-20 09:12:53 PDT
Comment on attachment 269056 [details] [diff] [review]
Fix

Assuming no bad effects on testsuite. Bob can stamp to remove that assumption.

/be
Comment 2 Bob Clary [:bc:] 2007-06-20 09:36:01 PDT
I can adapt.
Comment 3 Blake Kaplan (:mrbkap) 2007-06-20 16:54:04 PDT
Fixed on trunk.
Comment 4 Bob Clary [:bc:] 2007-06-22 01:57:58 PDT
I haven't yet updated the suite to set the version for older subsuites back to 1.5. The following tests now fail with the default version but pass if you set -v 150.

js1_5/Regress/regress-309242.js
js1_5/Regress/regress-310993.js
js1_5/Regress/regress-311071.js
js1_5/Regress/regress-31255.js
e4x related errors with <!-- comments

Is e4x turned off in js1.8?

js1_6/extensions/regress-352392.js
expected: SyntaxError: invalid for each loop actual: TypeError: (void 0) is not a function 

wtf?
Comment 5 Blake Kaplan (:mrbkap) 2007-06-27 14:40:11 PDT
(In reply to comment #4)
> js1_6/extensions/regress-352392.js
> expected: SyntaxError: invalid for each loop actual: TypeError: (void 0) is not
> a function 

This is trying to say 'undefined is not a function', from the call to Array.prototype.map, but in the new, exciting, world we can't say 'undefined', so you get void 0 instead. So this is working as intended.
Comment 6 Bob Clary [:bc:] 2007-06-27 15:03:27 PDT
The test checks: 
On the trunk I see 
v160: 'SyntaxError: invalid for each loop',
v180: 'TypeError: (void 0) is not a function' for v180. 

On 1.8.1 I see
v160: 'SyntaxError: invalid for each loop',
v180: 'TypeError: (void 0) is not a function' for v180. 

Is the change from SyntaxError to TypeError legitimate?
Comment 7 Jesse Ruderman 2007-06-27 18:17:40 PDT
Sounds like you're just hitting a different error depending on the JavaScript version, because of the change in bug 366941 (which only affects v180).

Note You need to log in before you can comment on or make changes to this bug.