Skip to content

Commit 48e96cb

Browse files
committed
Add initial map implementation to tests, see #17
1 parent e8c8b20 commit 48e96cb

File tree

8 files changed

+3497
-5
lines changed

8 files changed

+3497
-5
lines changed

dist/assemblyscript.js

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

dist/assemblyscript.js.map

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

src/ast.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1434,6 +1434,8 @@ export class Source extends Node {
14341434
tokenizer: Tokenizer | null = null;
14351435
/** Source map index. */
14361436
debugInfoIndex: i32 = -1;
1437+
/** Re-exported sources. */
1438+
exportPaths: Set<string> | null = null;
14371439

14381440
/** Constructs a new source node. */
14391441
constructor(normalizedPath: string, text: string, kind: SourceKind) {

src/parser.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1958,8 +1958,11 @@ export class Parser extends DiagnosticEmitter {
19581958
if (tn.skip(Token.STRINGLITERAL)) {
19591959
path = Node.createStringLiteralExpression(tn.readString(), tn.range());
19601960
let ret = Node.createExportStatement(null, path, flags, tn.range(startPos, tn.pos));
1961-
let internalPath = ret.internalPath;
1962-
if (internalPath !== null && !this.seenlog.has(internalPath)) {
1961+
let internalPath = assert(ret.internalPath);
1962+
let source = tn.source;
1963+
if (!source.exportPaths) source.exportPaths = new Set();
1964+
source.exportPaths.add(internalPath);
1965+
if (!this.seenlog.has(internalPath)) {
19631966
this.backlog.push(internalPath);
19641967
this.seenlog.add(internalPath);
19651968
}

tests/compiler.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ tests.forEach(filename => {
163163
});
164164
console.log("- " + colors.green("instantiate OK") + " (" + asc.formatTime(runTime) + ")");
165165
} catch (e) {
166-
console.log("- " + colors.red("instantiate ERROR: ") + e);
166+
console.log("- " + colors.red("instantiate ERROR: ") + e.stack);
167167
failed = true;
168168
}
169169

0 commit comments

Comments
 (0)