Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Perlito5 - js3 - "use", eval-string work
  • Loading branch information
fglock committed Sep 29, 2012
1 parent 2144d48 commit c0ab727
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions perlito5.pl

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src5/lib/Perlito5/Javascript3/Emitter.pm
Expand Up @@ -1349,7 +1349,7 @@ package Perlito5::AST::Apply;
# "use 5.006" -- XXX this should be tested at parse time instead
return '1';
}
'p5pkg["Perlito5::Grammar::Use"]["require"](['
'p5pkg["Perlito5::Grammar::Use"].require(['
. Perlito5::Javascript3::to_str( $self->{arguments}[0] ) . ', '
. ($self->{arguments}[0]{bareword} ? 1 : 0)
. '])';
Expand Down
5 changes: 3 additions & 2 deletions src5/lib/Perlito5/Javascript3/Runtime.pm
Expand Up @@ -737,11 +737,12 @@ p5a_to_h = function(a) {
if (isNode) {
var fs = require("fs");
p5make_sub("Perlito5::IO", "slurp", function(List__) {
return fs.readFileSync(List__[0],"utf8");
var filename = p5str(List__[0]);
return fs.readFileSync(filename, "utf8");
});
} else {
p5make_sub("Perlito5::IO", "slurp", function(List__) {
var filename = List__[0];
var filename = p5str(List__[0]);
if (typeof readFile == "function") {
return readFile(filename);
}
Expand Down

0 comments on commit c0ab727

Please sign in to comment.