Create a constructor for the user prototype so it's possible to create

user object usnig "new user()".
This commit is contained in:
hns 2002-06-18 10:26:24 +00:00
parent 86d7f7d00d
commit 84e0eb7748

View file

@ -154,9 +154,8 @@ public final class FesiEvaluator implements ScriptingEngine {
// Register a constructor for all types except global. // Register a constructor for all types except global.
// This will first create a new prototyped hopobject and then calls // This will first create a new prototyped hopobject and then calls
// the actual (scripted) constructor on it. // the actual (scripted) constructor on it.
if (!"global".equalsIgnoreCase (name)) { if (!"global".equalsIgnoreCase (name) && !"root".equalsIgnoreCase (name)) {
if (!"root".equalsIgnoreCase (name) && !"user".equalsIgnoreCase (name))
try { try {
FunctionPrototype fp = (FunctionPrototype) evaluator.getFunctionPrototype(); FunctionPrototype fp = (FunctionPrototype) evaluator.getFunctionPrototype();
global.putHiddenProperty (name, new NodeConstructor (name, fp, this)); global.putHiddenProperty (name, new NodeConstructor (name, fp, this));
@ -206,7 +205,7 @@ public final class FesiEvaluator implements ScriptingEngine {
// Register a constructor for all types except global. // Register a constructor for all types except global.
// This will first create a new prototyped hopobject and then calls // This will first create a new prototyped hopobject and then calls
// the actual (scripted) constructor on it. // the actual (scripted) constructor on it.
if (!"global".equalsIgnoreCase (name) && !"root".equalsIgnoreCase (name) && !"user".equalsIgnoreCase (name)) { if (!"global".equalsIgnoreCase (name) && !"root".equalsIgnoreCase (name)) {
try { try {
FunctionPrototype fp = (FunctionPrototype) evaluator.getFunctionPrototype(); FunctionPrototype fp = (FunctionPrototype) evaluator.getFunctionPrototype();
global.putHiddenProperty (name, new NodeConstructor (name, fp, this)); global.putHiddenProperty (name, new NodeConstructor (name, fp, this));