Update tests for Number.NaN

This commit is contained in:
Leonardo Balter 2016-06-20 18:01:17 -04:00 committed by Mike Pennisi
parent 4492b8032b
commit 47f806ecef
5 changed files with 23 additions and 68 deletions

View File

@ -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");

View File

@ -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');
}

View File

@ -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');
}

View File

@ -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);
}

View File

@ -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');
}