WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
195310
Web Inspector: Protocol: add type checking when commands are called via invoke
https://bugs.webkit.org/show_bug.cgi?id=195310
Summary
Web Inspector: Protocol: add type checking when commands are called via invoke
Devin Rousso
Reported
2019-03-04 20:39:55 PST
Right now we only do type checking for when it is called like a normal function.
Attachments
Patch
(4.36 KB, patch)
2019-03-04 21:20 PST
,
Devin Rousso
no flags
Details
Formatted Diff
Diff
Archive of layout-test-results from ews121 for ios-simulator-wk2
(8.85 MB, application/zip)
2019-03-05 03:07 PST
,
EWS Watchlist
no flags
Details
Patch
(24.90 KB, patch)
2019-03-05 13:22 PST
,
Devin Rousso
no flags
Details
Formatted Diff
Diff
Patch
(27.81 KB, patch)
2019-03-07 11:40 PST
,
Devin Rousso
no flags
Details
Formatted Diff
Diff
Show Obsolete
(3)
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2019-03-04 20:41:48 PST
<
rdar://problem/48588679
>
Devin Rousso
Comment 2
2019-03-04 21:20:24 PST
Created
attachment 363596
[details]
Patch
EWS Watchlist
Comment 3
2019-03-04 21:22:26 PST
Comment hidden (obsolete)
Attachment 363596
[details]
did not pass style-queue: ERROR: Source/WebInspectorUI/UserInterface/Protocol/InspectorBackend.js:426: Line contains single-quote character. [js/syntax] [5] ERROR: Source/WebInspectorUI/UserInterface/Protocol/InspectorBackend.js:429: Line contains single-quote character. [js/syntax] [5] ERROR: Source/WebInspectorUI/UserInterface/Protocol/InspectorBackend.js:475: Line contains single-quote character. [js/syntax] [5] Total errors found: 3 in 2 files If any of these errors are false positives, please file a bug against check-webkit-style.
EWS Watchlist
Comment 4
2019-03-05 03:07:26 PST
Comment hidden (obsolete)
Comment on
attachment 363596
[details]
Patch
Attachment 363596
[details]
did not pass ios-sim-ews (ios-simulator-wk2): Output:
https://webkit-queues.webkit.org/results/11375595
New failing tests: fast/scrolling/ios/hit-testing-iframe-004.html
EWS Watchlist
Comment 5
2019-03-05 03:07:28 PST
Comment hidden (obsolete)
Created
attachment 363628
[details]
Archive of layout-test-results from ews121 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews121 Port: ios-simulator-wk2 Platform: Mac OS X 10.13.6
Blaze Burg
Comment 6
2019-03-05 09:18:59 PST
Comment on
attachment 363596
[details]
Patch Good change but.. it needs to be tested. Please update inspector-backend-invocation-return-value.html to exercise the invoke() code paths.
Devin Rousso
Comment 7
2019-03-05 13:22:02 PST
Created
attachment 363678
[details]
Patch
EWS Watchlist
Comment 8
2019-03-05 13:34:41 PST
Comment hidden (obsolete)
Attachment 363678
[details]
did not pass style-queue: ERROR: Source/WebInspectorUI/UserInterface/Protocol/InspectorBackend.js:423: Line contains single-quote character. [js/syntax] [5] ERROR: Source/WebInspectorUI/UserInterface/Protocol/InspectorBackend.js:428: Line contains single-quote character. [js/syntax] [5] ERROR: Source/WebInspectorUI/UserInterface/Protocol/InspectorBackend.js:435: Line contains single-quote character. [js/syntax] [5] ERROR: Source/WebInspectorUI/UserInterface/Protocol/InspectorBackend.js:481: Line contains single-quote character. [js/syntax] [5] Total errors found: 4 in 5 files If any of these errors are false positives, please file a bug against check-webkit-style.
Joseph Pecoraro
Comment 9
2019-03-07 11:28:58 PST
Comment on
attachment 363678
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=363678&action=review
> Source/WebInspectorUI/UserInterface/Protocol/InspectorBackend.js:428 > + if (typeof commandArguments !== "object") { > + if (!optional) > + return deliverFailure(`Invalid number of arguments for command '${instance.qualifiedName}'.`); > + continue; > + } > + > + if (!(name in commandArguments) && !optional) > + return deliverFailure(`Missing argument '${name}' for command '${instance.qualifiedName}'.`);
Could we just require the first argument is always an object to simplify this a bit: if (typeof commandArguments !== "object") return deliverFailure(`invoke expects an object for command arguments but it was a '${typeof commandArguments}'.`); let parameters = {}; for (let {name, type, optional} of instance.callSignature) { if ((!name in commandArguments && !optional) return deliverFailure(`Missing argument '${name}' for command '${instance.qualifiedName}'.`); ... }
> LayoutTests/inspector/protocol/inspector-backend-invocation-return-value.html:122 > + let result = RuntimeAgent.evaluate.invoke();
In other words I don't think we should allow calling invoke with no object (even if there are no required arguments).
Devin Rousso
Comment 10
2019-03-07 11:30:47 PST
Comment on
attachment 363678
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=363678&action=review
>> LayoutTests/inspector/protocol/inspector-backend-invocation-return-value.html:122 >> + let result = RuntimeAgent.evaluate.invoke(); > > In other words I don't think we should allow calling invoke with no object (even if there are no required arguments).
I'm fine with that. I wasn't sure which approach we wanted to take, so I just matched the existing functionality.
Devin Rousso
Comment 11
2019-03-07 11:40:19 PST
Created
attachment 363905
[details]
Patch
EWS Watchlist
Comment 12
2019-03-07 11:42:14 PST
Comment hidden (obsolete)
Attachment 363905
[details]
did not pass style-queue: ERROR: Source/WebInspectorUI/UserInterface/Protocol/InspectorBackend.js:420: Line contains single-quote character. [js/syntax] [5] ERROR: Source/WebInspectorUI/UserInterface/Protocol/InspectorBackend.js:425: Line contains single-quote character. [js/syntax] [5] ERROR: Source/WebInspectorUI/UserInterface/Protocol/InspectorBackend.js:432: Line contains single-quote character. [js/syntax] [5] ERROR: Source/WebInspectorUI/UserInterface/Protocol/InspectorBackend.js:478: Line contains single-quote character. [js/syntax] [5] Total errors found: 4 in 5 files If any of these errors are false positives, please file a bug against check-webkit-style.
Joseph Pecoraro
Comment 13
2019-03-07 11:53:42 PST
Comment on
attachment 363905
[details]
Patch r=me
WebKit Commit Bot
Comment 14
2019-03-07 12:40:19 PST
Comment on
attachment 363905
[details]
Patch Clearing flags on attachment: 363905 Committed
r242606
: <
https://trac.webkit.org/changeset/242606
>
WebKit Commit Bot
Comment 15
2019-03-07 12:40:21 PST
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug