OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Flags: --harmony-reflect | 5 // Flags: --harmony-reflect |
6 | 6 |
7 // TODO(neis): Test with proxies. | 7 // TODO(neis): Test with proxies. |
8 | 8 |
9 | 9 |
10 | 10 |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 | 241 |
242 assertFalse(Reflect.set(target, "nowrite", value, receiver)); | 242 assertFalse(Reflect.set(target, "nowrite", value, receiver)); |
243 assertEquals(44, target.nowrite); | 243 assertEquals(44, target.nowrite); |
244 assertFalse("nowrite" in receiver); | 244 assertFalse("nowrite" in receiver); |
245 | 245 |
246 // Data vs Non-Writable | 246 // Data vs Non-Writable |
247 // TODO(neis): This must return false but currently doesn't. | 247 // TODO(neis): This must return false but currently doesn't. |
248 // assertFalse(Reflect.set({}, "nowrite", value, target)); | 248 // assertFalse(Reflect.set({}, "nowrite", value, target)); |
249 | 249 |
250 // Data vs Accessor | 250 // Data vs Accessor |
251 // TODO(neis): These must return false but currently don't. | 251 assertFalse(Reflect.set({}, "unknown", 0, {set unknown(x) {}})); |
252 // assertFalse(Reflect.set(target, "unknown", value, {set bla(x) {}})); | 252 assertFalse(Reflect.set(target, "unknown", value, {set unknown(x) {}})); |
253 // assertFalse(Reflect.set(target, "unknown", value, {get bla() {}})); | 253 assertFalse(Reflect.set(target, "bla", value, {set bla(x) {}})); |
254 // assertFalse(Reflect.set(target, "bla", value, {set bla(x) {}})); | 254 assertFalse(Reflect.set(target, "bla", value, {get bla() {}})); |
255 // assertFalse(Reflect.set(target, "bla", value, {get bla() {}})); | |
256 | 255 |
257 // Accessor vs Data | 256 // Accessor vs Data |
258 assertTrue(Reflect.set({set bla(x) {}}), "bla", value, target); | 257 assertTrue(Reflect.set({set bla(x) {}}), "bla", value, target); |
259 assertFalse(Reflect.set({get bla() {}}, "bla", value, target)); | 258 assertFalse(Reflect.set({get bla() {}}, "bla", value, target)); |
260 | 259 |
261 // Data vs Non-Object | 260 // Data vs Non-Object |
262 assertFalse(Reflect.set({}, "bla", value, null)); | 261 assertFalse(Reflect.set({}, "bla", value, null)); |
263 assertFalse(Reflect.set({bla: 42}, "bla", value, null)); | 262 assertFalse(Reflect.set({bla: 42}, "bla", value, null)); |
264 | 263 |
265 // Accessor vs Non-Object | 264 // Accessor vs Non-Object |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
546 assertThrows(function() { Reflect.preventExtensions(); }, TypeError); | 545 assertThrows(function() { Reflect.preventExtensions(); }, TypeError); |
547 assertThrows(function() { Reflect.preventExtensions(42); }, TypeError); | 546 assertThrows(function() { Reflect.preventExtensions(42); }, TypeError); |
548 assertThrows(function() { Reflect.preventExtensions(null); }, TypeError); | 547 assertThrows(function() { Reflect.preventExtensions(null); }, TypeError); |
549 })(); | 548 })(); |
550 | 549 |
551 | 550 |
552 // See reflect-prevent-extensions.js for further tests. | 551 // See reflect-prevent-extensions.js for further tests. |
553 | 552 |
554 // TODO(neis): Need proxies to test the situation where | 553 // TODO(neis): Need proxies to test the situation where |
555 // [[preventExtensions]] returns false. | 554 // [[preventExtensions]] returns false. |
OLD | NEW |