Chromium Code Reviews| Index: test/mjsunit/harmony/array-find.js |
| diff --git a/test/mjsunit/harmony/array-find.js b/test/mjsunit/harmony/array-find.js |
| index 9f5750eca05d03a66c979902b021c1564672b893..26f77d2fbad1d02d845664a8267be2c847de7203 100644 |
| --- a/test/mjsunit/harmony/array-find.js |
| +++ b/test/mjsunit/harmony/array-find.js |
| @@ -237,6 +237,17 @@ assertEquals(22, a.find(function(val) { return 22 === val; }), undefined); |
| return this.elementAt(key) === val; |
| }, thisArg); |
| assertEquals("b", found); |
| + |
| + // Create a new object in each function call when receiver is a primitive value. |
| + a = new Array(); |
| + [1,2].find(function() { a.push(this) }, ""); |
| + assertTrue(a[0] !== a[1]); |
| + |
| + // Do not create a new object in each function call when receiver is a primitive value. |
|
wingo
2014/09/15 09:12:21
80 column limit.
|
| + a = new Array(); |
| + [1,2].find(function() { a.push(this) }, {}); |
| + assertFalse(a[0] !== a[1]); |
| + |
| })(); |
| // Test exceptions |