@@ -238,7 +238,7 @@ declare module 'assemblyscript/src/diagnosticMessages.generated' {
238238 Module_cannot_have_multiple_start_functions = 221 ,
239239 _0_must_be_a_value_between_1_and_2_inclusive = 222 ,
240240 _0_must_be_a_power_of_two = 223 ,
241- TODO_Cannot_inline_inferred_calls_and_specific_internals_yet = 224 ,
241+ Expression_is_unsafe = 224 ,
242242 Expression_is_never_null = 225 ,
243243 Unterminated_string_literal = 1002 ,
244244 Identifier_expected = 1003 ,
@@ -1369,12 +1369,14 @@ declare module 'assemblyscript/src/ast' {
13691369 }
13701370 /** Indicates the specific kind of a source. */
13711371 export enum SourceKind {
1372- /** Default source. Usually imported from an entry file. */
1373- DEFAULT = 0 ,
1374- /** Entry file. */
1375- ENTRY = 1 ,
1376- /** Library file. */
1377- LIBRARY = 2
1372+ /** User-provided file. */
1373+ USER = 0 ,
1374+ /** User-provided entry file. */
1375+ USER_ENTRY = 1 ,
1376+ /** Library-provided file. */
1377+ LIBRARY = 2 ,
1378+ /** Library-provided entry file. */
1379+ LIBRARY_ENTRY = 3
13781380 }
13791381 /** A top-level source node. */
13801382 export class Source extends Node {
@@ -1400,9 +1402,6 @@ declare module 'assemblyscript/src/ast' {
14001402 exportPaths : Set < string > | null ;
14011403 /** Constructs a new source node. */
14021404 constructor ( normalizedPath : string , text : string , kind : SourceKind ) ;
1403- /** Tests if this source is an entry file. */
1404- readonly isEntry : bool ;
1405- /** Tests if this source is a stdlib file. */
14061405 readonly isLibrary : bool ;
14071406 }
14081407 /** Base class of all declaration statements. */
@@ -3784,6 +3783,8 @@ declare module 'assemblyscript/src/compiler' {
37843783 globalAliases : Map < string , string > | null ;
37853784 /** Additional features to activate. */
37863785 features : Feature ;
3786+ /** If true, disallows unsafe features in user code. */
3787+ noUnsafe : bool ;
37873788 /** Hinted optimize level. Not applied by the compiler itself. */
37883789 optimizeLevelHint : i32 ;
37893790 /** Hinted shrink level. Not applied by the compiler itself. */
@@ -3996,6 +3997,8 @@ declare module 'assemblyscript/src/compiler' {
39963997 * specified signature.
39973998 */
39983999 checkCallSignature ( signature : Signature , numArguments : i32 , hasThis : bool , reportNode : Node ) : bool ;
4000+ /** Checks that an unsafe expression is allowed. */
4001+ private checkUnsafe ;
39994002 /** Compiles a direct call to a concrete function. */
40004003 compileCallDirect ( instance : Function , argumentExpressions : Expression [ ] , reportNode : Node , thisArg ?: ExpressionRef , constraints ?: Constraints ) : ExpressionRef ;
40014004 makeCallInline ( instance : Function , operands : ExpressionRef [ ] | null , thisArg ?: ExpressionRef , immediatelyDropped ?: bool ) : ExpressionRef ;
@@ -4788,6 +4791,8 @@ declare module 'assemblyscript/src/index' {
47884791 export function setGlobalAlias ( options : Options , alias : string , name : string ) : void ;
47894792 /** Sets the `explicitStart` option. */
47904793 export function setExplicitStart ( options : Options , explicitStart : bool ) : void ;
4794+ /** Sets the `noUnsafe` option. */
4795+ export function setNoUnsafe ( options : Options , noUnsafe : bool ) : void ;
47914796 /** Sign extension operations. */
47924797 export const FEATURE_SIGN_EXTENSION : Feature ;
47934798 /** Mutable global imports and exports. */
0 commit comments