summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Examples/test-suite/javascript/class_scope_weird_runme.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/Examples/test-suite/javascript/class_scope_weird_runme.js b/Examples/test-suite/javascript/class_scope_weird_runme.js
index 73c118d61..ca18c1b4d 100644
--- a/Examples/test-suite/javascript/class_scope_weird_runme.js
+++ b/Examples/test-suite/javascript/class_scope_weird_runme.js
@@ -4,3 +4,14 @@ f = new class_scope_weird.Foo();
g = new class_scope_weird.Foo(3);
if (f.bar(3) != 3)
throw RuntimeError;
+
+// Test missing new keyword during constructor call
+var caughtException = false;
+try {
+ g = class_scope_weird.Foo(4);
+} catch (err) {
+ caughtException = true;
+}
+if (!caughtException) {
+ throw new Error("Instantiation exception not thrown");
+}