Debian Codegraph @

js/src/tests/test262/language/expressions/property-accessors/S11.2.1_A1.2.js

raw
1 // Copyright 2009 the Sputnik authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 info: |
6 White Space and Line Terminator between "[" and MemberExpression or
7 CallExpression and between Identifier and "]" are allowed
8 es5id: 11.2.1_A1.2
9 description: Checking by using eval
10 ---*/
11
12 //CHECK#1
13 if (eval('Number[\u0009"POSITIVE_INFINITY"\u0009]') !== Number.POSITIVE_INFINITY) {
14 throw new Test262Error('#1: Number[\\u0009"POSITIVE_INFINITY"\\u0009] === Number.POSITIVE_INFINITY');
15 }
16
17 //CHECK#2
18 if (eval('Number[\u000B"POSITIVE_INFINITY"\u000B]') !== Number.POSITIVE_INFINITY) {
19 throw new Test262Error('#2: Number[\\u000B"POSITIVE_INFINITY"\\u000B] === Number.POSITIVE_INFINITY');
20 }
21
22 //CHECK#3
23 if (eval('Number[\u000C"POSITIVE_INFINITY"\u000C]') !== Number.POSITIVE_INFINITY) {
24 throw new Test262Error('#3: Number[\\u000C"POSITIVE_INFINITY"\\u000C] === Number.POSITIVE_INFINITY');
25 }
26
27 //CHECK#4
28 if (eval('Number[\u0020"POSITIVE_INFINITY"\u0020]') !== Number.POSITIVE_INFINITY) {
29 throw new Test262Error('#4: Number[\\u0020"POSITIVE_INFINITY"\\u0020] === Number.POSITIVE_INFINITY');
30 }
31
32 //CHECK#5
33 if (eval('Number[\u00A0"POSITIVE_INFINITY"\u00A0]') !== Number.POSITIVE_INFINITY) {
34 throw new Test262Error('#5: Number[\\u00A0"POSITIVE_INFINITY"\\u00A0] === Number.POSITIVE_INFINITY');
35 }
36
37 //CHECK#6
38 if (eval('Number[\u000A"POSITIVE_INFINITY"\u000A]') !== Number.POSITIVE_INFINITY) {
39 throw new Test262Error('#6: Number[\\u000A"POSITIVE_INFINITY"\\u000A] === Number.POSITIVE_INFINITY');
40 }
41
42 //CHECK#7
43 if (eval('Number[\u000D"POSITIVE_INFINITY"\u000D]') !== Number.POSITIVE_INFINITY) {
44 throw new Test262Error('#7: Number[\\u000D"POSITIVE_INFINITY"\\u000D] === Number.POSITIVE_INFINITY');
45 }
46
47 //CHECK#8
48 if (eval('Number[\u2028"POSITIVE_INFINITY"\u2028]') !== Number.POSITIVE_INFINITY) {
49 throw new Test262Error('#8: Number[\\u2028"POSITIVE_INFINITY"\\u2028] === Number.POSITIVE_INFINITY');
50 }
51
52 //CHECK#9
53 if (eval('Number[\u2029"POSITIVE_INFINITY"\u2029]') !== Number.POSITIVE_INFINITY) {
54 throw new Test262Error('#9: Number[\\u2029"POSITIVE_INFINITY"\\u2029] === Number.POSITIVE_INFINITY');
55 }
56
57 //CHECK#10
58 if (eval('Number[\u0009\u000B\u000C\u0020\u00A0\u000A\u000D\u2028\u2029"POSITIVE_INFINITY"\u0009\u000B\u000C\u0020\u00A0\u000A\u000D\u2028\u2029]') !== Number.POSITIVE_INFINITY) {
59 throw new Test262Error('#10: Number[\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029"POSITIVE_INFINITY"\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029] === Number.POSITIVE_INFINITY');
60 }
61
62 reportCompare(0, 0);