File tree Expand file tree Collapse file tree 3 files changed +10
-7
lines changed
src5/lib/Perlito5/Javascript3 Expand file tree Collapse file tree 3 files changed +10
-7
lines changed Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change @@ -1844,13 +1844,13 @@ package Perlito5::AST::Apply;
1844
1844
)
1845
1845
{
1846
1846
$v = Perlito5::AST::Var-> new( sigil => ' %' , namespace => $v -> namespace, name => $v -> name );
1847
- return ' (' . $v -> emit_javascript3() . ' ).hasOwnProperty (' . Perlito5::Javascript3::autoquote($arg -> {index_exp }, $level ) . ' )' ;
1847
+ return ' (' . $v -> emit_javascript3() . ' ).exists (' . Perlito5::Javascript3::autoquote($arg -> {index_exp }, $level ) . ' )' ;
1848
1848
}
1849
- return ' (' . $v -> emit_javascript3() . ' ).hderef().hasOwnProperty (' . Perlito5::Javascript3::autoquote($arg -> {index_exp }, $level ) . ' )' ;
1849
+ return ' (' . $v -> emit_javascript3() . ' ).hderef().exists (' . Perlito5::Javascript3::autoquote($arg -> {index_exp }, $level ) . ' )' ;
1850
1850
}
1851
1851
if ($arg -> isa( ' Perlito5::AST::Call' )) {
1852
1852
if ( $arg -> method eq ' postcircumfix:<{ }>' ) {
1853
- return ' (' . $arg -> invocant-> emit_javascript3() . ' ).hderef().hasOwnProperty (' . Perlito5::Javascript3::autoquote($arg -> {arguments }, $level ) . ' )' ;
1853
+ return ' (' . $arg -> invocant-> emit_javascript3() . ' ).hderef().exists (' . Perlito5::Javascript3::autoquote($arg -> {arguments }, $level ) . ' )' ;
1854
1854
}
1855
1855
}
1856
1856
},
Original file line number Diff line number Diff line change @@ -465,6 +465,9 @@ function p5Hash(o) {
465
465
}
466
466
return out;
467
467
};
468
+ this.exists = function(i) {
469
+ return this._hash_.hasOwnProperty(i);
470
+ };
468
471
this.hset = function(i, v) {
469
472
if (this._hash_[i] instanceof p5Scalar) {
470
473
this._hash_[i].assign(v);
You can’t perform that action at this time.
0 commit comments