@@ -238,7 +238,7 @@ declare module 'assemblyscript/src/diagnosticMessages.generated' {
238
238
Module_cannot_have_multiple_start_functions = 221 ,
239
239
_0_must_be_a_value_between_1_and_2_inclusive = 222 ,
240
240
_0_must_be_a_power_of_two = 223 ,
241
- TODO_Cannot_inline_inferred_calls_and_specific_internals_yet = 224 ,
241
+ Expression_is_unsafe = 224 ,
242
242
Expression_is_never_null = 225 ,
243
243
Unterminated_string_literal = 1002 ,
244
244
Identifier_expected = 1003 ,
@@ -1369,12 +1369,14 @@ declare module 'assemblyscript/src/ast' {
1369
1369
}
1370
1370
/** Indicates the specific kind of a source. */
1371
1371
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
1378
1380
}
1379
1381
/** A top-level source node. */
1380
1382
export class Source extends Node {
@@ -1400,9 +1402,6 @@ declare module 'assemblyscript/src/ast' {
1400
1402
exportPaths : Set < string > | null ;
1401
1403
/** Constructs a new source node. */
1402
1404
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. */
1406
1405
readonly isLibrary : bool ;
1407
1406
}
1408
1407
/** Base class of all declaration statements. */
@@ -3784,6 +3783,8 @@ declare module 'assemblyscript/src/compiler' {
3784
3783
globalAliases : Map < string , string > | null ;
3785
3784
/** Additional features to activate. */
3786
3785
features : Feature ;
3786
+ /** If true, disallows unsafe features in user code. */
3787
+ noUnsafe : bool ;
3787
3788
/** Hinted optimize level. Not applied by the compiler itself. */
3788
3789
optimizeLevelHint : i32 ;
3789
3790
/** Hinted shrink level. Not applied by the compiler itself. */
@@ -3996,6 +3997,8 @@ declare module 'assemblyscript/src/compiler' {
3996
3997
* specified signature.
3997
3998
*/
3998
3999
checkCallSignature ( signature : Signature , numArguments : i32 , hasThis : bool , reportNode : Node ) : bool ;
4000
+ /** Checks that an unsafe expression is allowed. */
4001
+ private checkUnsafe ;
3999
4002
/** Compiles a direct call to a concrete function. */
4000
4003
compileCallDirect ( instance : Function , argumentExpressions : Expression [ ] , reportNode : Node , thisArg ?: ExpressionRef , constraints ?: Constraints ) : ExpressionRef ;
4001
4004
makeCallInline ( instance : Function , operands : ExpressionRef [ ] | null , thisArg ?: ExpressionRef , immediatelyDropped ?: bool ) : ExpressionRef ;
@@ -4788,6 +4791,8 @@ declare module 'assemblyscript/src/index' {
4788
4791
export function setGlobalAlias ( options : Options , alias : string , name : string ) : void ;
4789
4792
/** Sets the `explicitStart` option. */
4790
4793
export function setExplicitStart ( options : Options , explicitStart : bool ) : void ;
4794
+ /** Sets the `noUnsafe` option. */
4795
+ export function setNoUnsafe ( options : Options , noUnsafe : bool ) : void ;
4791
4796
/** Sign extension operations. */
4792
4797
export const FEATURE_SIGN_EXTENSION : Feature ;
4793
4798
/** Mutable global imports and exports. */
0 commit comments