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

Side by Side Diff: test/mjsunit/es7/object-observe-debug-event.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/mjsunit/es7/object-observe.js ('k') | test/mjsunit/es7/object-observe-runtime.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: --expose-debug-as debug
7
8 Debug = debug.Debug;
9
10 var base_id = -1;
11 var exception = null;
12 var expected = [
13 "enqueue #1",
14 "willHandle #1",
15 "didHandle #1",
16 ];
17
18 function assertLog(msg) {
19 print(msg);
20 assertTrue(expected.length > 0);
21 assertEquals(expected.shift(), msg);
22 if (!expected.length) {
23 Debug.setListener(null);
24 }
25 }
26
27 function listener(event, exec_state, event_data, data) {
28 if (event != Debug.DebugEvent.AsyncTaskEvent) return;
29 try {
30 if (base_id < 0)
31 base_id = event_data.id();
32 var id = event_data.id() - base_id + 1;
33 assertEquals("Object.observe", event_data.name());
34 assertLog(event_data.type() + " #" + id);
35 } catch (e) {
36 print(e + e.stack)
37 exception = e;
38 }
39 }
40
41 Debug.setListener(listener);
42
43 var obj = {};
44 Object.observe(obj, function(changes) {
45 print(change.type + " " + change.name + " " + change.oldValue);
46 });
47
48 obj.foo = 1;
49 obj.zoo = 2;
50 obj.foo = 3;
51
52 assertNull(exception);
OLDNEW
« no previous file with comments | « test/mjsunit/es7/object-observe.js ('k') | test/mjsunit/es7/object-observe-runtime.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698