| JE documentation | Contained in the JE distribution. |
JE::Object::Error::URIError - JavaScript URIError object class
use JE::Object::Error::URIError;
# Somewhere in code called by an eval{}
die new JE::Object::Error::URIError $global, "(Error message here)";
# Later:
$@->prop('message'); # error message
$@->prop('name'); # 'URIError'
"$@"; # 'URIError: ' plus the error message
This class implements JavaScript URIError objects for JE.
See JE::Types and JE::Object::Error.
| JE documentation | Contained in the JE distribution. |
package JE::Object::Error::URIError; our $VERSION = '0.042'; use strict; use warnings; our @ISA = 'JE::Object::Error'; require JE::Object::Error; require JE::String;
sub class { 'URIError' } sub new_constructor { shift->JE::Object::new_constructor(shift, sub { __PACKAGE__->new(@_); }, sub { my $proto = shift; (my $global = $$proto->{global})->prototype_for( URIError => $proto ); bless $proto, __PACKAGE__; $proto->prototype( $global->prototype_for('Error') || $global->prop('Error')->prop('prototype') ); $proto->prop({ name => 'name', value => JE::String->_new($global, 'URIError'), dontenum => 1, }); $proto->prop({ name => 'message', value => JE::String->_new($global, 'URI error'), dontenum => 1, }); }, ); } return "a true value";