@@ -295,14 +295,20 @@ export async function main(argv, options) {
295295 }
296296
297297 // Set up options
298- let program , runtime ;
298+ let program , runtime , uncheckedBehavior ;
299299 const compilerOptions = assemblyscript . newOptions ( ) ;
300300 switch ( opts . runtime ) {
301301 case "stub" : runtime = 0 ; break ;
302302 case "minimal" : runtime = 1 ; break ;
303303 /* incremental */
304304 default : runtime = 2 ; break ;
305305 }
306+ switch ( opts . uncheckedBehavior ) {
307+ /* default */
308+ default : uncheckedBehavior = 0 ; break ;
309+ case "never" : uncheckedBehavior = 1 ; break ;
310+ case "always" : uncheckedBehavior = 2 ; break ;
311+ }
306312 assemblyscript . setTarget ( compilerOptions , 0 ) ;
307313 assemblyscript . setDebugInfo ( compilerOptions , ! ! opts . debug ) ;
308314 assemblyscript . setRuntime ( compilerOptions , runtime ) ;
@@ -320,6 +326,7 @@ export async function main(argv, options) {
320326 assemblyscript . setMemoryBase ( compilerOptions , opts . memoryBase >>> 0 ) ;
321327 assemblyscript . setTableBase ( compilerOptions , opts . tableBase >>> 0 ) ;
322328 assemblyscript . setSourceMap ( compilerOptions , opts . sourceMap != null ) ;
329+ assemblyscript . setUncheckedBehavior ( compilerOptions , uncheckedBehavior ) ;
323330 assemblyscript . setNoUnsafe ( compilerOptions , opts . noUnsafe ) ;
324331 assemblyscript . setPedantic ( compilerOptions , opts . pedantic ) ;
325332 assemblyscript . setLowMemoryLimit ( compilerOptions , opts . lowMemoryLimit >>> 0 ) ;
0 commit comments