Skip to content

Commit a73141f

Browse files
author
Willem Wyndham
authored
fix: Fix asc entry path issue on Windows incl. test (AssemblyScript#1419)
1 parent c286e06 commit a73141f

File tree

10 files changed

+17
-13
lines changed

10 files changed

+17
-13
lines changed

cli/asc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ exports.main = function main(argv, options, callback) {
644644
let sourcePath = String(filename).replace(/\\/g, "/").replace(extension.re, "").replace(/[\\/]$/, "");
645645

646646
// Setting the path to relative path
647-
sourcePath = path.isAbsolute(sourcePath) ? path.relative(baseDir, sourcePath) : sourcePath;
647+
sourcePath = path.isAbsolute(sourcePath) ? path.relative(baseDir, sourcePath).replace(/\\/g, "/") : sourcePath;
648648

649649
// Try entryPath.ext, then entryPath/index.ext
650650
let sourceText = readFile(sourcePath + extension.ext, baseDir);
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export let forty_one = 41;
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// @ts-ignore
2+
@global
3+
const ONE = 1;
4+
5+
assert(ONE);
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
import { forty_one } from "./data";
2+
import "./globalTwo";
3+
14
// @ts-ignore: decorator
2-
@global const answerToLife = 42;
3-
assert(answerToLife);
5+
@global function answerToLife(): i32 { return forty_one + ONE; }
6+
7+
assert(answerToLife());
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
2-
assert(answerToLife == 42);
1+
assert(answerToLife() == 42);
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
assert(answerToLife == 42);
1+
assert(answerToLife() == 42);
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
assert(answerToLife == 42);
1+
assert(answerToLife() == 42);

tests/asconfig/entry-points/node-resolution/node_modules/entry-points/asconfig.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/asconfig/entry-points/node-resolution/node_modules/entry-points/assembly/globals.ts

Lines changed: 0 additions & 3 deletions
This file was deleted.

tests/asconfig/entry-points/node-resolution/node_modules/entry-points/assembly/index.ts

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)