зеркало из https://github.com/mozilla/pjs.git
Clean up new methods.
This commit is contained in:
Родитель
e02cdc0d7c
Коммит
0bca489fe4
|
@ -148,7 +148,7 @@ public class NativeObject extends ScriptableObject {
|
|||
Function funObj)
|
||||
{
|
||||
if (args.length != 0)
|
||||
if (thisObj.has(ScriptRuntime.toString(args[0]), null))
|
||||
if (thisObj.has(ScriptRuntime.toString(args[0]), thisObj))
|
||||
return Boolean.TRUE;
|
||||
return Boolean.FALSE;
|
||||
}
|
||||
|
@ -161,10 +161,11 @@ public class NativeObject extends ScriptableObject {
|
|||
try {
|
||||
if (args.length != 0) {
|
||||
String name = ScriptRuntime.toString(args[0]);
|
||||
if (thisObj.has(name, null))
|
||||
if ((((ScriptableObject)thisObj).getAttributes(name, null)
|
||||
& ScriptableObject.DONTENUM) == 0)
|
||||
if (thisObj.has(name, thisObj)) {
|
||||
int a = ((ScriptableObject)thisObj).getAttributes(name, thisObj);
|
||||
if ((a & ScriptableObject.DONTENUM) == 0)
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (PropertyException x) {
|
||||
|
@ -177,10 +178,14 @@ public class NativeObject extends ScriptableObject {
|
|||
public static Object jsFunction_isPrototypeOf(Context cx, Scriptable thisObj,
|
||||
Object[] args, Function funObj)
|
||||
{
|
||||
if (args.length != 0)
|
||||
if (args[0] instanceof Scriptable)
|
||||
if (thisObj == ((Scriptable)args[0]).getPrototype())
|
||||
return Boolean.TRUE;
|
||||
if (args.length != 0 && args[0] instanceof Scriptable) {
|
||||
Scriptable v = (Scriptable) args[0];
|
||||
do {
|
||||
v = v.getPrototype();
|
||||
if (v == thisObj)
|
||||
return Boolean.TRUE;
|
||||
} while (v != null);
|
||||
}
|
||||
return Boolean.FALSE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -148,7 +148,7 @@ public class NativeObject extends ScriptableObject {
|
|||
Function funObj)
|
||||
{
|
||||
if (args.length != 0)
|
||||
if (thisObj.has(ScriptRuntime.toString(args[0]), null))
|
||||
if (thisObj.has(ScriptRuntime.toString(args[0]), thisObj))
|
||||
return Boolean.TRUE;
|
||||
return Boolean.FALSE;
|
||||
}
|
||||
|
@ -161,10 +161,11 @@ public class NativeObject extends ScriptableObject {
|
|||
try {
|
||||
if (args.length != 0) {
|
||||
String name = ScriptRuntime.toString(args[0]);
|
||||
if (thisObj.has(name, null))
|
||||
if ((((ScriptableObject)thisObj).getAttributes(name, null)
|
||||
& ScriptableObject.DONTENUM) == 0)
|
||||
if (thisObj.has(name, thisObj)) {
|
||||
int a = ((ScriptableObject)thisObj).getAttributes(name, thisObj);
|
||||
if ((a & ScriptableObject.DONTENUM) == 0)
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (PropertyException x) {
|
||||
|
@ -177,10 +178,14 @@ public class NativeObject extends ScriptableObject {
|
|||
public static Object jsFunction_isPrototypeOf(Context cx, Scriptable thisObj,
|
||||
Object[] args, Function funObj)
|
||||
{
|
||||
if (args.length != 0)
|
||||
if (args[0] instanceof Scriptable)
|
||||
if (thisObj == ((Scriptable)args[0]).getPrototype())
|
||||
return Boolean.TRUE;
|
||||
if (args.length != 0 && args[0] instanceof Scriptable) {
|
||||
Scriptable v = (Scriptable) args[0];
|
||||
do {
|
||||
v = v.getPrototype();
|
||||
if (v == thisObj)
|
||||
return Boolean.TRUE;
|
||||
} while (v != null);
|
||||
}
|
||||
return Boolean.FALSE;
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче