1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
#!/usr/bin/env entity
<object>
<window ondelete="entity:exit">
<button label="try returning" onclick="try_return"/>
<button label="try dieing with print" onclick="try_die_print"/>
<button label="try dieing" onclick="try_die"/>
</window>
<data name="test" />
<perl><![CDATA[
print "This is a test of the new confess and protection code\n\n";
my $node = enode("data.test");
my $broke = enode("data.Test worked if you see this in error messages.");
if(!$broke) #this should fail...
{
print "Protected $broke\n";
}
## Not protected.
$broke->attrib ("this" => "that");
sub try_return
{
print "in try_fail\n";
my $broke = enode("data.this one will fail cleanly") || return;
}
sub try_die_print
{
print "in try_fail\n";
my $broke = enode("data.this one will fail cleanly") || die "Test worked.\n";
}
sub try_die
{
print "in try_fail\n";
my $broke = enode("data.this one will fail cleanly") || die;
}
]]></perl>
</object>
|