From 0e03e7a5423adcb97e3fa19339d1739f4f95df73 Mon Sep 17 00:00:00 2001 From: hns Date: Tue, 28 Jan 2003 13:09:16 +0000 Subject: [PATCH] If scripted constructor function causes an exception, let it pass through (i.e. rethrow it). --- src/helma/scripting/fesi/NodeConstructor.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/helma/scripting/fesi/NodeConstructor.java b/src/helma/scripting/fesi/NodeConstructor.java index 40f1f3b3..6c9d278b 100644 --- a/src/helma/scripting/fesi/NodeConstructor.java +++ b/src/helma/scripting/fesi/NodeConstructor.java @@ -54,11 +54,17 @@ public class NodeConstructor extends BuiltinFunctionObject { // with the name of the type. // HACK: There is an incompatibility problem here, because the property // 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); - else + else if (op.getProperty (typename, + typename.hashCode()) + instanceof ConstructedFunctionObject) node.doIndirectCall (engine.getEvaluator(), node, typename, arguments); - } catch (Exception ignore) {} + } catch (Exception x) { + throw new EcmaScriptException (x.toString()); + } } return node; }