mozilla

Compare Revisions

Components.utils.import

Change Revisions

Revision 16741:

Revision 16741 by FireRabbit on

Revision 16742:

Revision 16742 by FireRabbit on

Title:
Components.utils.import
Components.utils.import
Slug:
Components.utils.import
Components.utils.import
Tags:
XPConnect, NeedsContent, "XPCOM:Language Bindings"
XPConnect, NeedsContent, "XPCOM:Language Bindings"
Content:

Revision 16741
Revision 16742
n36Components.utils.import("resource://gre/modules/XPCOMUtils.jsm", n36Components.utils.import("resource://gre/modules/JSON.jsm", scope1
>scope1);>);
37Components.utils.import("resource://gre/modules/XPCOMUtils.jsm", 37Components.utils.import("resource://gre/modules/JSON.jsm", scope2
>scope2);>);
n41          while:n41          ...returns <code>true</code>, whereas:
nn44var someURL = "resource://gre/modules/JSON.jsm"; 
44var obj1 = {}, obj2 = {};45var obj1 = {}, obj2 = {}; 
n46                       .getService(Components.interfaces.mozIJSSun47                       .getService(Components.interfaces.mozIJSSu
>bScriptLoader);>bScriptLoader); 
47loader.loadSubScript(someURL, obj1)48loader.loadSubScript(someURL, obj1)
48loader.loadSubScript(someURL, obj2)49loader.loadSubScript(someURL, obj2);
49assert(obj1.XPCOMUtils === obj2.XPCOMUtils);50assert(obj2 === obj1);
tt52        <p>
53          ...returns <code>false</code>.
54        </p>

Back to History