Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can you call JavaScript builtins from Perl 6 with the new JS backend?

I know it is possible to invoke Java when Perl 6 is using that backend: How do I invoke a Java method from perl6

Is there a way yet to access e.g. the JavaScript DOM interface from Perl 6 with the new Rakudo JavaScript VM running in the browser?

Perhaps something like this:

use v6;
use javascript::dom:from<JavaScript>;
like image 701
S. Albano Avatar asked Oct 09 '18 18:10

S. Albano


1 Answers

You can now access the DOM using EVAL(:lang, 'return document') See https://perl6.github.io/6pad/#4ee170f8043efe4802c8e6fb55d6a187 for an example.

like image 193
pmurias Avatar answered Sep 20 '22 06:09

pmurias