Permalink
Browse files

Set prototype and parent scope for JavaAdapters extending ScriptableO…

…bject.
  • Loading branch information...
hannes%helma.at
hannes%helma.at committed Apr 25, 2011
1 parent 578eadf commit bb157eb759361ae056930bfc2ebe0e142e694c32
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/org/mozilla/javascript/JavaAdapter.java
@@ -208,6 +208,10 @@ static Object js_createAdapter(Context cx, Scriptable scope, Object[] args)
if (self instanceof Wrapper) {
Object unwrapped = ((Wrapper) self).unwrap();
if (unwrapped instanceof Scriptable) {
+ if (unwrapped instanceof ScriptableObject) {
+ ScriptRuntime.setObjectProtoAndParent(
+ (ScriptableObject)unwrapped, scope);
+ }
return unwrapped;
}
}

0 comments on commit bb157eb

Please sign in to comment.