summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/ch12/12.13
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /js/src/tests/test262/ch12/12.13
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'js/src/tests/test262/ch12/12.13')
-rw-r--r--js/src/tests/test262/ch12/12.13/S12.13_A1.js13
-rw-r--r--js/src/tests/test262/ch12/12.13/S12.13_A2_T1.js18
-rw-r--r--js/src/tests/test262/ch12/12.13/S12.13_A2_T2.js18
-rw-r--r--js/src/tests/test262/ch12/12.13/S12.13_A2_T3.js44
-rw-r--r--js/src/tests/test262/ch12/12.13/S12.13_A2_T4.js27
-rw-r--r--js/src/tests/test262/ch12/12.13/S12.13_A2_T5.js75
-rw-r--r--js/src/tests/test262/ch12/12.13/S12.13_A2_T6.js45
-rw-r--r--js/src/tests/test262/ch12/12.13/S12.13_A2_T7.js30
-rw-r--r--js/src/tests/test262/ch12/12.13/S12.13_A3_T1.js45
-rw-r--r--js/src/tests/test262/ch12/12.13/S12.13_A3_T2.js28
-rw-r--r--js/src/tests/test262/ch12/12.13/S12.13_A3_T3.js92
-rw-r--r--js/src/tests/test262/ch12/12.13/S12.13_A3_T4.js56
-rw-r--r--js/src/tests/test262/ch12/12.13/S12.13_A3_T5.js20
-rw-r--r--js/src/tests/test262/ch12/12.13/S12.13_A3_T6.js58
-rw-r--r--js/src/tests/test262/ch12/12.13/browser.js0
-rw-r--r--js/src/tests/test262/ch12/12.13/shell.js0
16 files changed, 569 insertions, 0 deletions
diff --git a/js/src/tests/test262/ch12/12.13/S12.13_A1.js b/js/src/tests/test262/ch12/12.13/S12.13_A1.js
new file mode 100644
index 000000000..bc2463577
--- /dev/null
+++ b/js/src/tests/test262/ch12/12.13/S12.13_A1.js
@@ -0,0 +1,13 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * Sanity test for throw statement
+ *
+ * @path ch12/12.13/S12.13_A1.js
+ * @description Trying to throw exception with "throw"
+ * @negative
+ */
+
+throw "error";
+
diff --git a/js/src/tests/test262/ch12/12.13/S12.13_A2_T1.js b/js/src/tests/test262/ch12/12.13/S12.13_A2_T1.js
new file mode 100644
index 000000000..bca31ea80
--- /dev/null
+++ b/js/src/tests/test262/ch12/12.13/S12.13_A2_T1.js
@@ -0,0 +1,18 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * "throw Expression" returns (throw, GetValue(Result(1)), empty), where 1 evaluates Expression
+ *
+ * @path ch12/12.13/S12.13_A2_T1.js
+ * @description Throwing undefined
+ */
+
+// CHECK#1
+try{
+ throw undefined;
+}
+catch(e){
+ if (e!==undefined) $ERROR('#1: Exception === undefined. Actual: Exception ==='+ e );
+}
+
diff --git a/js/src/tests/test262/ch12/12.13/S12.13_A2_T2.js b/js/src/tests/test262/ch12/12.13/S12.13_A2_T2.js
new file mode 100644
index 000000000..e068f39f6
--- /dev/null
+++ b/js/src/tests/test262/ch12/12.13/S12.13_A2_T2.js
@@ -0,0 +1,18 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * "throw Expression" returns (throw, GetValue(Result(1)), empty), where 1 evaluates Expression
+ *
+ * @path ch12/12.13/S12.13_A2_T2.js
+ * @description Throwing null
+ */
+
+// CHECK#1
+try{
+ throw null;
+}
+catch(e){
+ if (e!==null) $ERROR('#1: Exception === null. Actual: Exception ==='+ e );
+}
+
diff --git a/js/src/tests/test262/ch12/12.13/S12.13_A2_T3.js b/js/src/tests/test262/ch12/12.13/S12.13_A2_T3.js
new file mode 100644
index 000000000..37592ac19
--- /dev/null
+++ b/js/src/tests/test262/ch12/12.13/S12.13_A2_T3.js
@@ -0,0 +1,44 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * "throw Expression" returns (throw, GetValue(Result(1)), empty), where 1 evaluates Expression
+ *
+ * @path ch12/12.13/S12.13_A2_T3.js
+ * @description Throwing boolean
+ */
+
+// CHECK#1
+try{
+ throw true;
+}
+catch(e){
+ if (e!==true) $ERROR('#1: Exception ===true. Actual: Exception ==='+ e );
+}
+
+// CHECK#2
+try{
+ throw false;
+}
+catch(e){
+ if (e!==false) $ERROR('#2: Exception ===false. Actual: Exception ==='+ e );
+}
+
+// CHECK#3
+var b=false;
+try{
+ throw b;
+}
+catch(e){
+ if (e!==false) $ERROR('#3: Exception ===false. Actual: Exception ==='+ e );
+}
+
+// CHECK#4
+var b=true;
+try{
+ throw b;
+}
+catch(e){
+ if (e!==true) $ERROR('#4: Exception ===true. Actual: Exception ==='+ e );
+}
+
diff --git a/js/src/tests/test262/ch12/12.13/S12.13_A2_T4.js b/js/src/tests/test262/ch12/12.13/S12.13_A2_T4.js
new file mode 100644
index 000000000..bddf2dac3
--- /dev/null
+++ b/js/src/tests/test262/ch12/12.13/S12.13_A2_T4.js
@@ -0,0 +1,27 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * "throw Expression" returns (throw, GetValue(Result(1)), empty), where 1 evaluates Expression
+ *
+ * @path ch12/12.13/S12.13_A2_T4.js
+ * @description Throwing string
+ */
+
+// CHECK#1
+try{
+ throw "exception #1";
+}
+catch(e){
+ if (e!=="exception #1") $ERROR('#1: Exception ==="exception #1". Actual: Exception ==='+ e );
+}
+
+// CHECK#2
+var b="exception #1";
+try{
+ throw b;
+}
+catch(e){
+ if (e!=="exception #1") $ERROR('#2: Exception ==="exception #1". Actual: Exception ==='+ e );
+}
+
diff --git a/js/src/tests/test262/ch12/12.13/S12.13_A2_T5.js b/js/src/tests/test262/ch12/12.13/S12.13_A2_T5.js
new file mode 100644
index 000000000..8d8084849
--- /dev/null
+++ b/js/src/tests/test262/ch12/12.13/S12.13_A2_T5.js
@@ -0,0 +1,75 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * "throw Expression" returns (throw, GetValue(Result(1)), empty), where 1 evaluates Expression
+ *
+ * @path ch12/12.13/S12.13_A2_T5.js
+ * @description Throwing number
+ */
+
+// CHECK#1
+try{
+ throw 13;
+}
+catch(e){
+ if (e!==13) $ERROR('#1: Exception ===13. Actual: Exception ==='+ e );
+}
+
+// CHECK#2
+var b=13;
+try{
+ throw b;
+}
+catch(e){
+ if (e!==13) $ERROR('#2: Exception ===13. Actual: Exception ==='+ e );
+}
+
+// CHECK#3
+try{
+ throw 2.13;
+}
+catch(e){
+ if (e!==2.13) $ERROR('#3: Exception ===2.13. Actual: Exception ==='+ e );
+}
+
+// CHECK#4
+try{
+ throw NaN;
+}
+catch(e){
+ if (!isNaN(e)) $ERROR('#4: Exception is NaN');
+}
+
+// CHECK#5
+try{
+ throw +Infinity;
+}
+catch(e){
+ if (e!==+Infinity) $ERROR('#5: Exception ===+Infinity. Actual: Exception ==='+ e );
+}
+
+// CHECK#6
+try{
+ throw -Infinity;
+}
+catch(e){
+ if (e!==-Infinity) $ERROR('#6: Exception ===-Infinity. Actual: Exception ==='+ e );
+}
+
+// CHECK#7
+try{
+ throw +0;
+}
+catch(e){
+ if (e!==+0) $ERROR('#7: Exception ===+0. Actual: Exception ==='+ e );
+}
+
+// CHECK#8
+try{
+ throw -0;
+}
+catch(e){
+ if (e!==-0) $ERROR('#8: Exception ===-0. Actual: Exception ==='+ e );
+}
+
diff --git a/js/src/tests/test262/ch12/12.13/S12.13_A2_T6.js b/js/src/tests/test262/ch12/12.13/S12.13_A2_T6.js
new file mode 100644
index 000000000..39e799852
--- /dev/null
+++ b/js/src/tests/test262/ch12/12.13/S12.13_A2_T6.js
@@ -0,0 +1,45 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * "throw Expression" returns (throw, GetValue(Result(1)), empty), where 1 evaluates Expression
+ *
+ * @path ch12/12.13/S12.13_A2_T6.js
+ * @description Throwing object
+ */
+
+var myObj = {p1: 'a',
+ p2: 'b',
+ p3: 'c',
+ value: 'myObj_value',
+ valueOf : function(){return 'obj_valueOf';},
+ parseInt : function(){return 'obj_parseInt';},
+ NaN : 'obj_NaN',
+ Infinity : 'obj_Infinity',
+ eval : function(){return 'obj_eval';},
+ parseFloat : function(){return 'obj_parseFloat';},
+ isNaN : function(){return 'obj_isNaN';},
+ isFinite : function(){return 'obj_isFinite';},
+ i:7
+}
+
+try{
+ throw myObj;
+}
+catch(e){
+// CHECK#1
+ if (e.p1!=="a") $ERROR('#1: e.p1 === "a". Actual: e.p1 ==='+ e.p1 );
+// CHECK#2
+ if (e.value!=='myObj_value') $ERROR('#2: e.p1 === \'myObj_value\'. Actual: e.p1 ==='+ e.p1 );
+// CHECK#3
+ if (e.eval()!=='obj_eval') $ERROR('#3: e.p1 === \'obj_eval\'. Actual: e.p1 ==='+ e.p1 );
+}
+
+// CHECK#4
+myObj.i=6
+try{
+ throw myObj;
+}
+catch(e){}
+if (myObj.i!==6) $ERROR('#4: Handling of catch must be correct');
+
diff --git a/js/src/tests/test262/ch12/12.13/S12.13_A2_T7.js b/js/src/tests/test262/ch12/12.13/S12.13_A2_T7.js
new file mode 100644
index 000000000..bf633f868
--- /dev/null
+++ b/js/src/tests/test262/ch12/12.13/S12.13_A2_T7.js
@@ -0,0 +1,30 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * "throw Expression" returns (throw, GetValue(Result(1)), empty), where 1 evaluates Expression
+ *
+ * @path ch12/12.13/S12.13_A2_T7.js
+ * @description Throwing Array
+ */
+
+var mycars = new Array();
+mycars[0] = "Saab";
+mycars[1] = "Volvo";
+mycars[2] = "BMW";
+
+var mycars2 = new Array();
+mycars2[0] = "Mercedes";
+mycars2[1] = "Jeep";
+mycars2[2] = "Suzuki";
+
+// CHECK#1
+try{
+ throw mycars;
+}
+catch(e){
+ for (var i=0;i<3;i++){
+ if (e[i]!==mycars[i]) $ERROR('#1.'+i+': Exception['+i+'] === mycars['+i+']. Actual: Exception['+i+'] ==='+ e[i] );
+ }
+}
+
diff --git a/js/src/tests/test262/ch12/12.13/S12.13_A3_T1.js b/js/src/tests/test262/ch12/12.13/S12.13_A3_T1.js
new file mode 100644
index 000000000..7843a6459
--- /dev/null
+++ b/js/src/tests/test262/ch12/12.13/S12.13_A3_T1.js
@@ -0,0 +1,45 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * 1. Evaluate Expression
+ *
+ * @path ch12/12.13/S12.13_A3_T1.js
+ * @description Evaluating boolean expression
+ */
+
+// CHECK#1
+var b=true;
+try{
+ throw b&&false;
+}
+catch(e){
+ if (e!==false) $ERROR('#1: Exception === false(operaton &&). Actual: Exception ==='+ e );
+}
+
+// CHECK#2
+var b=true;
+try{
+ throw b||false;
+}
+catch(e){
+ if (e!==true) $ERROR('#2: Exception === true(operaton ||). Actual: Exception ==='+ e );
+}
+
+// CHECK#3
+try{
+ throw !false;
+}
+catch(e){
+ if (e!==true) $ERROR('#3: Exception === true(operaton !). Actual: Exception ==='+ e );
+}
+
+// CHECK#4
+var b=true;
+try{
+ throw !(b&&false);
+}
+catch(e){
+ if (e!==true) $ERROR('#4: Exception === true(operaton &&). Actual: Exception ==='+ e );
+}
+
diff --git a/js/src/tests/test262/ch12/12.13/S12.13_A3_T2.js b/js/src/tests/test262/ch12/12.13/S12.13_A3_T2.js
new file mode 100644
index 000000000..f8cb92203
--- /dev/null
+++ b/js/src/tests/test262/ch12/12.13/S12.13_A3_T2.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.
+
+/**
+ * 1. Evaluate Expression
+ *
+ * @path ch12/12.13/S12.13_A3_T2.js
+ * @description Evaluating string expression
+ */
+
+// CHECK#1
+try{
+ throw "exception"+" #1";
+}
+catch(e){
+ if (e!=="exception #1") $ERROR('#1: Exception === "exception #1"(operaton +). Actual: Exception ==='+ e );
+}
+
+// CHECK#2
+var b="exception"
+var a=" #1";
+try{
+ throw b+a;
+}
+catch(e){
+ if (e!=="exception #1") $ERROR('#2: Exception === "exception #1"(operaton +). Actual: Exception ==='+ e );
+}
+
diff --git a/js/src/tests/test262/ch12/12.13/S12.13_A3_T3.js b/js/src/tests/test262/ch12/12.13/S12.13_A3_T3.js
new file mode 100644
index 000000000..44c9d075c
--- /dev/null
+++ b/js/src/tests/test262/ch12/12.13/S12.13_A3_T3.js
@@ -0,0 +1,92 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * 1. Evaluate Expression
+ *
+ * @path ch12/12.13/S12.13_A3_T3.js
+ * @description Evaluating number expression
+ */
+
+// CHECK#1
+try{
+ throw 10+3;
+}
+catch(e){
+ if (e!==13) $ERROR('#1: Exception ===13(operaton +). Actual: Exception ==='+ e);
+}
+
+// CHECK#2
+var b=10;
+var a=3;
+try{
+ throw a+b;
+}
+catch(e){
+ if (e!==13) $ERROR('#2: Exception ===13(operaton +). Actual: Exception ==='+ e);
+}
+
+// CHECK#3
+try{
+ throw 3.15-1.02;
+}
+catch(e){
+ if (e!==2.13) $ERROR('#3: Exception ===2.13(operaton -). Actual: Exception ==='+ e);
+}
+
+// CHECK#4
+try{
+ throw 2*2;
+}
+catch(e){
+ if (e!==4) $ERROR('#4: Exception ===4(operaton *). Actual: Exception ==='+ e);
+}
+
+// CHECK#5
+try{
+ throw 1+Infinity;
+}
+catch(e){
+ if (e!==+Infinity) $ERROR('#5: Exception ===+Infinity(operaton +). Actual: Exception ==='+ e);
+}
+
+// CHECK#6
+try{
+ throw 1-Infinity;
+}
+catch(e){
+ if (e!==-Infinity) $ERROR('#6: Exception ===-Infinity(operaton -). Actual: Exception ==='+ e);
+}
+
+// CHECK#7
+try{
+ throw 10/5;
+}
+catch(e){
+ if (e!==2) $ERROR('#7: Exception ===2(operaton /). Actual: Exception ==='+ e);
+}
+
+// CHECK#8
+try{
+ throw 8>>2;
+}
+catch(e){
+ if (e!==2) $ERROR('#8: Exception ===2(operaton >>). Actual: Exception ==='+ e);
+}
+
+// CHECK#9
+try{
+ throw 2<<2;
+}
+catch(e){
+ if (e!==8) $ERROR('#9: Exception ===8(operaton <<). Actual: Exception ==='+ e);
+}
+
+// CHECK#10
+try{
+ throw 123%100;
+}
+catch(e){
+ if (e!==23) $ERROR('#10: Exception ===23(operaton %). Actual: Exception ==='+ e);
+}
+
diff --git a/js/src/tests/test262/ch12/12.13/S12.13_A3_T4.js b/js/src/tests/test262/ch12/12.13/S12.13_A3_T4.js
new file mode 100644
index 000000000..9a6e010f0
--- /dev/null
+++ b/js/src/tests/test262/ch12/12.13/S12.13_A3_T4.js
@@ -0,0 +1,56 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * 1. Evaluate Expression
+ *
+ * @path ch12/12.13/S12.13_A3_T4.js
+ * @description Evaluating array expression
+ */
+
+var mycars = new Array();
+mycars[0] = "Saab";
+mycars[1] = "Volvo";
+mycars[2] = "BMW";
+
+var mycars2 = new Array();
+mycars2[0] = "Mercedes";
+mycars2[1] = "Jeep";
+mycars2[2] = "Suzuki";
+
+// CHECK#1
+try{
+ throw mycars.concat(mycars2);
+}
+catch(e){
+ for (var i=0;i<3;i++){
+ if (e[i]!==mycars[i]) $ERROR('#1.'+i+': Exception['+i+']===mycars['+i+'](operation .concat). Actual: Exception['+i+']==='+ e[i] );
+ }
+ for (var i=3;i<6;i++){
+ if (e[i]!==mycars2[i-3]) $ERROR('#1.'+i+': Exception['+i+']===mycars2['+(i-3)+'](operation .concat). Actual: Exception['+i+']==='+ e[i] );
+ }
+}
+
+// CHECK#2
+try{
+ throw new Array("Mercedes","Jeep","Suzuki");
+}
+catch(e){
+ for (var i=0;i<3;i++){
+ if (e[i]!==mycars2[i]) $ERROR('#2.'+i+': Exception['+i+']===mycars2['+i+'](operation new). Actual: Exception['+i+']==='+ e[i] );
+ }
+}
+
+// CHECK#3
+try{
+ throw mycars.concat(new Array("Mercedes","Jeep","Suzuki"));
+}
+catch(e){
+ for (var i=0;i<3;i++){
+ if (e[i]!==mycars[i]) $ERROR('#3.'+i+': Exception['+i+']===mycars['+i+'](operation .concat(new)). Actual: Exception['+i+']==='+ e[i] );
+ }
+ for (var i=3;i<6;i++){
+ if (e[i]!==mycars2[i-3]) $ERROR('#3.'+i+': Exception['+i+']===mycars2['+(i-3)+'](operation .concat(new)). Actual: Exception['+i+']==='+ e[i] );
+ }
+}
+
diff --git a/js/src/tests/test262/ch12/12.13/S12.13_A3_T5.js b/js/src/tests/test262/ch12/12.13/S12.13_A3_T5.js
new file mode 100644
index 000000000..69fb016d5
--- /dev/null
+++ b/js/src/tests/test262/ch12/12.13/S12.13_A3_T5.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.
+
+/**
+ * 1. Evaluate Expression
+ *
+ * @path ch12/12.13/S12.13_A3_T5.js
+ * @description Evaluating equation expression
+ */
+
+// CHECK#1
+var a=true;
+var b=false;
+try{
+ throw ((a&&(!b))?"exception":" #1");
+}
+catch(e){
+ if (e!=="exception") $ERROR('#1: Exception ==="exception"(operaton ? , ). Actual: Exception ==='+e );
+}
+
diff --git a/js/src/tests/test262/ch12/12.13/S12.13_A3_T6.js b/js/src/tests/test262/ch12/12.13/S12.13_A3_T6.js
new file mode 100644
index 000000000..7191c6bd6
--- /dev/null
+++ b/js/src/tests/test262/ch12/12.13/S12.13_A3_T6.js
@@ -0,0 +1,58 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * 1. Evaluate Expression
+ *
+ * @path ch12/12.13/S12.13_A3_T6.js
+ * @description Evaluating functions
+ */
+
+// CHECK#1
+var i=0;
+function adding1(){
+ i++;
+ return 1;
+}
+try{
+ throw (adding1());
+}
+catch(e){
+ if (e!==1) $ERROR('#1: Exception ===1. Actual: Exception ==='+ e);
+}
+
+// CHECK#2
+var i=0;
+function adding2(){
+ i++;
+ return i;
+}
+try{
+ throw adding2();
+}
+catch(e){}
+if (i!==1) $ERROR('#2: i===1. Actual: i==='+ i);
+
+// CHECK#3
+var i=0;
+function adding3(){
+ i++;
+}
+try{
+ throw adding3();
+}
+catch(e){}
+if (i!==1) $ERROR('#3: i===1. Actual: i==='+i);
+
+// CHECK#4
+function adding4(i){
+ i++;
+ return i;
+}
+try{
+ throw (adding4(1));
+}
+catch(e){
+ if (e!==2) $ERROR('#4: Exception ===2. Actual: Exception ==='+ e);
+}
+
diff --git a/js/src/tests/test262/ch12/12.13/browser.js b/js/src/tests/test262/ch12/12.13/browser.js
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/js/src/tests/test262/ch12/12.13/browser.js
diff --git a/js/src/tests/test262/ch12/12.13/shell.js b/js/src/tests/test262/ch12/12.13/shell.js
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/js/src/tests/test262/ch12/12.13/shell.js