The default bug view has changed. See this FAQ.

Don't use JS_GetParent in mozJSSubScriptLoader::LoadSubScript

RESOLVED FIXED in mozilla12

Status

()

Core
XPConnect
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: Ms2ger, Assigned: Ms2ger)

Tracking

Trunk
mozilla12
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
Created attachment 580413 [details] [diff] [review]
Patch v1

AFAICT, using JS_GetGlobalForObject is equivalent and less frowned upon.
Attachment #580413 - Flags: review?(jorendorff)
Comment on attachment 580413 [details] [diff] [review]
Patch v1

The right patch is just:

>-        JSObject *maybeGlob = JS_GetParent(cx, targetObj);
>-        while (maybeGlob) {
>-            targetObj = maybeGlob;
>-            maybeGlob = JS_GetParent(cx, maybeGlob);
>-        }
>+        targetObj = JS_GetGlobalForObject(cx, targetObj);

r=me with that change.
Attachment #580413 - Flags: review?(jorendorff) → review+
(Assignee)

Comment 2

5 years ago
Indeed, thanks.

https://hg.mozilla.org/mozilla-central/rev/9c3ab8c81d28
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla12
You need to log in before you can comment on or make changes to this bug.