Skip to content

Commit

Permalink
fix: Fix asc entry path issue on Windows incl. test (#1419)
Browse files Browse the repository at this point in the history
  • Loading branch information
Willem Wyndham authored Jul 30, 2020
1 parent c286e06 commit a73141f
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion cli/asc.js
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ exports.main = function main(argv, options, callback) {
let sourcePath = String(filename).replace(/\\/g, "/").replace(extension.re, "").replace(/[\\/]$/, "");

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

// Try entryPath.ext, then entryPath/index.ext
let sourceText = readFile(sourcePath + extension.ext, baseDir);
Expand Down
1 change: 1 addition & 0 deletions tests/asconfig/entry-points/assembly/data.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export let forty_one = 41;
5 changes: 5 additions & 0 deletions tests/asconfig/entry-points/assembly/globalTwo.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// @ts-ignore
@global
const ONE = 1;

assert(ONE);
8 changes: 6 additions & 2 deletions tests/asconfig/entry-points/assembly/globals.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import { forty_one } from "./data";
import "./globalTwo";

// @ts-ignore: decorator
@global const answerToLife = 42;
assert(answerToLife);
@global function answerToLife(): i32 { return forty_one + ONE; }

assert(answerToLife());
3 changes: 1 addition & 2 deletions tests/asconfig/entry-points/assembly/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@

assert(answerToLife == 42);
assert(answerToLife() == 42);
2 changes: 1 addition & 1 deletion tests/asconfig/entry-points/nested/assembly/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
assert(answerToLife == 42);
assert(answerToLife() == 42);
Original file line number Diff line number Diff line change
@@ -1 +1 @@
assert(answerToLife == 42);
assert(answerToLife() == 42);

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

This file was deleted.

0 comments on commit a73141f

Please sign in to comment.