WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
282130
Web Inspector: Add eager evaluation in Console
https://bugs.webkit.org/show_bug.cgi?id=282130
Summary
Web Inspector: Add eager evaluation in Console
novov
Reported
2024-10-25 22:37:26 PDT
"Eager evaluation" in this case means a little preview of the results of the expression as it is being typed, and an expansion of the autocompletion functionality to suggest results from this evaluation. Both FF and Chrome have this feature; when debugging an app that uses Electron on desktop but WebKit on iOS this is the largest disparity in terms of functionality, as it makes working with complex object structures a lot quicker and easier. Internally, both browsers evaluate the code and terminate if it cannot be guaranteed that there are no side effects. This is done by maintaining a list of safe operations (property access, etc) under certain conditions (no proxies, etc), and some allowed builtins:
https://searchfox.org/mozilla-central/source/devtools/server/actors/webconsole/eager-ecma-allowlist.js
https://searchfox.org/mozilla-central/source/devtools/server/actors/webconsole/webidl-pure-allowlist.js
https://source.chromium.org/chromium/chromium/src/+/main:v8/src/debug/debug-evaluate.cc;drc=7804fc4cc9837d70a6f52f7617612884cac261a5;l=537
Firefox uses the developer debugging functionality to step through the code and stop if disallowed code is reached:
https://searchfox.org/mozilla-central/source/devtools/server/actors/webconsole/eval-with-debugger.js#434
Chrome implements it differently, implementing it as a feature in V8 that runs the code and throws an exception if disallowed code is reached.
Attachments
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2024-10-27 14:12:45 PDT
<
rdar://problem/138736709
>
Karl Dubost
Comment 2
2024-11-07 22:11:13 PST
I think there is a bug already for this, but I can't find it right now.
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