Closed Bug 709086 Opened 13 years ago Closed 13 years ago

Don't use JS_GetParent in mozJSSubScriptLoader::LoadSubScript

Categories

(Core :: XPConnect, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla12

People

(Reporter: Ms2ger, Assigned: Ms2ger)

Details

Attachments

(1 file)

Attached patch Patch v1Splinter Review
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+
Indeed, thanks.

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

Attachment

General

Created:
Updated:
Size: