-
Type:
Bug
-
Resolution: Fixed
-
Priority:
P3
-
Affects Version/s: 8
-
Component/s: core-libs
-
None
-
b94
-
generic
-
generic
-
Verified
loadWithNewGlobal runs given script in a new 'global' instance. The return result could be a script object -- such an object should be properly wrapped. If not, it will start referring/using objects from caller's "world".
Example:
var glob = loadWithNewGlobal(
{ name: "<code>",
script: "function func() { return [] }; this;"
})
// should print false - not an Array of caller's global
print(glob.func() instanceof Array)
// should print false - not an Object from caller's global
print(glob instanceof Object)
Example:
var glob = loadWithNewGlobal(
{ name: "<code>",
script: "function func() { return [] }; this;"
})
// should print false - not an Array of caller's global
print(glob.func() instanceof Array)
// should print false - not an Object from caller's global
print(glob instanceof Object)