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 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 set 6e-0(_) {}, | 254 set 6e-0(_) {}, |
255 set 7E-0(_) {}, | 255 set 7E-0(_) {}, |
256 set 0x8(_) {}, | 256 set 0x8(_) {}, |
257 set 0X9(_) {}, | 257 set 0X9(_) {}, |
258 }); | 258 }); |
259 TestNumericNamesSetter(['1.2', '1.3'], { | 259 TestNumericNamesSetter(['1.2', '1.3'], { |
260 set 1.2(_) {; }, | 260 set 1.2(_) {; }, |
261 set 1.30(_) {; } | 261 set 1.30(_) {; } |
262 }); | 262 }); |
263 | 263 |
264 | |
265 (function TestPrototypeInObjectLiteral() { | 264 (function TestPrototypeInObjectLiteral() { |
266 // The prototype chain should not be used if the definition | 265 // The prototype chain should not be used if the definition |
267 // happens in the object literal. | 266 // happens in the object literal. |
268 | 267 |
269 Object.defineProperty(Object.prototype, 'c', { | 268 Object.defineProperty(Object.prototype, 'c', { |
270 get: function () { | 269 get: function () { |
271 return 21; | 270 return 21; |
272 }, | 271 }, |
273 set: function () { | 272 set: function () { |
274 } | 273 } |
(...skipping 20 matching lines...) Expand all Loading... |
295 const prop = 'a'; | 294 const prop = 'a'; |
296 | 295 |
297 var p = new Proxy({}, handler); | 296 var p = new Proxy({}, handler); |
298 p[prop] = 'my value'; | 297 p[prop] = 'my value'; |
299 assertEquals(undefined, p[prop]); | 298 assertEquals(undefined, p[prop]); |
300 | 299 |
301 | 300 |
302 var l = new Proxy({[prop]: 'my value'}, handler); | 301 var l = new Proxy({[prop]: 'my value'}, handler); |
303 assertEquals('my value', l[prop]); | 302 assertEquals('my value', l[prop]); |
304 })(); | 303 })(); |
| 304 |
| 305 (function TestWithoutProxyWithDefinitionInObjectLiteral() { |
| 306 |
| 307 const prop = 'a'; |
| 308 |
| 309 var l = {[prop]: 'my value'}; |
| 310 assertEquals('my value', l[prop]); |
| 311 })(); |
OLD | NEW |