RESOLVED FIXED 218686
Web Inspector: ensure that `JSON::ArrayOf<T>` doesn't allow `addItem` to be called with a type other than `T`
https://bugs.webkit.org/show_bug.cgi?id=218686
Summary Web Inspector: ensure that `JSON::ArrayOf<T>` doesn't allow `addItem` to be c...
Devin Rousso
Reported 2020-11-07 11:16:04 PST
Right now, `JSON::ArrayOf<T>` always has `addItem` overloads for `int`, `double`, `String`, and `Ref<T>` (even when `T` is not a `JSON::Value`). This means that I could have a `JSON::ArrayOf<int>` and call `addItem(42.0)` or `addItem("foo"_s)` and it would work. We should prevent that.
Attachments
Patch (2.94 KB, patch)
2020-11-07 11:16 PST, Devin Rousso
no flags
Patch (60.43 KB, patch)
2020-11-08 23:58 PST, Devin Rousso
no flags
Devin Rousso
Comment 1 2020-11-07 11:16:36 PST
Devin Rousso
Comment 2 2020-11-08 23:58:56 PST
EWS Watchlist
Comment 3 2020-11-08 23:59:53 PST
This patch modifies the inspector protocol generator. Please ensure that you have rebaselined any generator test results (i.e., by running `Tools/Scripts/run-inspector-generator-tests --reset-results`)
Blaze Burg
Comment 4 2020-11-12 14:32:08 PST
Comment on attachment 413563 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=413563&action=review r=me > Source/JavaScriptCore/inspector/scripts/codegen/cpp_generator_templates.py:142 > + static NeverDestroyed<DispatchMap> dispatchMap = DispatchMap({ 🤯 > Source/JavaScriptCore/inspector/scripts/tests/expected/domains-with-varying-command-sizes.json-result:342 > + static NeverDestroyed<DispatchMap> dispatchMap = DispatchMap({ Ugh, you are the best, Devin! This is so much nicer.
EWS
Comment 5 2020-11-12 14:54:41 PST
Committed r269757: <https://trac.webkit.org/changeset/269757> All reviewed patches have been landed. Closing bug and clearing flags on attachment 413563 [details].
Radar WebKit Bug Importer
Comment 6 2020-11-12 14:55:19 PST
Note You need to log in before you can comment on or make changes to this bug.