Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Side by Side Diff: test/mjsunit/es6/reflect.js

Issue 2397603003: [runtime] Let native setters have a return value. (Closed)
Patch Set: Ouch. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « test/cctest/heap/test-alloc.cc ('k') | test/mjsunit/modules-namespace1.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 // TODO(neis): Test with proxies. 5 // TODO(neis): Test with proxies.
6 6
7 7
8 8
9 //////////////////////////////////////////////////////////////////////////////// 9 ////////////////////////////////////////////////////////////////////////////////
10 // (Auxiliaries) 10 // (Auxiliaries)
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 Object.defineProperty(receiver2, "bla", 266 Object.defineProperty(receiver2, "bla",
267 {configurable: false, writable: true, value: true}); 267 {configurable: false, writable: true, value: true});
268 Object.defineProperty(receiver2, "not_in_target", 268 Object.defineProperty(receiver2, "not_in_target",
269 {configurable: false, writable: true, value: true}); 269 {configurable: false, writable: true, value: true});
270 assertTrue(Reflect.set(target, "bla", value, receiver2)); 270 assertTrue(Reflect.set(target, "bla", value, receiver2));
271 assertTrue(Reflect.set(target, "not_in_target", value, receiver2)); 271 assertTrue(Reflect.set(target, "not_in_target", value, receiver2));
272 } 272 }
273 })(); 273 })();
274 274
275 275
276 (function testReflectSetArrayLength() {
277 var y = [];
278 Object.defineProperty(y, 0, {value: 42, configurable: false});
279 assertFalse(Reflect.set(y, 'length', 0));
280 assertTrue(Reflect.set(y, 'length', 2));
281 })();
282
283
276 284
277 //////////////////////////////////////////////////////////////////////////////// 285 ////////////////////////////////////////////////////////////////////////////////
278 // Reflect.has 286 // Reflect.has
279 287
280 288
281 (function testReflectHasArity() { 289 (function testReflectHasArity() {
282 assertEquals(2, Reflect.has.length); 290 assertEquals(2, Reflect.has.length);
283 })(); 291 })();
284 292
285 293
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 (function testReflectDefinePropertyKeyConversion() { 353 (function testReflectDefinePropertyKeyConversion() {
346 var target = {}; 354 var target = {};
347 var a = { [Symbol.toPrimitive]: function() { return "bla" } }; 355 var a = { [Symbol.toPrimitive]: function() { return "bla" } };
348 var b = { [Symbol.toPrimitive]: function() { throw "gaga" } }; 356 var b = { [Symbol.toPrimitive]: function() { throw "gaga" } };
349 assertTrue(Reflect.defineProperty(target, a, {value: 42})); 357 assertTrue(Reflect.defineProperty(target, a, {value: 42}));
350 assertEquals(target.bla, 42); 358 assertEquals(target.bla, 42);
351 assertThrowsEquals(function() { Reflect.defineProperty(target, b); }, "gaga"); 359 assertThrowsEquals(function() { Reflect.defineProperty(target, b); }, "gaga");
352 })(); 360 })();
353 361
354 362
363 (function testReflectDefinePropertyArrayLength() {
364 var y = [];
365 Object.defineProperty(y, 0, {value: 42, configurable: false});
366 assertFalse(Reflect.defineProperty(y, 'length', {value: 0}));
367 assertTrue(Reflect.defineProperty(y, 'length', {value: 2}));
368 })();
369
370
355 // See reflect-define-property.js for further tests. 371 // See reflect-define-property.js for further tests.
356 372
357 373
358 374
359 //////////////////////////////////////////////////////////////////////////////// 375 ////////////////////////////////////////////////////////////////////////////////
360 // Reflect.deleteProperty 376 // Reflect.deleteProperty
361 377
362 378
363 (function testReflectDeletePropertyArity() { 379 (function testReflectDeletePropertyArity() {
364 assertEquals(2, Reflect.deleteProperty.length); 380 assertEquals(2, Reflect.deleteProperty.length);
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
568 assertThrows(function() { Reflect.preventExtensions(); }, TypeError); 584 assertThrows(function() { Reflect.preventExtensions(); }, TypeError);
569 assertThrows(function() { Reflect.preventExtensions(42); }, TypeError); 585 assertThrows(function() { Reflect.preventExtensions(42); }, TypeError);
570 assertThrows(function() { Reflect.preventExtensions(null); }, TypeError); 586 assertThrows(function() { Reflect.preventExtensions(null); }, TypeError);
571 })(); 587 })();
572 588
573 589
574 // See reflect-prevent-extensions.js for further tests. 590 // See reflect-prevent-extensions.js for further tests.
575 591
576 // TODO(neis): Need proxies to test the situation where 592 // TODO(neis): Need proxies to test the situation where
577 // [[preventExtensions]] returns false. 593 // [[preventExtensions]] returns false.
OLDNEW
« no previous file with comments | « test/cctest/heap/test-alloc.cc ('k') | test/mjsunit/modules-namespace1.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698