Skip to content
Snippets Groups Projects
Commit 47f806ec authored by Leonardo Balter's avatar Leonardo Balter Committed by Mike Pennisi
Browse files

Update tests for Number.NaN

parent 4492b803
No related branches found
No related tags found
No related merge requests found
// 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");
// 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');
}
// 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');
}
// 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);
}
// 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');
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment