mirror of https://github.com/tc39/test262.git
Update and add tests for Number.POSITIVE_INFINITY
This commit is contained in:
parent
7e55e54538
commit
454b8f10b8
|
@ -1,21 +0,0 @@
|
||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
|
||||||
|
|
||||||
/*---
|
|
||||||
info: Number.POSITIVE_INFINITY is DontDelete
|
|
||||||
es5id: 15.7.3.6_A3
|
|
||||||
description: Checking if deleting Number.POSITIVE_INFINITY fails
|
|
||||||
includes: [propertyHelper.js]
|
|
||||||
---*/
|
|
||||||
|
|
||||||
verifyNotConfigurable(Number, "POSITIVE_INFINITY");
|
|
||||||
|
|
||||||
// CHECK#1
|
|
||||||
try {
|
|
||||||
if (delete Number.POSITIVE_INFINITY !== false) {
|
|
||||||
$ERROR('#1: delete Number.POSITIVE_INFINITY === false');
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
if (e instanceof Test262Error) throw e;
|
|
||||||
assert(e instanceof TypeError);
|
|
||||||
}
|
|
|
@ -1,19 +0,0 @@
|
||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
|
||||||
|
|
||||||
/*---
|
|
||||||
info: Number.POSITIVE_INFINITY has the attribute DontEnum
|
|
||||||
es5id: 15.7.3.6_A4
|
|
||||||
description: Checking if enumerating Number.POSITIVE_INFINITY fails
|
|
||||||
---*/
|
|
||||||
|
|
||||||
//CHECK#1
|
|
||||||
for(var x in Number) {
|
|
||||||
if(x === "POSITIVE_INFINITY") {
|
|
||||||
$ERROR('#1: Number.POSITIVE_INFINITY has the attribute DontEnum');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Number.propertyIsEnumerable('POSITIVE_INFINITY')) {
|
|
||||||
$ERROR('#2: Number.POSITIVE_INFINITY has the attribute DontEnum');
|
|
||||||
}
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
// Copyright (C) 2016 The V8 Project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
es6id: 20.1.2.14
|
||||||
|
esid: sec-number.positive_infinity
|
||||||
|
description: >
|
||||||
|
"POSITIVE_INFINITY" property of Number
|
||||||
|
info: >
|
||||||
|
Number.POSITIVE_INFINITY
|
||||||
|
|
||||||
|
This property has the attributes { [[Writable]]: false, [[Enumerable]]: false,
|
||||||
|
[[Configurable]]: false }.
|
||||||
|
includes: [propertyHelper.js]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
verifyNotEnumerable(Number, "POSITIVE_INFINITY");
|
||||||
|
verifyNotWritable(Number, "POSITIVE_INFINITY");
|
||||||
|
verifyNotConfigurable(Number, "POSITIVE_INFINITY");
|
|
@ -0,0 +1,16 @@
|
||||||
|
// Copyright (C) 2016 The V8 Project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
es6id: 20.1.2.14
|
||||||
|
esid: sec-number.positive_infinity
|
||||||
|
description: >
|
||||||
|
The value of Number.POSITIVE_INFINITY is +Infinity
|
||||||
|
info: >
|
||||||
|
Number.POSITIVE_INFINITY
|
||||||
|
|
||||||
|
The value of Number.POSITIVE_INFINITY is +∞.
|
||||||
|
includes: [propertyHelper.js]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
assert.sameValue(Number.POSITIVE_INFINITY, Infinity);
|
Loading…
Reference in New Issue