1
0
Fork 0
mirror of https://github.com/perlbot/perlbuut synced 2025-06-07 18:15:40 -04:00
perlbuut/deps/JavaScript-SpiderMonkey-0.19-patched/t/06form2.t
2009-12-05 00:02:04 -05:00

35 lines
739 B
Perl
Executable file

######################################################################
# docwrite()
######################################################################
print "1..1\n";
$init = "";
require "t/init.pl";
my $a = $js->array_by_path("document.array");
my $e = $js->array_set_element($a, 0, "gurkenhobel");
#print "SetElement returned $e\n";
my $r = $js->array_get_element($a, 0);
#print "r=$r\n";
#print $js->dump();
my $source = <<EOT;
$init
document.location.href = document.array[0];
EOT
my $rc = $js->eval($source);
die "eval returned undef" unless $rc;
my $val = $js->property_get("document.location.href");
if($val ne "gurkenhobel") {
print STDERR "Val is '$val'\n";
print "not ";
}
print "ok 1\n";
$js->destroy();