@@ -272,7 +272,10 @@ exports.main = function main(argv, options, callback) {
272
272
const compilerOptions = assemblyscript . newOptions ( ) ;
273
273
assemblyscript . setTarget ( compilerOptions , 0 ) ;
274
274
assemblyscript . setNoAssert ( compilerOptions , args . noAssert ) ;
275
+ assemblyscript . setExportMemory ( compilerOptions , ! args . noExportMemory ) ;
275
276
assemblyscript . setImportMemory ( compilerOptions , args . importMemory ) ;
277
+ assemblyscript . setInitialMemory ( compilerOptions , args . initialMemory >>> 0 ) ;
278
+ assemblyscript . setMaximumMemory ( compilerOptions , args . maximumMemory >>> 0 ) ;
276
279
assemblyscript . setSharedMemory ( compilerOptions , args . sharedMemory ) ;
277
280
assemblyscript . setImportTable ( compilerOptions , args . importTable ) ;
278
281
assemblyscript . setExportTable ( compilerOptions , args . exportTable ) ;
@@ -711,8 +714,8 @@ exports.main = function main(argv, options, callback) {
711
714
if ( args . outFile != null ) {
712
715
if ( / \. w a s ? t $ / . test ( args . outFile ) && args . textFile == null ) {
713
716
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 ;
716
719
} else if ( args . binaryFile == null ) {
717
720
args . binaryFile = args . outFile ;
718
721
}
@@ -763,21 +766,21 @@ exports.main = function main(argv, options, callback) {
763
766
}
764
767
}
765
768
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 ) {
770
773
stats . emitCount ++ ;
771
774
stats . emitTime += measure ( ( ) => {
772
- asm = module . toAsmjs ( ) ;
775
+ js = module . toAsmjs ( ) ;
773
776
} ) ;
774
- writeFile ( args . asmjsFile , asm , baseDir ) ;
777
+ writeFile ( args . jsFile , js , baseDir ) ;
775
778
} else if ( ! hasStdout ) {
776
779
stats . emitCount ++ ;
777
780
stats . emitTime += measure ( ( ) => {
778
- asm = module . toAsmjs ( ) ;
781
+ js = module . toAsmjs ( ) ;
779
782
} ) ;
780
- writeStdout ( asm ) ;
783
+ writeStdout ( js ) ;
781
784
hasStdout = true ;
782
785
}
783
786
hasOutput = true ;
@@ -846,9 +849,7 @@ exports.main = function main(argv, options, callback) {
846
849
if ( args . measure ) {
847
850
printStats ( stats , stderr ) ;
848
851
}
849
- if ( args . printrtti ) {
850
- printRTTI ( program , stderr ) ;
851
- }
852
+
852
853
return callback ( null ) ;
853
854
854
855
function readFileNode ( filename , baseDir ) {
@@ -1001,15 +1002,6 @@ function printStats(stats, output) {
1001
1002
1002
1003
exports . printStats = printStats ;
1003
1004
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
-
1013
1005
var allocBuffer = typeof global !== "undefined" && global . Buffer
1014
1006
? global . Buffer . allocUnsafe || function ( len ) { return new global . Buffer ( len ) ; }
1015
1007
: function ( len ) { return new Uint8Array ( len ) } ;
0 commit comments