- Timestamp:
- 08/21/08 09:36:06 (3 months ago)
- Location:
- trunk/WebCore
- Files:
-
- 2 modified
-
ChangeLog (modified) (1 diff)
-
page/inspector/ObjectPropertiesSection.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r35873 r35874 1 2008-08-21 Anthony Ricaud <rik24d@gmail.com> 2 3 After trying to add the expression, try again with quotes for 4 easier edition. 5 6 https://bugs.webkit.org/show_bug.cgi?id=20466 7 8 Reviewed by Tim Hatcher. 9 10 * page/inspector/ObjectPropertiesSection.js: Added an 11 evaluateExpression function. 12 1 13 2008-08-21 Anthony Ricaud <rik24d@gmail.com> 2 14 -
trunk/WebCore/page/inspector/ObjectPropertiesSection.js
r35835 r35874 215 215 }, 216 216 217 evaluateExpression: function(expression) 218 { 219 // Evaluate in the currently selected call frame if the debugger is paused. 220 // Otherwise evaluate in against the inspected window. 221 if (WebInspector.panels.scripts.paused && this.treeOutline.section.editInSelectedCallFrameWhenPaused) 222 return WebInspector.panels.scripts.evaluateInSelectedCallFrame(expression, false); 223 return InspectorController.inspectedWindow().eval(expression); 224 }, 225 217 226 applyExpression: function(expression, updateInterface) 218 227 { … … 236 245 } 237 246 238 // Surround the expression in parenthesis so the result of the eval is the result239 // of the whole expression not the last potential sub-expression.240 expression = "(" + expression + ")";241 242 247 try { 243 // Evaluate in the currently selected call frame if the debugger is paused. 244 // Otherwise evaluate in against the inspected window. 245 if (WebInspector.panels.scripts.paused && this.treeOutline.section.editInSelectedCallFrameWhenPaused) 246 var result = WebInspector.panels.scripts.evaluateInSelectedCallFrame(expression, false); 247 else 248 var result = InspectorController.inspectedWindow().eval(expression); 248 // Surround the expression in parenthesis so the result of the eval is the result 249 // of the whole expression not the last potential sub-expression. 250 var result = this.evaluateExpression("(" + expression + ")"); 249 251 250 252 // Store the result in the property. 251 253 this.parentObject[this.propertyName] = result; 252 254 } catch(e) { 253 // The expression failed so don't change the value. So just update and return. 254 if (updateInterface) 255 this.update(); 256 return; 255 try { 256 // Try to update as a string 257 var result = this.evaluateExpression("\"" + expression.escapeCharacters("\"") + "\""); 258 259 // Store the result in the property. 260 this.parentObject[this.propertyName] = result; 261 } catch(e) { 262 // The expression failed so don't change the value. So just update and return. 263 if (updateInterface) 264 this.update(); 265 return; 266 } 257 267 } 258 268