Last Comment Bug 694769 - Remove nsIScriptContext::GetScriptGlobal in favour of GetGlobalJSObject
: Remove nsIScriptContext::GetScriptGlobal in favour of GetGlobalJSObject
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: DOM (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla10
Assigned To: :Ms2ger
:
Mentors:
Depends on:
Blocks: 694781 694838 695753
  Show dependency treegraph
 
Reported: 2011-10-15 09:09 PDT by :Ms2ger
Modified: 2011-10-30 05:27 PDT (History)
1 user (show)
Ms2ger: in‑testsuite-
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch v1 (13.86 KB, patch)
2011-10-15 09:09 PDT, :Ms2ger
no flags Details | Diff | Review
Patch v1.1 (14.72 KB, patch)
2011-10-16 06:04 PDT, :Ms2ger
bugs: review+
Details | Diff | Review

Description :Ms2ger 2011-10-15 09:09:10 PDT
Created attachment 567285 [details] [diff] [review]
Patch v1
Comment 1 :Ms2ger 2011-10-16 06:04:54 PDT
Created attachment 567334 [details] [diff] [review]
Patch v1.1

Missed a debug-only one.
Comment 2 Olli Pettay [:smaug] 2011-10-29 12:51:58 PDT
Comment on attachment 567334 [details] [diff] [review]
Patch v1.1

>+++ b/content/xul/document/src/nsXULDocument.cpp
>@@ -3625,24 +3625,18 @@ nsXULDocument::ExecuteScript(nsIScriptCo
> {
>     NS_PRECONDITION(aScriptObject != nsnull && aContext != nsnull, "null ptr");
>     if (! aScriptObject || ! aContext)
>         return NS_ERROR_NULL_POINTER;
> 
>     NS_ENSURE_TRUE(mScriptGlobalObject, NS_ERROR_NOT_INITIALIZED);
> 
>     // Execute the precompiled script with the given version
>-    nsresult rv;
>-    void *global = mScriptGlobalObject->GetScriptGlobal(
>-                                            aContext->GetScriptTypeID());
>-    rv = aContext->ExecuteScript(aScriptObject,
>-                                 global,
>-                                 nsnull, nsnull);
>-
>-    return rv;
>+    JSObject* global = mScriptGlobalObject->GetGlobalJSObject();
>+    return aContext->ExecuteScript(aScriptObject, global, nsnull, nsnull);

Could you add an assertion which checks that aContext->GetScriptTypeID() is JS

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