Bug 158548 - REGRESSION: Web Inspector: Should be able to evaluate "{a:1, b:2}" in the console
Summary: REGRESSION: Web Inspector: Should be able to evaluate "{a:1, b:2}" in the con...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Joseph Pecoraro
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-06-08 15:46 PDT by Joseph Pecoraro
Modified: 2016-06-08 23:19 PDT (History)
8 users (show)

See Also:


Attachments
[PATCH] Proposed Fix (25.00 KB, patch)
2016-06-08 18:45 PDT, Joseph Pecoraro
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Pecoraro 2016-06-08 15:46:11 PDT
* Summary
Web Inspector: Should be able to evaluate "{a:1, b:2}" in the console

* Notes
- Looks like this regressed when adding the console evaluation names
- The sourceURL is appended to the evaluation text before runtime manager has looked at it
- And runtime manager is where we add the convenience

>     consolePromptTextCommitted(prompt, text)
>     {
>         ...
>         text = appendWebInspectorConsoleEvaluationSourceURL(text);
> 
>         WebInspector.runtimeManager.evaluateInInspectedWindow(text, WebInspector.RuntimeManager.ConsoleObjectGroup, true, false, false, true, true, printResult.bind(this));
>     }

>    evaluateInInspectedWindow(expression, objectGroup, includeCommandLineAPI, doNotPauseOnExceptionsAndMuteConsole, returnByValue, generatePreview, saveResult, callback)
>    {
>        if (!expression) {
>            // There is no expression, so the completion should happen against global properties.
>            expression = "this";
>        } else if (/^\s*\{/.test(expression) && /\}\s*$/.test(expression)) {
>            // Transform {a:1} to ({a:1}) so it is treated like an object literal instead of a block with a label.
>            expression = "(" + expression + ")";
>        }
>        ...
Comment 1 Joseph Pecoraro 2016-06-08 15:47:05 PDT
Lets just move the convenience to consolePromptTextCommitted. It really is the only place I think we expect this to happen right now.
Comment 2 Radar WebKit Bug Importer 2016-06-08 15:49:13 PDT
<rdar://problem/26708513>
Comment 3 Joseph Pecoraro 2016-06-08 18:45:48 PDT
Created attachment 280866 [details]
[PATCH] Proposed Fix
Comment 4 WebKit Commit Bot 2016-06-08 23:19:26 PDT
Comment on attachment 280866 [details]
[PATCH] Proposed Fix

Clearing flags on attachment: 280866

Committed r201855: <http://trac.webkit.org/changeset/201855>
Comment 5 WebKit Commit Bot 2016-06-08 23:19:30 PDT
All reviewed patches have been landed.  Closing bug.