Closed Bug 391350 Opened 17 years ago Closed 17 years ago

Incorrect type inference for array and object literals

Categories

(Rhino Graveyard :: Compiler, defect)

1.6R6
x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: norrisboyd, Assigned: norrisboyd)

Details

Attachments

(1 file)

Attached patch Proposed patchSplinter Review
The program

function f() {
  var x = {a:1,b:2};
  return x.a;
}
print(f());

will print "undefined" for optimization level 1 instead of 1 due to the optimizer incorrectly assuming the object literal in the tree is an operator with two number type operands that must thus produce a number.
Fixed:

Checking in src/org/mozilla/javascript/optimizer/Block.java;
/cvsroot/mozilla/js/rhino/src/org/mozilla/javascript/optimizer/Block.java,v  <--  Block.java
new revision: 1.37.4.1; previous revision: 1.37
done
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: