JavaScript::QuickJS::Function
my $func = JavaScript::QuickJS->new()->eval("() => 123"); print $func->(); # prints “123”; note overloading :)
This class represents a JavaScript Function instance in Perl.
This class is not instantiated directly.
For convenience, instances of this class are callable as Perl code references. This is equivalent to a call() with $this_sv (see below) set to undef.
call()
See the "SYNOPSIS" above for an example.
Like JavaScript’s method of the same name.
The following methods return their corresponding JS property:
length()
name()
To install JavaScript::QuickJS, copy and paste the appropriate command in to your terminal.
cpanm
cpanm JavaScript::QuickJS
CPAN shell
perl -MCPAN -e shell install JavaScript::QuickJS
For more information on module installation, please visit the detailed CPAN module installation guide.