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

Side by Side Diff: test/mjsunit/es6/proxies-function.js

Issue 2663803002: [string] Migrate String.prototype.{split,replace} to TF (Closed)
Patch Set: Address comments Created 3 years, 10 months 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
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 453 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 new Proxy(function(_, that, [x]) { receiver = that; value = x }, {})) 464 new Proxy(function(_, that, [x]) { receiver = that; value = x }, {}))
465 ) 465 )
466 466
467 467
468 // Passing a proxy function to higher-order library functions. 468 // Passing a proxy function to higher-order library functions.
469 469
470 function TestHigherOrder(f) { 470 function TestHigherOrder(f) {
471 assertEquals(6, [6, 2].map(f)[0]) 471 assertEquals(6, [6, 2].map(f)[0])
472 assertEquals(4, [5, 2].reduce(f, 4)) 472 assertEquals(4, [5, 2].reduce(f, 4))
473 assertTrue([1, 2].some(f)) 473 assertTrue([1, 2].some(f))
474 assertEquals("a.b.c", "a.b.c".replace(".", f))
475 } 474 }
476 475
477 TestHigherOrder(function(x) { return x }) 476 TestHigherOrder(function(x) { return x })
478 TestHigherOrder(function(x) { "use strict"; return x }) 477 TestHigherOrder(function(x) { "use strict"; return x })
479 TestHigherOrder(new Proxy(function(x) { return x }, {})) 478 TestHigherOrder(new Proxy(function(x) { return x }, {}))
480 TestHigherOrder(Object.freeze(new Proxy(function(x) { return x }, {}))) 479 TestHigherOrder(Object.freeze(new Proxy(function(x) { return x }, {})))
481 480
482 481
483 482
484 // TODO(rossberg): Ultimately, I want to have the following test function 483 // TODO(rossberg): Ultimately, I want to have the following test function
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
621 with (this) { 620 with (this) {
622 assertEquals(this, fp()); 621 assertEquals(this, fp());
623 assertEquals(this, gp()); 622 assertEquals(this, gp());
624 } 623 }
625 624
626 with ({}) { 625 with ({}) {
627 assertEquals(undefined, fp()); 626 assertEquals(undefined, fp());
628 assertEquals(undefined, gp()); 627 assertEquals(undefined, gp());
629 } 628 }
630 } 629 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698