If scripted constructor function causes an exception, let it pass through
(i.e. rethrow it).
This commit is contained in:
parent
55dd6f9cd0
commit
0e03e7a542
1 changed files with 9 additions and 3 deletions
|
@ -54,11 +54,17 @@ public class NodeConstructor extends BuiltinFunctionObject {
|
||||||
// with the name of the type.
|
// with the name of the type.
|
||||||
// HACK: There is an incompatibility problem here, because the property
|
// HACK: There is an incompatibility problem here, because the property
|
||||||
// constructor is defined as the constructor of the object by EcmaScript.
|
// constructor is defined as the constructor of the object by EcmaScript.
|
||||||
if (op.getProperty ("constructor", "constructor".hashCode()) instanceof ConstructedFunctionObject)
|
if (op.getProperty ("constructor",
|
||||||
|
"constructor".hashCode())
|
||||||
|
instanceof ConstructedFunctionObject)
|
||||||
node.doIndirectCall (engine.getEvaluator(), node, "constructor", arguments);
|
node.doIndirectCall (engine.getEvaluator(), node, "constructor", arguments);
|
||||||
else
|
else if (op.getProperty (typename,
|
||||||
|
typename.hashCode())
|
||||||
|
instanceof ConstructedFunctionObject)
|
||||||
node.doIndirectCall (engine.getEvaluator(), node, typename, arguments);
|
node.doIndirectCall (engine.getEvaluator(), node, typename, arguments);
|
||||||
} catch (Exception ignore) {}
|
} catch (Exception x) {
|
||||||
|
throw new EcmaScriptException (x.toString());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue