Closed Bug 776760 Opened 12 years ago Closed 12 years ago

ecma_5/extensions/cross-global-getPrototypeOf.js always fails

Categories

(Core :: JavaScript Engine, defect)

Other Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla17

People

(Reporter: jorendorff, Assigned: luke)

Details

(Whiteboard: [js:p1])

Attachments

(1 file)

It reduces to this:

var g = newGlobal();
g.evaluate("var a = { a: 1 }; " +
           "var obj = Object.create(a);");
assertEq(Object.getPrototypeOf(g.obj), g.a);
g.evaluate("var b = { b: 1 }; " +
           "obj.__proto__ = b;");
assertEq(Object.getPrototypeOf(g.obj), g.b);

Weirdly, if you comment out the first assert, which ought not to have any side effects, the second one passes.

I'll flip Terrence for this one.

(Note that we *could* just add "fails" to the magic comment at the top of the file and wait for Waldo to get back.)
Whiteboard: [js:t]
(In reply to Jason Orendorff [:jorendorff] from comment #0)
> It reduces to this:
> 
> var g = newGlobal();
> g.evaluate("var a = { a: 1 }; " +
>            "var obj = Object.create(a);");
> assertEq(Object.getPrototypeOf(g.obj), g.a);
> g.evaluate("var b = { b: 1 }; " +
>            "obj.__proto__ = b;");
> assertEq(Object.getPrototypeOf(g.obj), g.b);
> 
> Weirdly, if you comment out the first assert, which ought not to have any
> side effects, the second one passes.
> 
> I'll flip Terrence for this one.
> 
> (Note that we *could* just add "fails" to the magic comment at the top of
> the file and wait for Waldo to get back.)

Do we know which patch caused it? We should just back out if possible.
Whiteboard: [js:t] → [js:p1]
It comes from bug 770344, which is also where the test was added.
Attached patch fixSplinter Review
It looks like the failing test was actually added by bug 770344.  The Math.sin() call right before the failing assertEq would seem to indicate that Waldo was working on this and the fix was somehow accidentally lost.  I actually remember talking to Waldo about this problem and I think this patch is the intended solution (at least for now; hopefully we can remove the scripted proxy handler disjunct after the direct proxy work).
Assignee: general → luke
Status: NEW → ASSIGNED
Attachment #645832 - Flags: review?(jorendorff)
Comment on attachment 645832 [details] [diff] [review]
fix

Review of attachment 645832 [details] [diff] [review]:
-----------------------------------------------------------------

Looks reasonable to me.

(It still doesn't make any sense to me for Object.prototype to call the __proto__ getter. Instead, both should call the same C++ function. But yeah, let's land this.)
Attachment #645832 - Flags: review?(jorendorff) → review+
Well, it would seem that my patch causes orange:
  https://tbpl.mozilla.org/?tree=Try&rev=137102959e2d

Since this bug existed before bug 770344 (filed as bug 764307), I think we should just remove the offending assert.
https://hg.mozilla.org/mozilla-central/rev/3238a5e6e0d8
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla17
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: