Skip to content

Commit 00eaa35

Browse files
committed
[js] Make --libpath resolve relative path with the compile time cwd
1 parent 1a6d4e4 commit 00eaa35

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/HLL/Compiler.nqp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,8 @@ class HLL::Compiler does HLL::Backend::Default {
282282
my $split := nqp::split('|||', %adverbs<libpath>);
283283
$*LIBPATH := nqp::list_s();
284284
for $split -> $str {
285-
nqp::push_s($*LIBPATH, $str);
285+
my $absolute := nqp::getcomp('JavaScript').eval('return (function(path) {return require("path").resolve(process.cwd(), path)})')(~$str);
286+
nqp::push_s($*LIBPATH, $absolute);
286287
}
287288
nqp::getcomp('JavaScript').eval('return (function(paths) {nqp.libpath(paths)})')($*LIBPATH);
288289
}

0 commit comments

Comments
 (0)