Skip to content

Commit a73141f

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

File tree

10 files changed

+17
-13
lines changed

10 files changed

+17
-13
lines changed

Diff for: cli/asc.js

+1-1
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);

Diff for: tests/asconfig/entry-points/assembly/data.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export let forty_one = 41;

Diff for: tests/asconfig/entry-points/assembly/globalTwo.ts

+5
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);

Diff for: tests/asconfig/entry-points/assembly/globals.ts

+6-2
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());

Diff for: tests/asconfig/entry-points/assembly/index.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
2-
assert(answerToLife == 42);
1+
assert(answerToLife() == 42);

Diff for: tests/asconfig/entry-points/nested/assembly/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
assert(answerToLife == 42);
1+
assert(answerToLife() == 42);
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
assert(answerToLife == 42);
1+
assert(answerToLife() == 42);

Diff for: tests/asconfig/entry-points/node-resolution/node_modules/entry-points/asconfig.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

-3
This file was deleted.

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

-2
This file was deleted.

0 commit comments

Comments
 (0)