Skip to content

Commit 114b6f9

Browse files
authored
fix: add default -O0 option (#7)
asc compiler will read `asconfig.json` in project folder by default. Add `-O0` option can force disable optimization since ut cannot be used under optimization build.
1 parent 8988b62 commit 114b6f9

File tree

4 files changed

+4
-2
lines changed

4 files changed

+4
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ module.exports = {
8484
include: ["source", "tests"],
8585
exclude: [],
8686

87-
/** optional: assemblyscript compile flag, default is --exportStart _start */
87+
/** optional: assemblyscript compile flag, default is --exportStart _start -O0 */
8888
flags: "",
8989

9090
/**

as-test.config.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module.exports = {
55
/** optional: file exclude */
66
exclude: [],
77

8-
/** optional: assemblyscript compile flag, default is --exportStart _start */
8+
/** optional: assemblyscript compile flag, default is --exportStart _start -O0 */
99
flags: "",
1010

1111
/**

src/core/compile.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export async function compile(testCodePaths: string[], outputFolder: string, com
2020
"_start",
2121
"--sourceMap",
2222
"--debug",
23+
"-O0",
2324
];
2425
if (compileFlags) {
2526
const argv = compileFlags.split(" ");

src/core/precompile.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ async function transform(sourceCodePath: string, transformFunction: string) {
6464
"--disableWarning",
6565
"--transform",
6666
transformFunction,
67+
"-O0",
6768
]);
6869
if (error) {
6970
// eslint-disable-next-line @typescript-eslint/no-base-to-string

0 commit comments

Comments
 (0)