Peertube-dl/bin/js-pruebas

25 lines
559 B
Plaintext
Raw Normal View History

#!/usr/bin/env perl
2021-01-06 20:47:33 +01:00
#
use strict;
use warnings;
use feature 'say';
use Peertube::DL::Javascript;
my $a = Peertube::DL::Javascript::_duk_create_heap_default();
if ( defined $a ) {
eval {
my $return = Peertube::DL::Javascript::_duk_eval_wrapper(
$a,
"function a(nombre) { return 'Hello ' + nombre; }; a('sergio');"
);
say $return;
};
if ($@) {
warn $@;
}
say Peertube::DL::Javascript::_duk_call_function( $a, "a", "sergio" );
Peertube::DL::Javascript::_duk_destroy_heap($a);
2021-01-06 20:47:33 +01:00
}