@@ -62,6 +62,10 @@ function toUpperSnakeCase(str) {
62
62
return str . replace ( / - / g, "_" ) . toUpperCase ( ) ;
63
63
}
64
64
65
+ function isNonEmptyString ( value ) {
66
+ return typeof value === "string" && value !== "" ;
67
+ }
68
+
65
69
/** Ensures that an object is a wrapper class instead of just a pointer. */
66
70
// function __wrap(ptrOrObj, wrapperClass) {
67
71
// if (typeof ptrOrObj === "number") {
@@ -309,7 +313,9 @@ export async function main(argv, options) {
309
313
assemblyscript . setSharedMemory ( compilerOptions , opts . sharedMemory ) ;
310
314
assemblyscript . setImportTable ( compilerOptions , opts . importTable ) ;
311
315
assemblyscript . setExportTable ( compilerOptions , opts . exportTable ) ;
312
- assemblyscript . setExportStart ( compilerOptions , typeof opts . exportStart === "string" ? opts . exportStart : null ) ;
316
+ if ( opts . exportStart ) {
317
+ assemblyscript . setExportStart ( compilerOptions , isNonEmptyString ( opts . exportStart ) ? opts . exportStart : "_start" ) ;
318
+ }
313
319
assemblyscript . setMemoryBase ( compilerOptions , opts . memoryBase >>> 0 ) ;
314
320
assemblyscript . setTableBase ( compilerOptions , opts . tableBase >>> 0 ) ;
315
321
assemblyscript . setSourceMap ( compilerOptions , opts . sourceMap != null ) ;
@@ -318,7 +324,7 @@ export async function main(argv, options) {
318
324
assemblyscript . setLowMemoryLimit ( compilerOptions , opts . lowMemoryLimit >>> 0 ) ;
319
325
assemblyscript . setExportRuntime ( compilerOptions , opts . exportRuntime ) ;
320
326
assemblyscript . setBundleVersion ( compilerOptions , bundleMajorVersion , bundleMinorVersion , bundlePatchVersion ) ;
321
- if ( ! opts . stackSize && opts . runtime == " incremental" ) {
327
+ if ( ! opts . stackSize && runtime === 2 /* incremental */ ) {
322
328
opts . stackSize = assemblyscript . DEFAULT_STACK_SIZE ;
323
329
}
324
330
assemblyscript . setStackSize ( compilerOptions , opts . stackSize ) ;
0 commit comments