summaryrefslogtreecommitdiff
path: root/external/contributions/Google/sputnik_conformance_modified/13_Function_Definition/13.2_Creating_Function_Objects/S13.2.2_A9.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_A9.js')
-rw-r--r--external/contributions/Google/sputnik_conformance_modified/13_Function_Definition/13.2_Creating_Function_Objects/S13.2.2_A9.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_A9.js b/external/contributions/Google/sputnik_conformance_modified/13_Function_Definition/13.2_Creating_Function_Objects/S13.2.2_A9.js
new file mode 100644
index 000000000..ef7e72cb8
--- /dev/null
+++ b/external/contributions/Google/sputnik_conformance_modified/13_Function_Definition/13.2_Creating_Function_Objects/S13.2.2_A9.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_A9;
+* @section: 13.2.2;
+* @assertion: Calling a function as a constructor is inadmissible as long as this.any_Function is called before it is declared;
+* @description: Calling a function as a constructor
+*/
+
+function FACTORY(){
+ this.id = 0;
+
+ this.id = this.func();
+
+ this.func = function (){
+ return 5;
+ }
+
+}
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+try {
+ var obj = new FACTORY();
+ $ERROR('#1: var obj = new FACTORY() lead to throwing exception');
+} catch (e) {}
+//
+//////////////////////////////////////////////////////////////////////////////