1
0
Fork 0
mirror of https://github.com/perlbot/perlbuut synced 2025-06-07 10:35:41 -04:00
perlbuut/deps/JavaScript-SpiderMonkey-0.19-patched/t/.svn/text-base/10elobj.t.svn-base
2009-12-05 00:02:04 -05:00

33 lines
634 B
Text

######################################################################
# functions2
######################################################################
print "1..1\n";
$init = "";
require "t/init.pl";
$submitted = "0";
my $obj = $js->object_by_path("submitter");
$js->function_set("submit", sub { $submitted = 1 });
my $forms = $js->array_by_path("document.forms");
my $e = $js->array_set_element_as_object($forms, 0, $obj);
my $source = <<EOT;
$init
document.forms[0].submit();
EOT
my $rc = $js->eval($source);
die "eval returned undef" unless $rc;
if(!$submitted) {
print "not ";
}
print "ok 1\n";
$js->destroy();