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

Side by Side Diff: test/mjsunit/array-push7.js

Issue 1909433003: Remove support for Object.observe (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebased Created 4 years, 8 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
« no previous file with comments | « test/cctest/test-object-observe.cc ('k') | test/mjsunit/es6/debug-stepin-microtasks.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 // Flags: --harmony-object-observe
6 // Flags: --allow-natives-syntax
7
8 var v = 0;
9
10 function push_wrapper(array, value) {
11 array.push(value);
12 }
13 function pop_wrapper(array) {
14 return array.pop();
15 }
16
17 // Test that Object.observe() notification events are properly sent from
18 // Array.push() and Array.pop() both from optimized and un-optimized code.
19 var array = [];
20
21 function somethingChanged(changes) {
22 v++;
23 }
24
25 Object.observe(array, somethingChanged);
26 push_wrapper(array, 1);
27 %RunMicrotasks();
28 assertEquals(1, array.length);
29 assertEquals(1, v);
30 push_wrapper(array, 1);
31 %RunMicrotasks();
32 assertEquals(2, array.length);
33 assertEquals(2, v);
34 %OptimizeFunctionOnNextCall(push_wrapper);
35 push_wrapper(array, 1);
36 %RunMicrotasks();
37 assertEquals(3, array.length);
38 assertEquals(3, v);
39 push_wrapper(array, 1);
40 %RunMicrotasks();
41 assertEquals(4, array.length);
42 assertEquals(4, v);
43
44 pop_wrapper(array);
45 %RunMicrotasks();
46 assertEquals(3, array.length);
47 assertEquals(5, v);
48 pop_wrapper(array);
49 %RunMicrotasks();
50 assertEquals(2, array.length);
51 assertEquals(6, v);
52 %OptimizeFunctionOnNextCall(pop_wrapper);
53 pop_wrapper(array);
54 %RunMicrotasks();
55 assertEquals(1, array.length);
56 assertEquals(7, v);
57 pop_wrapper(array);
58 %RunMicrotasks();
59 assertEquals(0, array.length);
60 assertEquals(8, v);
OLDNEW
« no previous file with comments | « test/cctest/test-object-observe.cc ('k') | test/mjsunit/es6/debug-stepin-microtasks.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698