summaryrefslogtreecommitdiff
path: root/external/contributions/Google/sputnik_conformance_modified/15_Native/15.3_Function_Objects/15.3.5_Properties_of_Function_Instances/S15.3.5.3_A2_T5.js
diff options
context:
space:
mode:
Diffstat (limited to 'external/contributions/Google/sputnik_conformance_modified/15_Native/15.3_Function_Objects/15.3.5_Properties_of_Function_Instances/S15.3.5.3_A2_T5.js')
-rw-r--r--external/contributions/Google/sputnik_conformance_modified/15_Native/15.3_Function_Objects/15.3.5_Properties_of_Function_Instances/S15.3.5.3_A2_T5.js36
1 files changed, 36 insertions, 0 deletions
diff --git a/external/contributions/Google/sputnik_conformance_modified/15_Native/15.3_Function_Objects/15.3.5_Properties_of_Function_Instances/S15.3.5.3_A2_T5.js b/external/contributions/Google/sputnik_conformance_modified/15_Native/15.3_Function_Objects/15.3.5_Properties_of_Function_Instances/S15.3.5.3_A2_T5.js
new file mode 100644
index 000000000..74ccf48a5
--- /dev/null
+++ b/external/contributions/Google/sputnik_conformance_modified/15_Native/15.3_Function_Objects/15.3.5_Properties_of_Function_Instances/S15.3.5.3_A2_T5.js
@@ -0,0 +1,36 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * @name: S15.3.5.3_A2_T5;
+ * @section: 15.3.5.3, 11.8.6;
+ * @assertion: Assume F is a Function object. When the [[HasInstance]] method of
+ * F is called with value V and V is an object, the following steps
+ * are taken: i) Call the [[Get]] method of F with property name
+ * "prototype". ii) Let O be Result(i). iii) O is not an object,
+ * throw a TypeError exception;
+ * @description: F.prototype is void 0, and V is new F;
+ */
+
+FACTORY = Function("this.prop=1;");
+
+FACTORY.prototype.name = "fairy";
+
+instance = new FACTORY;
+
+FACTORY.prototype = void 0;
+
+// CHECK#1
+try {
+ instance instanceof FACTORY;
+ $FAIL('#1: O is not an object, throw a TypeError exception');
+} catch (e) {
+ if (!(e instanceof TypeError)) {
+ $ERROR('#1.1: O is not an object, throw a TypeError exception');
+ }
+}
+
+// CHECK#2
+if ((instance.constructor !== FACTORY) || (instance.name !== "fairy")) {
+ $ERROR('#2: instance.constructor === FACTORY');
+}