summaryrefslogtreecommitdiff
path: root/external/contributions/Google/sputnik_conformance_modified/13_Function_Definition/13.2_Creating_Function_Objects/S13.2.2_A14.js
diff options
context:
space:
mode:
Diffstat (limited to 'external/contributions/Google/sputnik_conformance_modified/13_Function_Definition/13.2_Creating_Function_Objects/S13.2.2_A14.js')
-rw-r--r--external/contributions/Google/sputnik_conformance_modified/13_Function_Definition/13.2_Creating_Function_Objects/S13.2.2_A14.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/external/contributions/Google/sputnik_conformance_modified/13_Function_Definition/13.2_Creating_Function_Objects/S13.2.2_A14.js b/external/contributions/Google/sputnik_conformance_modified/13_Function_Definition/13.2_Creating_Function_Objects/S13.2.2_A14.js
new file mode 100644
index 000000000..c668d6bdf
--- /dev/null
+++ b/external/contributions/Google/sputnik_conformance_modified/13_Function_Definition/13.2_Creating_Function_Objects/S13.2.2_A14.js
@@ -0,0 +1,28 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+* @name: S13.2.2_A14;
+* @section: 13.2.2;
+* @assertion: Calling a function as a constructor is inadmissible as long as this.any_Function is declared by eval and called;
+* @description: Calling a function as a constructor after it has been declared by eval;
+* @non_strict_only
+*/
+
+function FACTORY(){
+ this.id = 0;
+
+ eval("function func(){return \"id_string\";}");
+
+ this.id = func();
+
+}
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+try {
+ var obj = new FACTORY();
+} catch (e) {
+ $ERROR('#1: var obj = new FACTORY() does not lead to throwing exception');
+}
+//
+//////////////////////////////////////////////////////////////////////////////