mirror of https://github.com/tc39/test262.git
Update tests for Number.NaN
This commit is contained in:
parent
4492b8032b
commit
47f806ecef
|
@ -0,0 +1,23 @@
|
|||
// 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.10
|
||||
esid: sec-number.nan
|
||||
description: >
|
||||
"NaN" property descriptor and value of Number
|
||||
info: >
|
||||
20.1.2.10 Number.NaN
|
||||
|
||||
The value of Number.NaN is NaN.
|
||||
|
||||
This property has the attributes { [[Writable]]: false, [[Enumerable]]: false,
|
||||
[[Configurable]]: false }.
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
assert.sameValue(Number.NaN, NaN);
|
||||
|
||||
verifyNotEnumerable(Number, "NaN");
|
||||
verifyNotWritable(Number, "NaN");
|
||||
verifyNotConfigurable(Number, "NaN");
|
|
@ -1,13 +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.NaN is Not-a-Number
|
||||
es5id: 15.7.3.4_A1
|
||||
description: Checking isNaN(Number.NaN)
|
||||
---*/
|
||||
|
||||
// CHECK#1
|
||||
if (isNaN(Number.NaN) !== true) {
|
||||
$ERROR('#1: Number.NaN === Not-a-Number');
|
||||
}
|
|
@ -1,15 +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.NaN is ReadOnly
|
||||
es5id: 15.7.3.4_A2
|
||||
description: Checking if varying Number.NaN fails
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
// CHECK#1
|
||||
verifyNotWritable(Number, "NaN", null, 1);
|
||||
if (isNaN(Number.NaN) !== true) {
|
||||
$ERROR('#1: Number.NaN = 1; Number.NaN === Not-a-Number');
|
||||
}
|
|
@ -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.NaN is DontDelete
|
||||
es5id: 15.7.3.4_A3
|
||||
description: Checking if deleting Number.NaN fails
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
verifyNotConfigurable(Number, "NaN");
|
||||
|
||||
// CHECK#1
|
||||
try {
|
||||
if (delete Number.NaN !== false) {
|
||||
$ERROR('#1: delete Number.NaN === 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.NaN has the attribute DontEnum
|
||||
es5id: 15.7.3.4_A4
|
||||
description: Checking if enumerating Number.NaN fails
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
for(var x in Number) {
|
||||
if(x === "NaN") {
|
||||
$ERROR('#1: Number.NaN has the attribute DontEnum');
|
||||
}
|
||||
}
|
||||
|
||||
if (Number.propertyIsEnumerable('NaN')) {
|
||||
$ERROR('#2: Number.NaN has the attribute DontEnum');
|
||||
}
|
Loading…
Reference in New Issue