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

Unified Diff: Source/devtools/front_end/sources/SourcesPanel.js

Issue 300393002: Merge DevTools Refactor CL to Blink36 (Closed) Base URL: svn://svn.chromium.org/blink/branches/dart/1985
Patch Set: PTAL Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/devtools/front_end/sdk/RuntimeModel.js ('k') | Source/devtools/protocol.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/sources/SourcesPanel.js
diff --git a/Source/devtools/front_end/sources/SourcesPanel.js b/Source/devtools/front_end/sources/SourcesPanel.js
index 41b4d3bc39510cf0e0356be5aef6b5b6f8c08a01..41c1ab98c90ee46489ba03a47e9b5a981e1fbdb8 100644
--- a/Source/devtools/front_end/sources/SourcesPanel.js
+++ b/Source/devtools/front_end/sources/SourcesPanel.js
@@ -904,7 +904,11 @@ WebInspector.SourcesPanel.prototype = {
if (!currentExecutionContext)
return;
- currentExecutionContext.evaluate("window", "", false, true, false, false, didGetGlobalObject.bind(null, currentExecutionContext.target()));
+ if (remoteObject.language == 'dart') {
+ currentExecutionContext.evaluate("$consoleVariables", "", true, true, false, false, didGetGlobalObject.bind(null, currentExecutionContext.target()));
+ } else {
+ currentExecutionContext.evaluate("window", "", false, true, false, false, didGetGlobalObject.bind(null, currentExecutionContext.target()));
+ }
/**
* @param {!WebInspector.Target} target
* @param {?WebInspector.RemoteObject} global
@@ -927,10 +931,20 @@ WebInspector.SourcesPanel.prototype = {
return name;
}
+ var dartRemoteFunction =
+ "(val) {\n" +
+ " var index = 1;\n" +
+ " var vars = variables();\n" +
+ " while(vars.contains('temp$index')) { ++index; };\n" +
+ " var name = 'temp$index';\n" +
+ " setVariable(name, val);\n" +
+ " return name;\n" +
+ "}";
+
if (wasThrown || !global)
failedToSave(target, global);
else
- global.callFunction(remoteFunction, [WebInspector.RemoteObject.toCallArgument(remoteObject)], didSave.bind(null, global));
+ global.callFunction(remoteObject.language == 'dart' ? dartRemoteFunction : remoteFunction, [WebInspector.RemoteObject.toCallArgument(remoteObject)], didSave.bind(null, global));
}
/**
« no previous file with comments | « Source/devtools/front_end/sdk/RuntimeModel.js ('k') | Source/devtools/protocol.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698