mirror of https://github.com/svaarala/duktape.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
929 B
43 lines
929 B
12 years ago
|
/*
|
||
|
* Redeclare a global non-configurable plain (data) property, E5.1 change.
|
||
|
*/
|
||
|
|
||
|
/*---
|
||
|
{
|
||
|
"skip": true
|
||
|
}
|
||
|
---*/
|
||
|
|
||
|
/* Empty output is intentional: Program-wide TypeError. */
|
||
|
|
||
|
/* FIXME */
|
||
|
|
||
|
/*===
|
||
|
===*/
|
||
|
|
||
|
/* NaN is non-configurable. Attempt to redeclare -> TypeError.
|
||
|
* Nothing gets printed because the TypeError will run before
|
||
|
* anything else (as part of binding instantiation).
|
||
|
*/
|
||
|
|
||
|
var desc;
|
||
|
var indirectEval = eval;
|
||
|
var global = indirectEval("this"); // for Node
|
||
|
|
||
|
// Note: since declarations are hoisted, the RegExp declaration below
|
||
|
// will already have taken effect here.
|
||
|
|
||
|
print(typeof NaN);
|
||
|
desc = Object.getOwnPropertyDescriptor(global, 'NaN');
|
||
|
print(desc.writable, desc.enumerable, desc.configurable);
|
||
|
|
||
|
function NaN() {
|
||
|
return 123;
|
||
|
}
|
||
|
|
||
|
// just checking that order does not matter
|
||
|
print(typeof NaN);
|
||
|
desc = Object.getOwnPropertyDescriptor(global, 'NaN');
|
||
|
print(desc.writable, desc.enumerable, desc.configurable);
|
||
|
|