Skip to content

Commit

Permalink
Set prototype and parent scope for JavaAdapters extending ScriptableO…
Browse files Browse the repository at this point in the history
…bject.
  • Loading branch information
hns committed Apr 25, 2011
1 parent df95c40 commit d1a8338
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/org/mozilla/javascript/JavaAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit d1a8338

Please sign in to comment.