1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
{
"testCollection": {
"name": "15.7.3.1_Number.prototype",
"numTests": 6,
"tests": [
{
"section": "15.7.3.1",
"description": "Checking if varying the Number.prototype property fails",
"test": "//CHECK#1\nvar x = Number.prototype;\nNumber.prototype = 1;\nif (Number.prototype !== x) {\n $ERROR('#1: The Number.prototype property has the attributes ReadOnly');\n}\n",
"id": "S15.7.3.1_A1_T1"
},
{
"section": "15.7.3.1",
"description": "Checking if deleting the Number.prototype property fails",
"strict_mode_negative": "",
"test": "// CHECK#1\nif (delete Number.prototype !== false) {\n $ERROR('#1: The Number.prototype property has the attributes DontDelete');\n}\n\nif (!Number.hasOwnProperty('prototype')) {\n $FAIL('#2: The Number.prototype property has the attributes DontDelete');\n}\n",
"id": "S15.7.3.1_A1_T2",
"strict_only": ""
},
{
"section": "15.7.3.1",
"description": "Checking if enumerating the Number.prototype property fails",
"test": "if (Number.propertyIsEnumerable('prototype')) {\n $ERROR('#1: The Number.prototype property has the attribute DontEnum');\n}\n\nfor(x in Number) {\n if(x === \"prototype\") {\n $ERROR('#2: The Number.prototype has the attribute DontEnum');\n }\n}\n",
"id": "S15.7.3.1_A1_T3"
},
{
"section": "15.7.3.1",
"description": "Checking type of Number.prototype property - test based on\ndeleting Number.prototype.toString",
"test": "//CHECK#1\nif (typeof Number.prototype !== \"object\") {\n $ERROR('#1: typeof Number.prototype === \"object\"');\n}\n\ndelete Number.prototype.toString;\n\nif (Number.prototype.toString() !== \"[object Number]\") {\n $ERROR('#3: The [[Class]] property of the Number prototype object is set to \"Number\"');\n}\n",
"id": "S15.7.3.1_A2_T1"
},
{
"section": "15.7.3.1",
"description": "Checking type of Number.prototype property - test based on\noverwriting of Number.prototype.toString",
"test": "//CHECK#1\nif (typeof Number.prototype !== \"object\") {\n $ERROR('#1: typeof Number.prototype === \"object\"');\n}\n\nNumber.prototype.toString = Object.prototype.toString;\n\nif (Number.prototype.toString() !== \"[object Number]\") {\n $ERROR('#3: The [[Class]] property of the Number prototype object is set to \"Number\"');\n}\n",
"id": "S15.7.3.1_A2_T2"
},
{
"section": "15.7.3.1",
"description": "Checking value of Number.prototype property",
"test": "//CHECK#1\nif (Number.prototype != 0) {\n $ERROR('#2: Number.prototype == +0');\n} else if( 1/Number.prototype != Number.POSITIVE_INFINITY){\n $ERROR('#2: Number.prototype == +0');\n}\n",
"id": "S15.7.3.1_A3"
}
]
}
}
|