Allow getOwnPropertyDescriptor to be called for objects with no scope, e.g. functions returned from Function.bind

Patch from Raphael Speyer


git-svn-id: svn://10.0.0.236/trunk@257814 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
nboyd%atg.com 2009-07-28 02:22:39 +00:00
parent 81c1d523fc
commit 1d48eb38a0

View File

@ -726,7 +726,7 @@ public abstract class IdScriptableObject extends ScriptableObject
desc = new NativeObject();
Scriptable scope = getParentScope();
ScriptRuntime.setObjectProtoAndParent(desc, scope);
ScriptRuntime.setObjectProtoAndParent(desc, (scope == null ? this : scope));
desc.defineProperty("value", value, EMPTY);
desc.defineProperty("enumerable", false, EMPTY);