mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-12-04 16:40:32 +00:00
JSObjectMakeFunction joins the name, the parameters and the body into
"(function name(params) {\nbody\n})" and evaluates it. A body such as
"}), sideEffect(), (function () {" closed the function early: the call
ran sideEffect() and returned another function. Parameters, or a name,
could do the same.
JavaScriptCore parses the joined text as a program that must be a
single function whose parameters end where the given ones end, and
raises a SyntaxError otherwise. QuickJS gives no such check, so the
text is compiled, without being run, a few more times: the parameters
alone, the body alone, and with a declaration added after the body
that must land in the function that owns the first parameter.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
783 B
783 B
libSceNKWebKit
add Functional
- JSObjectMakeFunction text (libSceNKWebKit) - not checked on a console. The name, the parameters and the body must form one function, as
UnlinkedFunctionExecutable::fromGlobalCoderequires; text that closes the function early is refused with aSyntaxErrorand is not run. QuickJS cannot say where a function ends, so the check compiles the text several times instead, and the message isParser erroror the parameters message of JavaScriptCore, not always the one its parser gives. Closes when: compared with a console.