Arrow function in ScriptCompiler::CompileFunction source argument

14 views
Skip to first unread message

Joseph Canedo

unread,
May 25, 2026, 6:11:12 AM (22 hours ago) May 25
to v8-dev
Hi all,

In C++ code we use ScriptCompiler::CompileFunction() member function to compile JS function source code. From documentation it says that's equivalent to

with (obj) { return function(args) { ... } }

Where I understand source argument goes to the ... location above.

Is there a way to have an arrow function compiled and created from ScriptCompiler C++ any Compile function ? Idea would be to avoid explicit return statement for small one line functions.

Many thanks for advice,
Best

Joseph

Reply all
Reply to author
Forward
0 new messages