@@ -272,7 +272,10 @@ exports.main = function main(argv, options, callback) {
272272 const compilerOptions = assemblyscript . newOptions ( ) ;
273273 assemblyscript . setTarget ( compilerOptions , 0 ) ;
274274 assemblyscript . setNoAssert ( compilerOptions , args . noAssert ) ;
275+ assemblyscript . setExportMemory ( compilerOptions , ! args . noExportMemory ) ;
275276 assemblyscript . setImportMemory ( compilerOptions , args . importMemory ) ;
277+ assemblyscript . setInitialMemory ( compilerOptions , args . initialMemory >>> 0 ) ;
278+ assemblyscript . setMaximumMemory ( compilerOptions , args . maximumMemory >>> 0 ) ;
276279 assemblyscript . setSharedMemory ( compilerOptions , args . sharedMemory ) ;
277280 assemblyscript . setImportTable ( compilerOptions , args . importTable ) ;
278281 assemblyscript . setExportTable ( compilerOptions , args . exportTable ) ;
@@ -711,8 +714,8 @@ exports.main = function main(argv, options, callback) {
711714 if ( args . outFile != null ) {
712715 if ( / \. w a s ? t $ / . test ( args . outFile ) && args . textFile == null ) {
713716 args . textFile = args . outFile ;
714- } else if ( / \. j s $ / . test ( args . outFile ) && args . asmjsFile == null ) {
715- args . asmjsFile = args . outFile ;
717+ } else if ( / \. j s $ / . test ( args . outFile ) && args . jsFile == null ) {
718+ args . jsFile = args . outFile ;
716719 } else if ( args . binaryFile == null ) {
717720 args . binaryFile = args . outFile ;
718721 }
@@ -763,21 +766,21 @@ exports.main = function main(argv, options, callback) {
763766 }
764767 }
765768
766- // Write asm.js
767- if ( args . asmjsFile != null ) {
768- let asm ;
769- if ( args . asmjsFile . length ) {
769+ // Write JS
770+ if ( args . jsFile != null ) {
771+ let js ;
772+ if ( args . jsFile . length ) {
770773 stats . emitCount ++ ;
771774 stats . emitTime += measure ( ( ) => {
772- asm = module . toAsmjs ( ) ;
775+ js = module . toAsmjs ( ) ;
773776 } ) ;
774- writeFile ( args . asmjsFile , asm , baseDir ) ;
777+ writeFile ( args . jsFile , js , baseDir ) ;
775778 } else if ( ! hasStdout ) {
776779 stats . emitCount ++ ;
777780 stats . emitTime += measure ( ( ) => {
778- asm = module . toAsmjs ( ) ;
781+ js = module . toAsmjs ( ) ;
779782 } ) ;
780- writeStdout ( asm ) ;
783+ writeStdout ( js ) ;
781784 hasStdout = true ;
782785 }
783786 hasOutput = true ;
@@ -846,9 +849,7 @@ exports.main = function main(argv, options, callback) {
846849 if ( args . measure ) {
847850 printStats ( stats , stderr ) ;
848851 }
849- if ( args . printrtti ) {
850- printRTTI ( program , stderr ) ;
851- }
852+
852853 return callback ( null ) ;
853854
854855 function readFileNode ( filename , baseDir ) {
@@ -1001,15 +1002,6 @@ function printStats(stats, output) {
10011002
10021003exports . printStats = printStats ;
10031004
1004- /** Prints runtime type information. */
1005- function printRTTI ( program , output ) {
1006- if ( ! output ) output = process . stderr ;
1007- output . write ( "# Runtime type information (RTTI)\n" ) ;
1008- output . write ( assemblyscript . buildRTTI ( program ) ) ;
1009- }
1010-
1011- exports . printRTTI = printRTTI ;
1012-
10131005var allocBuffer = typeof global !== "undefined" && global . Buffer
10141006 ? global . Buffer . allocUnsafe || function ( len ) { return new global . Buffer ( len ) ; }
10151007 : function ( len ) { return new Uint8Array ( len ) } ;
0 commit comments