diff options
Diffstat (limited to 'js/src/tests/test262/built-ins/Infinity')
8 files changed, 117 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/Infinity/15.1.1.2-0.js b/js/src/tests/test262/built-ins/Infinity/15.1.1.2-0.js new file mode 100644 index 0000000000..b77b93d8d4 --- /dev/null +++ b/js/src/tests/test262/built-ins/Infinity/15.1.1.2-0.js @@ -0,0 +1,17 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.1.1.2-0 +description: > + Global.Infinity is a data property with default attribute values + (false) +---*/ + +var desc = Object.getOwnPropertyDescriptor(this, 'Infinity'); + +assert.sameValue(desc.writable, false, 'desc.writable'); +assert.sameValue(desc.enumerable, false, 'desc.enumerable'); +assert.sameValue(desc.configurable, false, 'desc.configurable'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Infinity/S15.1.1.2_A1.js b/js/src/tests/test262/built-ins/Infinity/S15.1.1.2_A1.js new file mode 100644 index 0000000000..7ce53f47d1 --- /dev/null +++ b/js/src/tests/test262/built-ins/Infinity/S15.1.1.2_A1.js @@ -0,0 +1,31 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: The initial value of Infinity is Number.POSITIVE_INFINITY +es5id: 15.1.1.2_A1 +description: Use typeof, isNaN, isFinite +---*/ + +// CHECK#1 +if (typeof(Infinity) !== "number") { + $ERROR('#1: typeof(Infinity) === "number". Actual: ' + (typeof(Infinity))); +} + +// CHECK#2 +if (isFinite(Infinity) !== false) { + $ERROR('#2: Infinity === Not-a-Finite. Actual: ' + (Infinity)); +} + +// CHECK#3 +if (isNaN(Infinity) !== false) { + $ERROR('#3: Infinity === Not-a-Number. Actual: ' + (Infinity)); +} + + +// CHECK#4 +if (Infinity !== Number.POSITIVE_INFINITY) { + $ERROR('#4: Infinity === Number.POSITIVE_INFINITY. Actual: ' + (Infinity)); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Infinity/S15.1.1.2_A2_T2.js b/js/src/tests/test262/built-ins/Infinity/S15.1.1.2_A2_T2.js new file mode 100644 index 0000000000..256303b378 --- /dev/null +++ b/js/src/tests/test262/built-ins/Infinity/S15.1.1.2_A2_T2.js @@ -0,0 +1,17 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: The Infinity is ReadOnly +es5id: 15.1.1.2_A2_T2 +description: Checking typeof Functions +flags: [noStrict] +---*/ + +// CHECK#1 +Infinity = true; +if (typeof(Infinity) === "boolean") { + $ERROR('#1: Infinity = true; typeof(Infinity) !== "boolean". Actual: ' + (typeof(Infinity))); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Infinity/S15.1.1.2_A3_T2.js b/js/src/tests/test262/built-ins/Infinity/S15.1.1.2_A3_T2.js new file mode 100644 index 0000000000..0795ca6143 --- /dev/null +++ b/js/src/tests/test262/built-ins/Infinity/S15.1.1.2_A3_T2.js @@ -0,0 +1,16 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: The Infinity is DontDelete +es5id: 15.1.1.2_A3_T2 +description: Use delete +flags: [noStrict] +---*/ + +// CHECK#1 +if (delete Infinity !== false) { + $ERROR('#1: delete Infinity === false. Actual: ' + (delete Infinity)); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Infinity/S15.1.1.2_A4.js b/js/src/tests/test262/built-ins/Infinity/S15.1.1.2_A4.js new file mode 100644 index 0000000000..b4f2a33d7b --- /dev/null +++ b/js/src/tests/test262/built-ins/Infinity/S15.1.1.2_A4.js @@ -0,0 +1,17 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: The Infinity is DontEnum +es5id: 15.1.1.2_A4 +description: Use for-in statement +---*/ + +// CHECK#1 +for (var prop in this) { + if (prop === "Infinity") { + $ERROR('#1: The Infinity is DontEnum'); + } +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Infinity/browser.js b/js/src/tests/test262/built-ins/Infinity/browser.js new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/js/src/tests/test262/built-ins/Infinity/browser.js diff --git a/js/src/tests/test262/built-ins/Infinity/prop-desc.js b/js/src/tests/test262/built-ins/Infinity/prop-desc.js new file mode 100644 index 0000000000..53eebb2713 --- /dev/null +++ b/js/src/tests/test262/built-ins/Infinity/prop-desc.js @@ -0,0 +1,19 @@ +// Copyright (C) 2019 Bocoup. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-value-properties-of-the-global-object-infinity +description: Property descriptor of Infinity +info: | + This property has the attributes { [[Writable]]: false, [[Enumerable]]: + false, [[Configurable]]: false }. +includes: [propertyHelper.js] +---*/ + +verifyProperty(this, "Infinity", { + enumerable: false, + writable: false, + configurable: false +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Infinity/shell.js b/js/src/tests/test262/built-ins/Infinity/shell.js new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/js/src/tests/test262/built-ins/Infinity/shell.js |