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

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

Issue 1264133002: Devtools: [WIP] Implement enhanced devtools extension language APIs Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Modify override dropdown to apply to console completions & transpile Created 5 years, 4 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
Index: Source/devtools/front_end/sources/WatchExpressionsSidebarPane.js
diff --git a/Source/devtools/front_end/sources/WatchExpressionsSidebarPane.js b/Source/devtools/front_end/sources/WatchExpressionsSidebarPane.js
index 581d01f5f2e924e51870f33b4977cdd79432582f..b651b47e6a5c8beb9279c29305f4508086605538 100644
--- a/Source/devtools/front_end/sources/WatchExpressionsSidebarPane.js
+++ b/Source/devtools/front_end/sources/WatchExpressionsSidebarPane.js
@@ -254,8 +254,26 @@ WebInspector.WatchExpression.prototype = {
update: function()
{
var currentExecutionContext = WebInspector.context.flavor(WebInspector.ExecutionContext);
- if (currentExecutionContext && this._expression)
+ if (currentExecutionContext && this._expression) {
+ var location = currentExecutionContext.pauseLocation();
+ if (location) {
+ var activeMime = WebInspector.ResourceType.mimeFromUrl(location.source);
+ if (WebInspector.languageService.handles.transpile(activeMime)) {
+ var expr = this._expression;
+ var prom = this._pendingUpdate = WebInspector.languageService.transpile(activeMime, expr, location).then(result => {
+ if (this._pendingUpdate !== prom) {
+ //cancelled by another update
+ return;
+ }
+ currentExecutionContext.evaluate(result, WebInspector.WatchExpression._watchObjectGroupId, false, true, false, false, this._createWatchExpression.bind(this));
+ }).catch((e) => {
+ currentExecutionContext.evaluate(expr, WebInspector.WatchExpression._watchObjectGroupId, false, true, false, false, this._createWatchExpression.bind(this));
+ });
+ return;
+ }
+ }
currentExecutionContext.evaluate(this._expression, WebInspector.WatchExpression._watchObjectGroupId, false, true, false, false, this._createWatchExpression.bind(this));
+ }
},
startEditing: function()

Powered by Google App Engine
This is Rietveld 408576698