OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 | 88 |
89 a = makeNonConstantObject(); | 89 a = makeNonConstantObject(); |
90 a.a.b.bar = "foo"; | 90 a.a.b.bar = "foo"; |
91 assertEquals("foo", n.bar); | 91 assertEquals("foo", n.bar); |
92 | 92 |
93 // Test that exceptions for regexps still hold. | 93 // Test that exceptions for regexps still hold. |
94 function makeRegexpInArray() { return [ [ /a*/, {} ] ]; } | 94 function makeRegexpInArray() { return [ [ /a*/, {} ] ]; } |
95 | 95 |
96 a = makeRegexpInArray(); | 96 a = makeRegexpInArray(); |
97 var b = makeRegexpInArray(); | 97 var b = makeRegexpInArray(); |
98 assertTrue(a[0][0] === b[0][0]); | 98 assertFalse(a[0][0] === b[0][0]); |
99 assertFalse(a[0][1] === b[0][1]); | 99 assertFalse(a[0][1] === b[0][1]); |
100 | 100 |
101 function makeRegexpInObject() { return { a: { b: /b*/, c: {} } }; } | 101 function makeRegexpInObject() { return { a: { b: /b*/, c: {} } }; } |
102 a = makeRegexpInObject(); | 102 a = makeRegexpInObject(); |
103 b = makeRegexpInObject(); | 103 b = makeRegexpInObject(); |
104 assertTrue(a.a.b === b.a.b); | 104 assertFalse(a.a.b === b.a.b); |
105 assertFalse(a.a.c === b.a.c); | 105 assertFalse(a.a.c === b.a.c); |
106 | 106 |
107 | 107 |
108 // Test keywords valid as property names in initializers and dot-access. | 108 // Test keywords valid as property names in initializers and dot-access. |
109 var keywords = [ | 109 var keywords = [ |
110 "break", | 110 "break", |
111 "case", | 111 "case", |
112 "catch", | 112 "catch", |
113 "const", | 113 "const", |
114 "continue", | 114 "continue", |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 assertEquals("PI", obj[3.14]); | 203 assertEquals("PI", obj[3.14]); |
204 assertEquals(3.14, obj["PI"]); | 204 assertEquals(3.14, obj["PI"]); |
205 obj[37] = "t1"; | 205 obj[37] = "t1"; |
206 assertEquals("t1", obj.readback); | 206 assertEquals("t1", obj.readback); |
207 obj[1.44] = "t2"; | 207 obj[1.44] = "t2"; |
208 assertEquals("t2", obj.readback); | 208 assertEquals("t2", obj.readback); |
209 obj["Poo"] = "t3"; | 209 obj["Poo"] = "t3"; |
210 assertEquals("t3", obj.readback); | 210 assertEquals("t3", obj.readback); |
211 | 211 |
212 | 212 |
OLD | NEW |