Am I doing something silly. Do I need a different version of the javascript (Spider Monkey) library.
#!/usr/bin/perl use strict; use JavaScript qw(:all); my $runtime = JavaScript::Runtime->new(); my $context = $runtime->create_context(); $context->bind_class( name => 'Loo', constructor => sub { print STDERR "x = x\n"; my $x = Foo->new(@_); print STDERR "x = $x\n"; return $x; }, 'package' => 'Foo' ); print $context->eval("new Loo();"); { package Foo; sub new { my $ret = bless { @_ }, 'Foo'; print "-new- (@_) $ret\n"; return $ret; } }
Update: removed Methods because they are not needed for example.
In reply to Segfault with JavaScript in Debian by gam3
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |