Permalink
Browse files

fixed Socket

  • Loading branch information...
1 parent 0c0c0da commit b435a6ee1c1f7c2ca2a8278cf57ba45d82f375d5 @cooper committed Apr 3, 2012
Showing with 5 additions and 4 deletions.
  1. +1 −1 lib/pje/P.pm
  2. +4 −3 lib/pje/core/Socket.js.pm
View
@@ -136,7 +136,7 @@ sub search_directory {
search_directory("$curr/$next");
}
elsif (-f "$curr/$next") {
- next if $next !~ m/(.+?)\.(js.pm|js)/;
+ next if $next !~ m/(.+?)\.(js.pm|js)$/;
$MODULES{$1} = "$curr/$next" unless $MODULES{$1};
}
$curr = $last_curr;
@@ -6,14 +6,15 @@ use warnings;
our $VERSION = '1.0';
our @ISA = 'M::IOHandle';
-P::load('IOHandle');
+P::load_now('IOHandle');
use IO::Socket::IP;
sub new {
my ($class, $global, $opts) = @_;
- $global->{IOHandle} or return; # tells JE to load IOHandle module
- return if !ref $opts || (ref $opts ne 'HASH' && !UNIVERSAL::can($opts, 'typeof'));
+ $global->{IOHandle} or return JE::Object::Error->new($global, 'Socket could not find IOHandle');
+ return JE::Object::Error::TypeError->new($global, 'Socket expected object of options')
+ if !ref $opts || (ref $opts ne 'HASH' && !UNIVERSAL::can($opts, 'typeof'));
$opts = $opts->value if UNIVERSAL::can($opts, 'typeof');
my %opts = %$opts;

0 comments on commit b435a6e

Please sign in to comment.