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

Side by Side Diff: test/mjsunit/es7/regress/regress-443982.js

Issue 1511293002: Pass --harmony-object-observe in tests that depend on it (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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/test-object-observe.cc ('k') | test/mjsunit/regress/regress-417709b.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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 //
5 // Flags: --harmony-object-observe
4 6
5 var records; 7 var records;
6 function observer(r) { 8 function observer(r) {
7 records = r; 9 records = r;
8 } 10 }
9 11
10 Object.defineProperty(Array.prototype, '0', { 12 Object.defineProperty(Array.prototype, '0', {
11 get: function() { return 0; }, 13 get: function() { return 0; },
12 set: function() { throw "boom!"; } 14 set: function() { throw "boom!"; }
13 }); 15 });
14 arr = [1, 2]; 16 arr = [1, 2];
15 Array.observe(arr, observer); 17 Array.observe(arr, observer);
16 arr.length = 0; 18 arr.length = 0;
17 assertEquals(0, arr.length); 19 assertEquals(0, arr.length);
18 20
19 Object.deliverChangeRecords(observer); 21 Object.deliverChangeRecords(observer);
20 assertEquals(1, records.length); 22 assertEquals(1, records.length);
21 assertEquals('splice', records[0].type); 23 assertEquals('splice', records[0].type);
22 assertArrayEquals([1, 2], records[0].removed); 24 assertArrayEquals([1, 2], records[0].removed);
OLDNEW
« no previous file with comments | « test/cctest/test-object-observe.cc ('k') | test/mjsunit/regress/regress-417709b.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698