@@ -62,6 +62,10 @@ function toUpperSnakeCase(str) {
6262 return str . replace ( / - / g, "_" ) . toUpperCase ( ) ;
6363}
6464
65+ function isNonEmptyString ( value ) {
66+ return typeof value === "string" && value !== "" ;
67+ }
68+
6569/** Ensures that an object is a wrapper class instead of just a pointer. */
6670// function __wrap(ptrOrObj, wrapperClass) {
6771// if (typeof ptrOrObj === "number") {
@@ -309,7 +313,9 @@ export async function main(argv, options) {
309313 assemblyscript . setSharedMemory ( compilerOptions , opts . sharedMemory ) ;
310314 assemblyscript . setImportTable ( compilerOptions , opts . importTable ) ;
311315 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+ }
313319 assemblyscript . setMemoryBase ( compilerOptions , opts . memoryBase >>> 0 ) ;
314320 assemblyscript . setTableBase ( compilerOptions , opts . tableBase >>> 0 ) ;
315321 assemblyscript . setSourceMap ( compilerOptions , opts . sourceMap != null ) ;
@@ -318,7 +324,7 @@ export async function main(argv, options) {
318324 assemblyscript . setLowMemoryLimit ( compilerOptions , opts . lowMemoryLimit >>> 0 ) ;
319325 assemblyscript . setExportRuntime ( compilerOptions , opts . exportRuntime ) ;
320326 assemblyscript . setBundleVersion ( compilerOptions , bundleMajorVersion , bundleMinorVersion , bundlePatchVersion ) ;
321- if ( ! opts . stackSize && opts . runtime == " incremental" ) {
327+ if ( ! opts . stackSize && runtime === 2 /* incremental */ ) {
322328 opts . stackSize = assemblyscript . DEFAULT_STACK_SIZE ;
323329 }
324330 assemblyscript . setStackSize ( compilerOptions , opts . stackSize ) ;
0 commit comments