aboutsummaryrefslogtreecommitdiff
path: root/src/parser.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2020-06-04 00:30:44 +0100
committergingerBill <bill@gingerbill.org>2020-06-04 00:30:44 +0100
commit15c4077806d3d0c05973cfb653fce80c74a01d57 (patch)
treec8ebc4428c9037687007ebd1bcae3dadc9fe09ad /src/parser.cpp
parent37a3abdaaa0daa3fca0f8b649f67f069ca54443a (diff)
Fix WASM foreign import names
Diffstat (limited to 'src/parser.cpp')
-rw-r--r--src/parser.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/parser.cpp b/src/parser.cpp
index 143644f70..86900c133 100644
--- a/src/parser.cpp
+++ b/src/parser.cpp
@@ -4736,14 +4736,15 @@ void parse_setup_file_decls(Parser *p, AstFile *f, String base_dir, Array<Ast *>
for_array(fp_idx, fl->filepaths) {
String file_str = fl->filepaths[fp_idx].string;
String fullpath = file_str;
-
- String foreign_path = {};
- bool ok = determine_path_from_string(&p->file_decl_mutex, node, base_dir, file_str, &foreign_path);
- if (!ok) {
- decls[i] = ast_bad_decl(f, fl->filepaths[fp_idx], fl->filepaths[fl->filepaths.count-1]);
- goto end;
+ if (build_context.metrics.os != TargetOs_js) {
+ String foreign_path = {};
+ bool ok = determine_path_from_string(&p->file_decl_mutex, node, base_dir, file_str, &foreign_path);
+ if (!ok) {
+ decls[i] = ast_bad_decl(f, fl->filepaths[fp_idx], fl->filepaths[fl->filepaths.count-1]);
+ goto end;
+ }
+ fullpath = foreign_path;
}
- fullpath = foreign_path;
array_add(&fl->fullpaths, fullpath);
}
if (fl->fullpaths.count == 0) {