Closed Bug 574013 Opened 14 years ago Closed 14 years ago

Change JSObjectOps::call to accommodate primitive this, convert NULL to global object later

Categories

(Core :: JavaScript Engine, defect)

Other Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: jorendorff, Unassigned)

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(1 file, 1 obsolete file)

Attached patch v1 (obsolete) — Splinter Review
Currently JSObjectOps::call is a JSNative, so we compute this *before* calling it.

This is incompatible with ES5 and causes transparency problems with wrappers, so we need to move that computation under JSObjectOps::call.
Attachment #453405 - Flags: review?(gal)
Correcting the summary a little. Actually the status quo is to compute this directly under the JSObjectOps barrier, a little too early. With this change we pass a primitive 'this' value, which may be NULL. Wrappers will be able to defer forcing that to an object until later.
Summary: Move computation of this under JSObjectOps::call → Change JSObjectOps::call to accommodate primitive this, convert NULL to global object later
Attached patch patchSplinter Review
Attachment #453405 - Attachment is obsolete: true
Attachment #453405 - Flags: review?(gal)
Comment on attachment 453418 [details] [diff] [review]
patch

We should do the same for construct for sanity's sake.
Attachment #453418 - Flags: review+
http://hg.mozilla.org/tracemonkey/rev/dd2e6dc2699e
Whiteboard: fixed-in-tracemonkey
http://hg.mozilla.org/mozilla-central/rev/dd2e6dc2699e
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: