mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 15:52:07 +00:00
JavaAdapter no longer uses FlattenedObject, since the prototype is simply the LiveConnect wrapper.
This commit is contained in:
parent
1b108bb46a
commit
d080c25c1d
@ -1915,7 +1915,7 @@ public class ScriptRuntime {
|
||||
return scope;
|
||||
}
|
||||
|
||||
public static FlattenedObject runScript(Script script) {
|
||||
public static Scriptable runScript(Script script) {
|
||||
Context cx = Context.enter();
|
||||
Scriptable global = cx.initStandardObjects(new ImporterTopLevel());
|
||||
try {
|
||||
@ -1924,11 +1924,10 @@ public class ScriptRuntime {
|
||||
throw new Error(e.toString());
|
||||
}
|
||||
Context.exit();
|
||||
return new FlattenedObject(global);
|
||||
return global;
|
||||
}
|
||||
|
||||
public static void setAdapterProto(FlattenedObject fobj, Object adapter) {
|
||||
Scriptable obj = fobj.getObject();
|
||||
public static void setAdapterProto(Scriptable obj, Object adapter) {
|
||||
Scriptable p = obj.getPrototype();
|
||||
Scriptable scope = ScriptableObject.getTopLevelScope(obj);
|
||||
if (p == null || p == ScriptableObject.getObjectPrototype(scope)) {
|
||||
|
@ -1915,7 +1915,7 @@ public class ScriptRuntime {
|
||||
return scope;
|
||||
}
|
||||
|
||||
public static FlattenedObject runScript(Script script) {
|
||||
public static Scriptable runScript(Script script) {
|
||||
Context cx = Context.enter();
|
||||
Scriptable global = cx.initStandardObjects(new ImporterTopLevel());
|
||||
try {
|
||||
@ -1924,11 +1924,10 @@ public class ScriptRuntime {
|
||||
throw new Error(e.toString());
|
||||
}
|
||||
Context.exit();
|
||||
return new FlattenedObject(global);
|
||||
return global;
|
||||
}
|
||||
|
||||
public static void setAdapterProto(FlattenedObject fobj, Object adapter) {
|
||||
Scriptable obj = fobj.getObject();
|
||||
public static void setAdapterProto(Scriptable obj, Object adapter) {
|
||||
Scriptable p = obj.getPrototype();
|
||||
Scriptable scope = ScriptableObject.getTopLevelScope(obj);
|
||||
if (p == null || p == ScriptableObject.getObjectPrototype(scope)) {
|
||||
|
Loading…
Reference in New Issue
Block a user