Closed
Bug 359359
Opened 18 years ago
Closed 17 years ago
i-- returns void when OptimizationLevel=1
Categories
(Rhino Graveyard :: Compiler, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
1.6R6
People
(Reporter: christophe.marton, Assigned: norrisboyd)
Details
Attachments
(2 files)
687 bytes,
application/octet-stream
|
Details | |
4.86 KB,
patch
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1) Gecko/20061010 Firefox/2.0 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1) Gecko/20061010 Firefox/2.0 when using OptimizationLevel=1, i-- returns void instead of the expected number in the following script: function zeros(i) { var a=[]; while((i--)>0) { a[i]=0; } return a; } function g() { return zeros(10); } g(); The error message is: RHINO USAGE WARNING: Missed Context.javaToJS() conversion: Rhino runtime detected object void of class java.lang.Class where it expected String, Number, Boolean or Scriptable instance. Please check your code for missing Context.javaToJS() call. Note: - calling g() is required to reproduce the problem, calling zeros(10) at top level works well. - Works well with optimizationLevel=0, returns "0,0,0,0,0,0,0,0,0,0". Reproducible: Always
Comment 1•18 years ago
|
||
I can confirm this is a bug. I've attached a testcase to reproduce the problem. I unfortunately don't know any of the optimizer internals -- I notified Norris Boyd in e-mail; hopefully he'll have time to take a look at it.
Assignee | ||
Updated•17 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Comment 2•17 years ago
|
||
Proposed patch for this bug and bug 359358.
Assignee | ||
Updated•17 years ago
|
Assignee: nobody → norrisboyd
Status: ASSIGNED → NEW
Assignee | ||
Comment 3•17 years ago
|
||
Fixed: Checking in Codegen.java; /cvsroot/mozilla/js/rhino/src/org/mozilla/javascript/optimizer/Codegen.java,v <-- Codegen.java new revision: 1.243; previous revision: 1.242 done Checking in OptRuntime.java; /cvsroot/mozilla/js/rhino/src/org/mozilla/javascript/optimizer/OptRuntime.java,v <-- OptRuntime.java new revision: 1.35; previous revision: 1.34 done Checking in Optimizer.java; /cvsroot/mozilla/js/rhino/src/org/mozilla/javascript/optimizer/Optimizer.java,v <-- Optimizer.java new revision: 1.50; previous revision: 1.49 done
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 4•17 years ago
|
||
Adding target milestone of 1.6R6 based on the date this bug was resolved FIXED.
Target Milestone: --- → 1.6R6
You need to log in
before you can comment on or make changes to this bug.
Description
•