Bug 20466 - Editing a property without quotes should add them if possible
Summary: Editing a property without quotes should add them if possible
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-20 15:10 PDT by Anthony Ricaud
Modified: 2008-08-21 09:36 PDT (History)
0 users

See Also:


Attachments
Proposed patch (3.55 KB, patch)
2008-08-20 15:17 PDT, Anthony Ricaud
timothy: review-
Details | Formatted Diff | Diff
Comments adressed (3.54 KB, patch)
2008-08-20 18:12 PDT, Anthony Ricaud
timothy: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Anthony Ricaud 2008-08-20 15:10:30 PDT
When editing a string property, people may not add quotes. After trying the expression entered, the inspector should try again with quotes.
Comment 1 Anthony Ricaud 2008-08-20 15:17:06 PDT
Created attachment 22902 [details]
Proposed patch
Comment 2 Timothy Hatcher 2008-08-20 15:26:30 PDT
Comment on attachment 22902 [details]
Proposed patch

+            var result = WebInspector.panels.scripts.evaluateInSelectedCallFrame(expression, false);
+        else
+            var result = InspectorController.inspectedWindow().eval(expression);
+        return result;

no need to store in a variable, just return in the two places.

+            var result = this.evaluateExpression("(" + expression + ")");
             // Store the result in the property.
             this.parentObject[this.propertyName] = result;

Put a empty line between the var result and the comment.

+                var result = this.evaluateExpression('"' + expression + '"');
+                // Store the result in the property.
+                this.parentObject[this.propertyName] = result;

You should escape double quotes in the expression, otherwise it will fail unexpectedly. Also put a empty line between the var result and the comment.

r- for now until the string is escaped. Just do expression.escapeCharacters("\"");
Comment 3 Anthony Ricaud 2008-08-20 18:12:08 PDT
Created attachment 22916 [details]
Comments adressed
Comment 4 Timothy Hatcher 2008-08-21 09:36:23 PDT
Landed in r35874.