@@ -295,14 +295,20 @@ export async function main(argv, options) {
295
295
}
296
296
297
297
// Set up options
298
- let program , runtime ;
298
+ let program , runtime , uncheckedBehavior ;
299
299
const compilerOptions = assemblyscript . newOptions ( ) ;
300
300
switch ( opts . runtime ) {
301
301
case "stub" : runtime = 0 ; break ;
302
302
case "minimal" : runtime = 1 ; break ;
303
303
/* incremental */
304
304
default : runtime = 2 ; break ;
305
305
}
306
+ switch ( opts . uncheckedBehavior ) {
307
+ /* default */
308
+ default : uncheckedBehavior = 0 ; break ;
309
+ case "never" : uncheckedBehavior = 1 ; break ;
310
+ case "always" : uncheckedBehavior = 2 ; break ;
311
+ }
306
312
assemblyscript . setTarget ( compilerOptions , 0 ) ;
307
313
assemblyscript . setDebugInfo ( compilerOptions , ! ! opts . debug ) ;
308
314
assemblyscript . setRuntime ( compilerOptions , runtime ) ;
@@ -320,6 +326,7 @@ export async function main(argv, options) {
320
326
assemblyscript . setMemoryBase ( compilerOptions , opts . memoryBase >>> 0 ) ;
321
327
assemblyscript . setTableBase ( compilerOptions , opts . tableBase >>> 0 ) ;
322
328
assemblyscript . setSourceMap ( compilerOptions , opts . sourceMap != null ) ;
329
+ assemblyscript . setUncheckedBehavior ( compilerOptions , uncheckedBehavior ) ;
323
330
assemblyscript . setNoUnsafe ( compilerOptions , opts . noUnsafe ) ;
324
331
assemblyscript . setPedantic ( compilerOptions , opts . pedantic ) ;
325
332
assemblyscript . setLowMemoryLimit ( compilerOptions , opts . lowMemoryLimit >>> 0 ) ;
0 commit comments