Skip to content

Commit 9cc5608

Browse files
committed
Update dependencies and dist files
1 parent 3af2603 commit 9cc5608

7 files changed

+316
-369
lines changed

dist/asc.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/asc.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/assemblyscript.d.ts

+67-65
Original file line numberDiff line numberDiff line change
@@ -2323,6 +2323,8 @@ declare module 'assemblyscript/src/types' {
23232323
constructor(kind: TypeKind, flags: TypeFlags, size: u32);
23242324
/** Returns the closest int type representing this type. */
23252325
readonly intType: Type;
2326+
/** Substitutes this type with the auto type if this type is void. */
2327+
readonly exceptVoid: Type;
23262328
/** Gets this type's logarithmic alignment in memory. */
23272329
readonly alignLog2: i32;
23282330
/** Tests if this is a managed type that needs GC hooks. */
@@ -2395,6 +2397,8 @@ declare module 'assemblyscript/src/types' {
23952397
static readonly v128: Type;
23962398
/** No return type. */
23972399
static readonly void: Type;
2400+
/** Alias of i32 indicating type inference of locals and globals with just an initializer. */
2401+
static readonly auto: Type;
23982402
}
23992403
/** Converts an array of types to an array of native types. */
24002404
export function typesToNativeTypes(types: Type[]): NativeType[];
@@ -2465,26 +2469,28 @@ declare module 'assemblyscript/src/flow' {
24652469
ALLOCATES = 64,
24662470
/** This flow calls super. Constructors only. */
24672471
CALLS_SUPER = 128,
2472+
/** This flow terminates (returns, throws or continues). */
2473+
TERMINATES = 256,
24682474
/** This flow conditionally returns in a child flow. */
2469-
CONDITIONALLY_RETURNS = 256,
2475+
CONDITIONALLY_RETURNS = 512,
24702476
/** This flow conditionally throws in a child flow. */
2471-
CONDITIONALLY_THROWS = 512,
2477+
CONDITIONALLY_THROWS = 1024,
2478+
/** This flow conditionally terminates in a child flow. */
2479+
CONDITIONALLY_TERMINATES = 2048,
24722480
/** This flow conditionally breaks in a child flow. */
2473-
CONDITIONALLY_BREAKS = 1024,
2481+
CONDITIONALLY_BREAKS = 4096,
24742482
/** This flow conditionally continues in a child flow. */
2475-
CONDITIONALLY_CONTINUES = 2048,
2483+
CONDITIONALLY_CONTINUES = 8192,
24762484
/** This flow conditionally allocates in a child flow. Constructors only. */
2477-
CONDITIONALLY_ALLOCATES = 4096,
2485+
CONDITIONALLY_ALLOCATES = 16384,
24782486
/** This is an inlining flow. */
2479-
INLINE_CONTEXT = 8192,
2487+
INLINE_CONTEXT = 32768,
24802488
/** This is a flow with explicitly disabled bounds checking. */
2481-
UNCHECKED_CONTEXT = 16384,
2482-
/** Any terminating flag. */
2483-
ANY_TERMINATING = 57,
2489+
UNCHECKED_CONTEXT = 65536,
24842490
/** Any categorical flag. */
2485-
ANY_CATEGORICAL = 255,
2491+
ANY_CATEGORICAL = 511,
24862492
/** Any conditional flag. */
2487-
ANY_CONDITIONAL = 7936
2493+
ANY_CONDITIONAL = 30208
24882494
}
24892495
/** Flags indicating the current state of a local. */
24902496
export enum LocalFlags {
@@ -3781,23 +3787,21 @@ declare module 'assemblyscript/src/compiler' {
37813787
/** Tests if a specific feature is activated. */
37823788
hasFeature(feature: Feature): bool;
37833789
}
3784-
/** Requests or indicates compilation conditions of statements and expressions. */
3785-
export const enum ContextualFlags {
3790+
/** Various constraints in expression compilation. */
3791+
export const enum Constraints {
37863792
NONE = 0,
3787-
/** Implicit conversion required. */
3788-
IMPLICIT = 1,
3789-
/** Explicit conversion required. */
3790-
EXPLICIT = 2,
3791-
/** Small integer wrap required. */
3792-
WRAP = 4,
3793-
/** Value is known to be immediately dropped. */
3793+
/** Must implicitly convert to the target type. */
3794+
CONV_IMPLICIT = 1,
3795+
/** Must explicitly convert to the target type. */
3796+
CONV_EXPLICIT = 2,
3797+
/** Must wrap small integer values to match the target type. */
3798+
MUST_WRAP = 4,
3799+
/** Indicates that the value will be dropped immediately. */
37943800
WILL_DROP = 8,
3795-
/** Value is known to be immediately assigned to a retaining target. */
3796-
SKIP_AUTORELEASE = 16,
3797-
/** Is the last statement in a function body. */
3798-
LAST_IN_BODY = 32,
3799-
/** Data can be compiled statically. */
3800-
STATIC_CAPABLE = 64
3801+
/** Indicates that the value will be retained immediately. */
3802+
WILL_RETAIN = 16,
3803+
/** Indicates that static data is preferred. */
3804+
PREFER_STATIC = 32
38013805
}
38023806
/** Runtime features to be activated by the compiler. */
38033807
export const enum RuntimeFeatures {
@@ -3897,31 +3901,29 @@ declare module 'assemblyscript/src/compiler' {
38973901
/** Ensures that a table entry exists for the specified function and returns its index. */
38983902
ensureFunctionTableEntry(func: Function): i32;
38993903
compileTopLevelStatement(statement: Statement, body: ExpressionRef[]): void;
3900-
compileStatement(statement: Statement, contextualFlags?: ContextualFlags): ExpressionRef;
3904+
compileStatement(statement: Statement, isLastInBody?: bool): ExpressionRef;
39013905
compileStatements(statements: Statement[], isBody?: bool, stmts?: ExpressionRef[] | null): ExpressionRef[];
3902-
compileBlockStatement(statement: BlockStatement, contextualFlags: ContextualFlags): ExpressionRef;
3903-
compileBreakStatement(statement: BreakStatement, contextualFlags: ContextualFlags): ExpressionRef;
3904-
compileContinueStatement(statement: ContinueStatement, contextualFlags: ContextualFlags): ExpressionRef;
3905-
compileDoStatement(statement: DoStatement, contextualFlags: ContextualFlags): ExpressionRef;
3906-
compileEmptyStatement(statement: EmptyStatement, contextualFlags: ContextualFlags): ExpressionRef;
3907-
compileExpressionStatement(statement: ExpressionStatement, contextualFlags: ContextualFlags): ExpressionRef;
3908-
compileForStatement(statement: ForStatement, contextualFlags: ContextualFlags): ExpressionRef;
3909-
compileIfStatement(statement: IfStatement, contextualFlags: ContextualFlags): ExpressionRef;
3910-
compileReturnStatement(statement: ReturnStatement, contextualFlags: ContextualFlags): ExpressionRef;
3911-
compileSwitchStatement(statement: SwitchStatement, contextualFlags: ContextualFlags): ExpressionRef;
3912-
compileThrowStatement(statement: ThrowStatement, contextualFlags: ContextualFlags): ExpressionRef;
3913-
compileTryStatement(statement: TryStatement, contextualFlags: ContextualFlags): ExpressionRef;
3906+
compileBlockStatement(statement: BlockStatement): ExpressionRef;
3907+
compileBreakStatement(statement: BreakStatement): ExpressionRef;
3908+
compileContinueStatement(statement: ContinueStatement): ExpressionRef;
3909+
compileDoStatement(statement: DoStatement): ExpressionRef;
3910+
compileEmptyStatement(statement: EmptyStatement): ExpressionRef;
3911+
compileExpressionStatement(statement: ExpressionStatement): ExpressionRef;
3912+
compileForStatement(statement: ForStatement): ExpressionRef;
3913+
compileIfStatement(statement: IfStatement): ExpressionRef;
3914+
compileReturnStatement(statement: ReturnStatement, isLastInBody: bool): ExpressionRef;
3915+
compileSwitchStatement(statement: SwitchStatement): ExpressionRef;
3916+
compileThrowStatement(statement: ThrowStatement): ExpressionRef;
3917+
compileTryStatement(statement: TryStatement): ExpressionRef;
39143918
/** Compiles a variable statement. Returns `0` if an initializer is not necessary. */
3915-
compileVariableStatement(statement: VariableStatement, contextualFlags: ContextualFlags): ExpressionRef;
3916-
compileVoidStatement(statement: VoidStatement, contextualFlags: ContextualFlags): ExpressionRef;
3917-
compileWhileStatement(statement: WhileStatement, contextualFlags: ContextualFlags): ExpressionRef;
3919+
compileVariableStatement(statement: VariableStatement): ExpressionRef;
3920+
compileVoidStatement(statement: VoidStatement): ExpressionRef;
3921+
compileWhileStatement(statement: WhileStatement): ExpressionRef;
39183922
/** Compiles the value of an inlined constant element. */
3919-
compileInlineConstant(element: VariableLikeElement, contextualType: Type, contextualFlags: ContextualFlags): ExpressionRef;
3920-
compileExpression(expression: Expression, contextualType: Type, contextualFlags?: ContextualFlags): ExpressionRef;
3921-
/** Compiles an expression while retaining the type, that is not void, it ultimately compiles to. */
3922-
compileExpressionRetainType(expression: Expression, contextualType: Type, contextualFlags?: ContextualFlags): ExpressionRef;
3923+
compileInlineConstant(element: VariableLikeElement, contextualType: Type, constraints: Constraints): ExpressionRef;
3924+
compileExpression(expression: Expression, contextualType: Type, constraints?: Constraints): ExpressionRef;
39233925
/** Compiles and precomputes an expression, possibly yielding a costant value. */
3924-
precomputeExpression(expression: Expression, contextualType: Type, contextualFlags?: ContextualFlags): ExpressionRef;
3926+
precomputeExpression(expression: Expression, contextualType: Type, constraints?: Constraints): ExpressionRef;
39253927
convertExpression(expr: ExpressionRef,
39263928
/** Original type. */
39273929
fromType: Type,
@@ -3931,12 +3933,12 @@ declare module 'assemblyscript/src/compiler' {
39313933
explicit: bool,
39323934
/** Whether the result should be wrapped, if a small integer. */
39333935
wrap: bool, reportNode: Node): ExpressionRef;
3934-
compileAssertionExpression(expression: AssertionExpression, contextualType: Type, contextualFlags: ContextualFlags): ExpressionRef;
3936+
compileAssertionExpression(expression: AssertionExpression, contextualType: Type, constraints: Constraints): ExpressionRef;
39353937
private f32ModInstance;
39363938
private f64ModInstance;
39373939
private f32PowInstance;
39383940
private f64PowInstance;
3939-
compileBinaryExpression(expression: BinaryExpression, contextualType: Type, contextualFlags: ContextualFlags): ExpressionRef;
3941+
compileBinaryExpression(expression: BinaryExpression, contextualType: Type, constraints: Constraints): ExpressionRef;
39403942
compileUnaryOverload(operatorInstance: Function, value: Expression, valueExpr: ExpressionRef, reportNode: Node): ExpressionRef;
39413943
compileBinaryOverload(operatorInstance: Function, left: Expression, leftExpr: ExpressionRef, right: Expression, reportNode: Node): ExpressionRef;
39423944
compileAssignment(expression: Expression, valueExpression: Expression, contextualType: Type): ExpressionRef;
@@ -3974,16 +3976,16 @@ declare module 'assemblyscript/src/compiler' {
39743976
expression: CallExpression,
39753977
/** Contextual type indicating the return type the caller expects, if any. */
39763978
contextualType: Type,
3977-
/** Contextual flags indicating contextual conditions. */
3978-
contextualFlags: ContextualFlags): ExpressionRef;
3979+
/** Constraints indicating contextual conditions. */
3980+
constraints: Constraints): ExpressionRef;
39793981
private compileCallExpressionBuiltin;
39803982
/**
39813983
* Checks that a call with the given number as arguments can be performed according to the
39823984
* specified signature.
39833985
*/
39843986
checkCallSignature(signature: Signature, numArguments: i32, hasThis: bool, reportNode: Node): bool;
39853987
/** Compiles a direct call to a concrete function. */
3986-
compileCallDirect(instance: Function, argumentExpressions: Expression[], reportNode: Node, thisArg?: ExpressionRef, contextualFlags?: ContextualFlags): ExpressionRef;
3988+
compileCallDirect(instance: Function, argumentExpressions: Expression[], reportNode: Node, thisArg?: ExpressionRef, constraints?: Constraints): ExpressionRef;
39873989
makeCallInline(instance: Function, operands: ExpressionRef[] | null, thisArg?: ExpressionRef, immediatelyDropped?: bool): ExpressionRef;
39883990
/** Gets the trampoline for the specified function. */
39893991
ensureTrampoline(original: Function): Function;
@@ -4023,23 +4025,23 @@ declare module 'assemblyscript/src/compiler' {
40234025
compileCallIndirect(signature: Signature, indexArg: ExpressionRef, argumentExpressions: Expression[], reportNode: Node, thisArg?: ExpressionRef, immediatelyDropped?: bool): ExpressionRef;
40244026
/** Creates an indirect call to the function at `indexArg` in the function table. */
40254027
makeCallIndirect(signature: Signature, indexArg: ExpressionRef, operands?: ExpressionRef[] | null, immediatelyDropped?: bool): ExpressionRef;
4026-
compileCommaExpression(expression: CommaExpression, contextualType: Type, contextualFlags: ContextualFlags): ExpressionRef;
4027-
compileElementAccessExpression(expression: ElementAccessExpression, contextualType: Type, contextualFlags: ContextualFlags): ExpressionRef;
4028-
compileFunctionExpression(expression: FunctionExpression, contextualSignature: Signature | null, contextualFlags: ContextualFlags): ExpressionRef;
4028+
compileCommaExpression(expression: CommaExpression, contextualType: Type, constraints: Constraints): ExpressionRef;
4029+
compileElementAccessExpression(expression: ElementAccessExpression, contextualType: Type, constraints: Constraints): ExpressionRef;
4030+
compileFunctionExpression(expression: FunctionExpression, contextualSignature: Signature | null, constraints: Constraints): ExpressionRef;
40294031
/** Makes sure the enclosing source file of the specified expression has been compiled. */
40304032
private maybeCompileEnclosingSource;
40314033
/**
40324034
* Compiles an identifier in the specified context.
40334035
* @param retainConstantType Retains the type of inlined constants if `true`, otherwise
40344036
* precomputes them according to context.
40354037
*/
4036-
compileIdentifierExpression(expression: IdentifierExpression, contextualType: Type, contextualFlags: ContextualFlags): ExpressionRef;
4037-
compileInstanceOfExpression(expression: InstanceOfExpression, contextualType: Type, contextualFlags: ContextualFlags): ExpressionRef;
4038-
compileLiteralExpression(expression: LiteralExpression, contextualType: Type, contextualFlags: ContextualFlags, implicitlyNegate?: bool): ExpressionRef;
4038+
compileIdentifierExpression(expression: IdentifierExpression, contextualType: Type, constraints: Constraints): ExpressionRef;
4039+
compileInstanceOfExpression(expression: InstanceOfExpression, contextualType: Type, constraints: Constraints): ExpressionRef;
4040+
compileLiteralExpression(expression: LiteralExpression, contextualType: Type, constraints: Constraints, implicitlyNegate?: bool): ExpressionRef;
40394041
compileStringLiteral(expression: StringLiteralExpression): ExpressionRef;
4040-
compileArrayLiteral(elementType: Type, expressions: (Expression | null)[], isConst: bool, contextualFlags: ContextualFlags, reportNode: Node): ExpressionRef;
4042+
compileArrayLiteral(elementType: Type, expressions: (Expression | null)[], constraints: Constraints, reportNode: Node): ExpressionRef;
40414043
compileObjectLiteral(expression: ObjectLiteralExpression, contextualType: Type): ExpressionRef;
4042-
compileNewExpression(expression: NewExpression, contextualType: Type, contextualFlags: ContextualFlags): ExpressionRef;
4044+
compileNewExpression(expression: NewExpression, contextualType: Type, constraints: Constraints): ExpressionRef;
40434045
/** Gets the compiled constructor of the specified class or generates one if none is present. */
40444046
ensureConstructor(classInstance: Class, reportNode: Node): Function;
40454047
compileInstantiate(
@@ -4048,18 +4050,18 @@ declare module 'assemblyscript/src/compiler' {
40484050
/** Constructor arguments. */
40494051
argumentExpressions: Expression[],
40504052
/** Contextual flags. */
4051-
contextualFlags: ContextualFlags,
4053+
constraints: Constraints,
40524054
/** Node to report on. */
40534055
reportNode: Node): ExpressionRef;
40544056
/**
40554057
* Compiles a property access in the specified context.
40564058
* @param retainConstantType Retains the type of inlined constants if `true`, otherwise
40574059
* precomputes them according to context.
40584060
*/
4059-
compilePropertyAccessExpression(propertyAccess: PropertyAccessExpression, contextualType: Type, contextualFlags: ContextualFlags): ExpressionRef;
4060-
compileTernaryExpression(expression: TernaryExpression, contextualType: Type, contextualFlags: ContextualFlags): ExpressionRef;
4061-
compileUnaryPostfixExpression(expression: UnaryPostfixExpression, contextualType: Type, contextualFlags: ContextualFlags): ExpressionRef;
4062-
compileUnaryPrefixExpression(expression: UnaryPrefixExpression, contextualType: Type, contextualFlags: ContextualFlags): ExpressionRef;
4061+
compilePropertyAccessExpression(propertyAccess: PropertyAccessExpression, contextualType: Type, constraints: Constraints): ExpressionRef;
4062+
compileTernaryExpression(expression: TernaryExpression, contextualType: Type, constraints: Constraints): ExpressionRef;
4063+
compileUnaryPostfixExpression(expression: UnaryPostfixExpression, contextualType: Type, constraints: Constraints): ExpressionRef;
4064+
compileUnaryPrefixExpression(expression: UnaryPrefixExpression, contextualType: Type, constraints: Constraints): ExpressionRef;
40634065
/** Makes sure that a 32-bit integer value is wrapped to a valid value of the specified type. */
40644066
ensureSmallIntegerWrap(expr: ExpressionRef, type: Type): ExpressionRef;
40654067
/** Adds the debug location of the specified expression at the specified range to the source map. */

dist/assemblyscript.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/assemblyscript.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)