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

Side by Side Diff: test/inspector/debugger/eval-scopes.js

Issue 2519773003: [debug] Add Eval scope type to inspector protocol (Closed)
Patch Set: Address comments Created 4 years, 1 month 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/debugger/test-api.js ('k') | test/inspector/debugger/eval-scopes-expected.txt » ('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 2016 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 InspectorTest.addScript(
6 `function testNonEmptyEvalScope() {
7 eval("'use strict'; var hest = 420; debugger;");
8 }
9 function testEmptyEvalScope() {
10 eval("var fisk = 42; testNonEmptyEvalScope();");
11 }`);
12
13 Protocol.Debugger.enable();
14 Protocol.Debugger.oncePaused().then(dumpScopeOnPause);
15 Protocol.Runtime.evaluate({ "expression": "testEmptyEvalScope();" });
16
17 var waitScopeObjects = 0;
18 function dumpScopeOnPause(message)
19 {
20 var scopeChain = message.params.callFrames[0].scopeChain;
21 var evalScopeObjectIds = [];
22 for (var scope of scopeChain) {
23 if (scope.type === "eval") {
24 evalScopeObjectIds.push(scope.object.objectId);
25 }
26 }
27 waitScopeObjects = evalScopeObjectIds.length;
28 if (!waitScopeObjects) {
29 InspectorTest.completeTest();
30 } else {
31 for (var objectId of evalScopeObjectIds)
32 Protocol.Runtime.getProperties({ "objectId" : objectId })
33 .then(dumpProperties);
34 }
35 }
36
37 function dumpProperties(message)
38 {
39 InspectorTest.logMessage(message);
40 --waitScopeObjects;
41 if (!waitScopeObjects)
42 Protocol.Debugger.resume().then(InspectorTest.completeTest);
43 }
OLDNEW
« no previous file with comments | « test/debugger/test-api.js ('k') | test/inspector/debugger/eval-scopes-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698