Closed Bug 761439 Opened 12 years ago Closed 12 years ago

nativeCall on non-cross-compartment wrappers leads to infinite recursion

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla16

People

(Reporter: luke, Assigned: luke)

References

Details

Attachments

(1 file)

The reason is that IndirectProxyHandler::nativeCall just makes the same call. Since we have recursion checks on this path, the bug just manifests itself as a recursion error instead of a type error when you do, e.g., Data.prototype.getTime.all(window.location). Simple fix, though.
Attached patch fix and testSplinter Review
Attachment #629991 - Flags: review?(sphink)
Blocks: 758912
Blocks: 761462
I'm going to guess your example test case was meant to be Date.prototype.getTime.apply(window.location) In the shell, wrap(new Date).getTime() works too.
Attachment #629991 - Flags: review?(sphink) → review+
(In reply to Steve Fink [:sfink] from comment #2) > I'm going to guess your example test case was meant to be Well, any non-generic method exercises the path. I picked DataView since window.location isn't in the shell and Data tends to give temporal values :)
(In reply to Luke Wagner [:luke] from comment #3) > (In reply to Steve Fink [:sfink] from comment #2) > > I'm going to guess your example test case was meant to be > > Well, any non-generic method exercises the path. I picked DataView since > window.location isn't in the shell and Data tends to give temporal values :) I was referring to comment 0, which confused me briefly (Data, all).
Ohh, hah, I see.
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Depends on: 770407
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: