Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Perlito5 - js - create ''
  • Loading branch information
fglock committed Apr 1, 2014
1 parent ac8d035 commit 4fdfade
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion html/perlito5.js
Expand Up @@ -12715,7 +12715,7 @@ return (p5context([(p5str((p5pkg["Perlito5::Javascript2::LexicalBlock"]["v__"] |
}
else if ( (!( p5bool((v_self || (v_self = new p5HashRef({})))._hash_.p5hget('namespace'))) && (p5str((v_self || (v_self = new p5HashRef({})))._hash_.p5hget('sigil')) != '*')) ) {
(function () {
if ( p5bool(p5make_package("Perlito5")["v_STRICT"]) ) {
if ( ((p5bool(p5make_package("Perlito5")["v_STRICT"]) && (p5str((v_self || (v_self = new p5HashRef({})))._hash_.p5hget('name')) != '0')) && !( p5bool((0 + p5num((v_self || (v_self = new p5HashRef({})))._hash_.p5hget('name')))))) ) {
p5pkg["Perlito5::AST::Var"].die([[('Global symbol "' + p5str(v_perl5_name) + '" requires explicit package name')]], null);
};
v_decl_type = ('our');
Expand Down
2 changes: 1 addition & 1 deletion perlito5.pl
Expand Up @@ -9001,7 +9001,7 @@ package Perlito5::AST::Var;
$decl_type = $decl->{'decl'}
}
elsif (!$self->{'namespace'} && $self->{'sigil'} ne '*') {
if ($Perlito5::STRICT) {
if ($Perlito5::STRICT && $self->{'name'} ne 0 && !(0 + $self->{'name'})) {
die('Global symbol "' . $perl5_name . '" requires explicit package name')
}
$decl_type = 'our';
Expand Down
5 changes: 4 additions & 1 deletion src5/lib/Perlito5/Javascript2/Emitter.pm
Expand Up @@ -1067,7 +1067,10 @@ package Perlito5::AST::Var;
&& $self->{sigil} ne '*'
)
{
if ( $Perlito5::STRICT ) {
if ( $Perlito5::STRICT
&& $self->{name} ne '0' # $0 @0 %0
&& !(0 + $self->{name}) # $1 @2 %3
) {
die "Global symbol \"$perl5_name\" requires explicit package name"
}
# no strict - "auto-declare" the var
Expand Down

0 comments on commit 4fdfade

Please sign in to comment.