OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) IBM Corp. 2009 All rights reserved. | 2 * Copyright (C) IBM Corp. 2009 All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 * @return {?string} | 247 * @return {?string} |
248 */ | 248 */ |
249 expression: function() | 249 expression: function() |
250 { | 250 { |
251 return this._expression; | 251 return this._expression; |
252 }, | 252 }, |
253 | 253 |
254 update: function() | 254 update: function() |
255 { | 255 { |
256 var currentExecutionContext = WebInspector.context.flavor(WebInspector.E
xecutionContext); | 256 var currentExecutionContext = WebInspector.context.flavor(WebInspector.E
xecutionContext); |
257 if (currentExecutionContext && this._expression) | 257 if (currentExecutionContext && this._expression) { |
| 258 var location = currentExecutionContext.pauseLocation(); |
| 259 if (location) { |
| 260 var activeMime = WebInspector.ResourceType.mimeFromUrl(location.
source); |
| 261 if (WebInspector.languageService.handles.transpile(activeMime))
{ |
| 262 var expr = this._expression; |
| 263 var prom = this._pendingUpdate = WebInspector.languageServic
e.transpile(activeMime, expr, location).then(result => { |
| 264 if (this._pendingUpdate !== prom) { |
| 265 //cancelled by another update |
| 266 return; |
| 267 } |
| 268 currentExecutionContext.evaluate(result, WebInspector.Wa
tchExpression._watchObjectGroupId, false, true, false, false, this._createWatchE
xpression.bind(this)); |
| 269 }).catch((e) => { |
| 270 currentExecutionContext.evaluate(expr, WebInspector.Watc
hExpression._watchObjectGroupId, false, true, false, false, this._createWatchExp
ression.bind(this)); |
| 271 }); |
| 272 return; |
| 273 } |
| 274 } |
258 currentExecutionContext.evaluate(this._expression, WebInspector.Watc
hExpression._watchObjectGroupId, false, true, false, false, this._createWatchExp
ression.bind(this)); | 275 currentExecutionContext.evaluate(this._expression, WebInspector.Watc
hExpression._watchObjectGroupId, false, true, false, false, this._createWatchExp
ression.bind(this)); |
| 276 } |
259 }, | 277 }, |
260 | 278 |
261 startEditing: function() | 279 startEditing: function() |
262 { | 280 { |
263 this._editing = true; | 281 this._editing = true; |
264 this._element.removeChild(this._objectPresentationElement); | 282 this._element.removeChild(this._objectPresentationElement); |
265 var newDiv = this._element.createChild("div"); | 283 var newDiv = this._element.createChild("div"); |
266 newDiv.textContent = this._nameElement.textContent; | 284 newDiv.textContent = this._nameElement.textContent; |
267 this._textPrompt = new WebInspector.ObjectPropertyPrompt(); | 285 this._textPrompt = new WebInspector.ObjectPropertyPrompt(); |
268 this._textPrompt.renderAsBlock(); | 286 this._textPrompt.renderAsBlock(); |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 contextMenu.appendApplicableItems(this._result); | 442 contextMenu.appendApplicableItems(this._result); |
425 }, | 443 }, |
426 | 444 |
427 _copyValueButtonClicked: function() | 445 _copyValueButtonClicked: function() |
428 { | 446 { |
429 InspectorFrontendHost.copyText(this._valueElement.textContent); | 447 InspectorFrontendHost.copyText(this._valueElement.textContent); |
430 }, | 448 }, |
431 | 449 |
432 __proto__: WebInspector.Object.prototype | 450 __proto__: WebInspector.Object.prototype |
433 } | 451 } |
OLD | NEW |