Skip to content

Commit

Permalink
Perlito5 - js - add an error message in scalar dereference
Browse files Browse the repository at this point in the history
  • Loading branch information
fglock committed May 24, 2018
1 parent 00903f2 commit 514b3bb
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src5/lib/Perlito5/JavaScript2/Runtime.pm
Original file line number Diff line number Diff line change
Expand Up @@ -408,15 +408,16 @@ function p5scalar_deref(v, current_pkg_name, autoviv_type) {
return p5pkg[pkg_name][name];
}
if (!v._scalar_) {
if (autoviv_type == 'array') {
v._scalar_ = new p5ArrayRef([]);
}
else if (autoviv_type == 'hash') {
v._scalar_ = new p5HashRef([]);
}
else if (autoviv_type == 'scalar') {
v._scalar_ = new p5ScalarRef([]);
}
CORE.die(["not a SCALAR reference"]);
// if (autoviv_type == 'array') {
// v._scalar_ = new p5ArrayRef([]);
// }
// else if (autoviv_type == 'hash') {
// v._scalar_ = new p5HashRef([]);
// }
// else if (autoviv_type == 'scalar') {
// v._scalar_ = new p5ScalarRef([]);
// }
}
return v._scalar_;
}
Expand Down

0 comments on commit 514b3bb

Please sign in to comment.