Bug 156183

Summary: Web Inspector: Uncaught exception in CSS with string "constructor" (WebInspector.Color.fromString())
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: Web InspectorAssignee: Joseph Pecoraro <joepeck>
Status: RESOLVED FIXED    
Severity: Normal CC: bburg, commit-queue, graouts, joepeck, mattbaker, nvasilyev, timothy, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
[PATCH] Proposed Fix
bburg: review+, bburg: commit-queue-
[PATCH] For Landing none

Description Joseph Pecoraro 2016-04-04 15:24:30 PDT
* SUMMARY
Uncaught exception in CSS with string "constructor" (WebInspector.Color.fromString())

* TEST
constructor { constructor: constructor; }

* EXCEPTION:
[Error] Uncaught exception in promise
TypeError: WebInspector.Color.Keywords[keyword].concat is not a function. (In 'WebInspector.Color.Keywords[keyword].concat(1)', 'WebInspector.Color.Keywords[keyword].concat' is undefined)

fromString — Color.js:112:131
createCodeMirrorTextMarkers — CodeMirrorTextMarkers.js:65
createCodeMirrorColorTextMarkers — CodeMirrorTextMarkers.js:121
_updateEditableMarkers — SourceCodeTextEditor.js:1582
_contentDidPopulate — SourceCodeTextEditor.js:431
_populateWithContent — SourceCodeTextEditor.js:449
_contentAvailable — SourceCodeTextEditor.js:472
_contentAvailable
promiseReactionJob
	promiseLogError (Utilities.js:1250)
	promiseReactionJob
Comment 1 Radar WebKit Bug Importer 2016-04-04 15:24:51 PDT
<rdar://problem/25539279>
Comment 2 Joseph Pecoraro 2016-04-04 15:41:10 PDT
Created attachment 275583 [details]
[PATCH] Proposed Fix
Comment 3 BJ Burg 2016-04-04 16:04:47 PDT
Comment on attachment 275583 [details]
[PATCH] Proposed Fix

View in context: https://bugs.webkit.org/attachment.cgi?id=275583&action=review

> Source/WebInspectorUI/UserInterface/Debug/UncaughtExceptionReporter.js:213
> +window.promiseLogError = handleError;

heh heh, very clever.

> Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js:81
> +        sourceCode.requestContent().then(this._contentAvailable.bind(this)).catch(promiseLogError);

Reading this function in context, I don't like the function name. It sounds like the verb is 'promise' to log something, not 'log' a promise error. Maybe it should be called handlePromiseException or something.

> Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js:83
>          // FIXME: Cmd+L shorcut doesn't actually work.

Drive-by Nit: 'shortcut'
Comment 4 Joseph Pecoraro 2016-04-04 16:13:35 PDT
Created attachment 275587 [details]
[PATCH] For Landing
Comment 5 WebKit Commit Bot 2016-04-04 17:12:30 PDT
Comment on attachment 275587 [details]
[PATCH] For Landing

Clearing flags on attachment: 275587

Committed r199031: <http://trac.webkit.org/changeset/199031>
Comment 6 WebKit Commit Bot 2016-04-04 17:12:34 PDT
All reviewed patches have been landed.  Closing bug.