Create a constructor for the user prototype so it's possible to create
user object usnig "new user()".
This commit is contained in:
parent
86d7f7d00d
commit
84e0eb7748
1 changed files with 3 additions and 4 deletions
|
@ -155,8 +155,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)) {
|
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));
|
||||||
|
|
Loading…
Add table
Reference in a new issue