Last Comment Bug 709086 - Don't use JS_GetParent in mozJSSubScriptLoader::LoadSubScript
: Don't use JS_GetParent in mozJSSubScriptLoader::LoadSubScript
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: XPConnect (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla12
Assigned To: :Ms2ger (⌚ UTC+1/+2)
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-12-09 07:52 PST by :Ms2ger (⌚ UTC+1/+2)
Modified: 2012-01-03 03:55 PST (History)
1 user (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch v1 (1.09 KB, patch)
2011-12-09 07:52 PST, :Ms2ger (⌚ UTC+1/+2)
jorendorff: review+
Details | Diff | Splinter Review

Description :Ms2ger (⌚ UTC+1/+2) 2011-12-09 07:52:37 PST
Created attachment 580413 [details] [diff] [review]
Patch v1

AFAICT, using JS_GetGlobalForObject is equivalent and less frowned upon.
Comment 1 Jason Orendorff [:jorendorff] 2011-12-28 08:53:39 PST
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.
Comment 2 :Ms2ger (⌚ UTC+1/+2) 2012-01-03 03:55:20 PST
Indeed, thanks.

https://hg.mozilla.org/mozilla-central/rev/9c3ab8c81d28

Note You need to log in before you can comment on or make changes to this bug.