Skip to content

Commit 114fd03

Browse files
authored
Add debugInfo for compiler's Options (#2450)
1 parent 0e10552 commit 114fd03

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

cli/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,7 @@ export async function main(argv, options) {
304304
default: runtime = 2; break;
305305
}
306306
assemblyscript.setTarget(compilerOptions, 0);
307+
assemblyscript.setDebugInfo(compilerOptions, !!opts.debug);
307308
assemblyscript.setRuntime(compilerOptions, runtime);
308309
assemblyscript.setNoAssert(compilerOptions, opts.noAssert);
309310
assemblyscript.setExportMemory(compilerOptions, !opts.noExportMemory);

src/compiler.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,8 @@ export class Options {
225225
target: Target = Target.WASM32;
226226
/** Runtime type. Defaults to Incremental GC. */
227227
runtime: Runtime = Runtime.Incremental;
228+
/** If true, indicates that debug information will be emitted by Binaryen. */
229+
debugInfo: bool = false;
228230
/** If true, replaces assertions with nops. */
229231
noAssert: bool = false;
230232
/** It true, exports the memory to the embedder. */

src/index-wasm.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,10 @@ export function setPedantic(options: Options, pedantic: bool): void {
227227
options.pedantic = pedantic;
228228
}
229229

230+
export function setDebugInfo(options: Options, debug: bool): void {
231+
options.debugInfo = debug;
232+
}
233+
230234
// Program
231235

232236
/** Creates a new Program. */

0 commit comments

Comments
 (0)