Repository navigation
Conversation
…guments
`#evaluate`, `#evaluate_async`, `#execute`, `#evaluate_func` and `#evaluate_on` had four argument conventions and three
return semantics between them, and scripts reached their arguments through `arguments[0]`. Now there are three entry
points sharing one convention, plus the same three on `Node` with `this` bound to the element:
- Keyword arguments become the script's parameters, `page.evaluate("a + b", a: 1, b: 2)`, bound by name when the script
is a function declaration. Positional arguments keep working through `arguments[n]` but can't be mixed with them.
- A script is an expression, which gets wrapped, or a function/arrow declaration, used as-is. Scripts are read by a
small scanner, `Frame::Script`, that skips strings, template literals, regular expressions and comments.
- A returned promise or thenable is awaited, bounded by `timeout:` and raising `ScriptTimeoutError`, now a
`TimeoutError`. `await` works directly.
- `#evaluate_handle` returns a `Ferrum::RemoteObject`, and `Node#execute`/`Node#evaluate_handle` are added.
- `#evaluate_async`, `#evaluate_func` and `#evaluate_on` are removed.
This is the end state of the two-step migration that first ships the new API next to the old one with warnings.
route
force-pushed
the
feat/js-api-final
branch
from
October 21, 2026 19:20
6d3f7c8 to
19f318d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The combined end state of #659 and #660, as one diff from
main, for reviewing the final design without the compatibility layer that #659 adds and #660 removes. Its tree is identical to #660's branch.Kept as a draft: the plan is to merge #659 for 0.20, then #660 for 0.21.