diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /js/src/tests/test262/ch08/8.12/8.12.8 | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-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/ch08/8.12/8.12.8')
-rw-r--r-- | js/src/tests/test262/ch08/8.12/8.12.8/S8.12.8_A1.js | 26 | ||||
-rw-r--r-- | js/src/tests/test262/ch08/8.12/8.12.8/S8.12.8_A2.js | 26 | ||||
-rw-r--r-- | js/src/tests/test262/ch08/8.12/8.12.8/S8.12.8_A3.js | 28 | ||||
-rw-r--r-- | js/src/tests/test262/ch08/8.12/8.12.8/S8.12.8_A4.js | 24 | ||||
-rw-r--r-- | js/src/tests/test262/ch08/8.12/8.12.8/browser.js | 0 | ||||
-rw-r--r-- | js/src/tests/test262/ch08/8.12/8.12.8/shell.js | 0 |
6 files changed, 104 insertions, 0 deletions
diff --git a/js/src/tests/test262/ch08/8.12/8.12.8/S8.12.8_A1.js b/js/src/tests/test262/ch08/8.12/8.12.8/S8.12.8_A1.js new file mode 100644 index 000000000..9fa13f537 --- /dev/null +++ b/js/src/tests/test262/ch08/8.12/8.12.8/S8.12.8_A1.js @@ -0,0 +1,26 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * This should generate a TypeError, + * Cause we overload toString method so it return non Primitive value + * See ECMA reference at http://bugzilla.mozilla.org/show_bug.cgi?id=167325 + * + * @path ch08/8.12/8.12.8/S8.12.8_A1.js + * @description Try to overload toString method + */ + +try +{ + var __obj = {toString: function() {return new Object();}} + String(__obj); + $ERROR('#1.1: var __obj = {toString: function() {return new Object();}}; String(__obj) throw TypeError. Actual: ' + (String(__obj))); +} +catch(e) +{ + if ((e instanceof TypeError) !== true) { + $ERROR('#1.2: var __obj = {toString: function() {return new Object();}}; String(__obj) throw TypeError. Actual: ' + (e)); + } +} + + diff --git a/js/src/tests/test262/ch08/8.12/8.12.8/S8.12.8_A2.js b/js/src/tests/test262/ch08/8.12/8.12.8/S8.12.8_A2.js new file mode 100644 index 000000000..1a4cd4f91 --- /dev/null +++ b/js/src/tests/test262/ch08/8.12/8.12.8/S8.12.8_A2.js @@ -0,0 +1,26 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * This should generate no TypeError, + * Cause we overload toString method so it return non Primitive value + * but we overloaded valueOf method too. + * See ECMA reference at http://bugzilla.mozilla.org/show_bug.cgi?id=167325 + * + * @path ch08/8.12/8.12.8/S8.12.8_A2.js + * @description Try to overload toString, that returned new Object, and valueOf methods + */ + +try +{ + var __obj = {toString: function() {return new Object();}, valueOf: function() {return 1;}} + if (String(__obj) !== "1") { + $ERROR('#1.1: var __obj = {toString: function() {return new Object();}, valueOf: function() {return 1;}}; String(__obj) === "1". Actual: ' + (String(__obj))); + } +} +catch(e) +{ + $ERROR('#1.2: var __obj = {toString: function() {return new Object();}, valueOf: function() {return 1;}}; String(__obj) === "1". Actual: ' + (e)); +} + + diff --git a/js/src/tests/test262/ch08/8.12/8.12.8/S8.12.8_A3.js b/js/src/tests/test262/ch08/8.12/8.12.8/S8.12.8_A3.js new file mode 100644 index 000000000..a54d3c2a8 --- /dev/null +++ b/js/src/tests/test262/ch08/8.12/8.12.8/S8.12.8_A3.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. + +/** + * We overload valueOf method so it return non Primitive value + * Thus [[DefaultValue]] must return Object.toString() value + * + * @path ch08/8.12/8.12.8/S8.12.8_A3.js + * @description Try to overload toString method, that returned Primitive, and valueOf method, that returned new Object + */ + +try +{ + var __obj = {toString: function() {return "1"}, valueOf: function() {return new Object();}} + if (Number(__obj) !== 1) { + $ERROR('#1.1: var __obj = {toNumber: function() {return "1"}, valueOf: function() {return new Object();}}; Number(__obj) === 1. Actual: ' + (Number(__obj))); + } +} +catch(e) +{ + $ERROR('#1.2: var __obj = {toNumber: function() {return "1"}, valueOf: function() {return new Object();}}; Number(__obj) === 1. Actual: ' + (e)); +} + + + + + + diff --git a/js/src/tests/test262/ch08/8.12/8.12.8/S8.12.8_A4.js b/js/src/tests/test262/ch08/8.12/8.12.8/S8.12.8_A4.js new file mode 100644 index 000000000..cec14497b --- /dev/null +++ b/js/src/tests/test262/ch08/8.12/8.12.8/S8.12.8_A4.js @@ -0,0 +1,24 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * We overload valueOf method so it return non Primitive value and toString method so it return non Primitive value too + * Thus [[DefaultValue]] must generate TypeError error + * + * @path ch08/8.12/8.12.8/S8.12.8_A4.js + * @description Try to overload toString and valueOf methods, they returned new Objects + */ + +try +{ + var __obj = {valueOf:function(){return new Object;},toString: function() {return new Object();}} + Number(__obj); + $ERROR('#1.1: var __obj = {valueOf:function(){return new Object;},toNumber: function() {return new Object();}}; Number(__obj) throw TypeError. Actual: ' + (Number(__obj))); +} +catch(e) +{ + if ((e instanceof TypeError) !== true) { + $ERROR('#1.2: var __obj = {valueOf:function(){return new Object;},toNumber: function() {return new Object();}}; Number(__obj) throw TypeError. Actual: ' + (e)); + } +} + diff --git a/js/src/tests/test262/ch08/8.12/8.12.8/browser.js b/js/src/tests/test262/ch08/8.12/8.12.8/browser.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/test262/ch08/8.12/8.12.8/browser.js diff --git a/js/src/tests/test262/ch08/8.12/8.12.8/shell.js b/js/src/tests/test262/ch08/8.12/8.12.8/shell.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/test262/ch08/8.12/8.12.8/shell.js |