I added static IdFunction.define utility method to define IdFunction instances as properties in the given scope.

This commit is contained in:
igor%mir2.org 2003-04-13 08:40:43 +00:00
Родитель c5e44e7d6e
Коммит e326be8a4b
1 изменённых файлов: 23 добавлений и 0 удалений

Просмотреть файл

@ -51,6 +51,29 @@ public class IdFunction extends BaseFunction
this.methodId = id;
}
public static void define(Scriptable scope, String name,
IdFunctionMaster master, int id)
{
define(scope, name, master, id, ScriptableObject.DONTENUM, false);
}
public static void define(Scriptable scope, String name,
IdFunctionMaster master, int id,
int attributes)
{
define(scope, name, master, id, attributes, false);
}
public static void define(Scriptable scope, String name,
IdFunctionMaster master, int id,
int attributes, boolean sealed)
{
IdFunction f = new IdFunction(master, name, id);
f.setParentScope(scope);
if (sealed) { f.sealObject(); }
ScriptableObject.defineProperty(scope, name, f, attributes);
}
public final int functionType() {
return functionType;
}