summaryrefslogtreecommitdiff
path: root/test/suite/ch15/15.11/15.11.1
diff options
context:
space:
mode:
authorDavid Fugate <dfugate@microsoft.com>2011-10-03 12:20:26 -0700
committerDavid Fugate <dfugate@microsoft.com>2011-10-03 12:20:26 -0700
commit8aa878d3aff9785f4b8c1207b1adbec07a6ff790 (patch)
tree7cceccd22522fa9ceacd8f8b0ab510567f5c7c27 /test/suite/ch15/15.11/15.11.1
parentd032342322ca26edb5aa34939cda434538e8aefb (diff)
downloadtest262-8aa878d3aff9785f4b8c1207b1adbec07a6ff790.tar.gz
Renamed Sputnik directories.
Diffstat (limited to 'test/suite/ch15/15.11/15.11.1')
-rw-r--r--test/suite/ch15/15.11/15.11.1/S15.11.1.1_A1_T1.js52
-rw-r--r--test/suite/ch15/15.11/15.11.1/S15.11.1.1_A2_T1.js20
-rw-r--r--test/suite/ch15/15.11/15.11.1/S15.11.1.1_A3_T1.js20
-rw-r--r--test/suite/ch15/15.11/15.11.1/S15.11.1_A1_T1.js21
4 files changed, 113 insertions, 0 deletions
diff --git a/test/suite/ch15/15.11/15.11.1/S15.11.1.1_A1_T1.js b/test/suite/ch15/15.11/15.11.1/S15.11.1.1_A1_T1.js
new file mode 100644
index 000000000..bbde5f28e
--- /dev/null
+++ b/test/suite/ch15/15.11/15.11.1/S15.11.1.1_A1_T1.js
@@ -0,0 +1,52 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * If the argument "message" is not undefined, the message property of the newly constructed object is
+ * set to ToString(message)
+ *
+ * @path 15_Native/15.11_Error_Objects/15.11.1_The_Error_Constructor_Called_as_a_Function/S15.11.1.1_A1_T1.js
+ * @description Checking message property of different error objects
+ */
+
+function otherScope(msg)
+{
+ return Error(msg);
+}
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+var err1=Error('msg1');
+if(err1.message!=="msg1"){
+ $ERROR('#1: var err1=Error(\'msg1\'); err1.message==="msg1". Actual: '+err1.message);
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#2
+var err2=otherScope('msg2');
+if(err2.message!=="msg2"){
+ $ERROR('#2: function otherScope(msg){return Error(msg);} var err2=otherScope(\'msg2\'); err2.message==="msg2". Actual: '+err2.message);
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#3
+var err3=otherScope();
+if(err3.hasOwnProperty('message')){
+ $ERROR('#3: function otherScope(msg){return Error(msg);} var err3=otherScope(); err3.hasOwnProperty("message"). Actual: '+err3.message);
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#4
+var err4=eval("Error('msg4')");
+if(err4.message!=="msg4"){
+ $ERROR('#4: var err4=eval("Error(\'msg4\')"); err4.message==="msg4". Actual: '+err4.message);
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
diff --git a/test/suite/ch15/15.11/15.11.1/S15.11.1.1_A2_T1.js b/test/suite/ch15/15.11/15.11.1/S15.11.1.1_A2_T1.js
new file mode 100644
index 000000000..8b4a0a7ed
--- /dev/null
+++ b/test/suite/ch15/15.11/15.11.1/S15.11.1.1_A2_T1.js
@@ -0,0 +1,20 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * The [[Prototype]] property of the newly constructed object is set to the original Error prototype
+ * object, the one that is the initial value of Error.prototype (15.11.3.1)
+ *
+ * @path 15_Native/15.11_Error_Objects/15.11.1_The_Error_Constructor_Called_as_a_Function/S15.11.1.1_A2_T1.js
+ * @description Checking prototype of the newly constructed Error object
+ */
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+var err1=Error('msg1');
+if(!Error.prototype.isPrototypeOf(err1)){
+ $ERROR('#1: var err1=Error(\'msg1\'); Error.prototype.isPrototypeOf(err1) return true. Actual: '+Error.prototype.isPrototypeOf(err1));
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
diff --git a/test/suite/ch15/15.11/15.11.1/S15.11.1.1_A3_T1.js b/test/suite/ch15/15.11/15.11.1/S15.11.1.1_A3_T1.js
new file mode 100644
index 000000000..4681bf0a8
--- /dev/null
+++ b/test/suite/ch15/15.11/15.11.1/S15.11.1.1_A3_T1.js
@@ -0,0 +1,20 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * The [[Class]] property of the newly constructed object is set to "Error"
+ *
+ * @path 15_Native/15.11_Error_Objects/15.11.1_The_Error_Constructor_Called_as_a_Function/S15.11.1.1_A3_T1.js
+ * @description Checking Class of the newly constructed Error object using toSting() function
+ */
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+Error.prototype.toString=Object.prototype.toString;
+var err1=Error();
+if(err1.toString()!=='[object '+ 'Error' +']'){
+ $ERROR('#1: Error.prototype.toString=Object.prototype.toString; var err1=Error(); err1.toString()===\'[object Error]\'. Actual: '+err1.toString());
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
diff --git a/test/suite/ch15/15.11/15.11.1/S15.11.1_A1_T1.js b/test/suite/ch15/15.11/15.11.1/S15.11.1_A1_T1.js
new file mode 100644
index 000000000..c576a4d24
--- /dev/null
+++ b/test/suite/ch15/15.11/15.11.1/S15.11.1_A1_T1.js
@@ -0,0 +1,21 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * The function call Error(...) is equivalent to the object creation expression new
+ * Error(...) with the same arguments
+ *
+ * @path 15_Native/15.11_Error_Objects/15.11.1_The_Error_Constructor_Called_as_a_Function/S15.11.1_A1_T1.js
+ * @description Checking constructor of the newly constructed Error object
+ */
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+Error.prototype.toString=Object.prototype.toString;
+var err1=Error();
+if(err1.constructor!==Error){
+ $ERROR('#1: Error.prototype.toString=Object.prototype.toString; var err1=Error(); err1.constructor===Error. Actual: '+err1.constructor);
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+