Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use const enums in typescript since regular enums generate extremely bad code #64486

Merged
merged 1 commit into from
Jan 29, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/mono/wasm/runtime/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ export function assert(condition: unknown, messsage: string): asserts condition
}

// see src/mono/wasm/driver.c MARSHAL_TYPE_xxx and Runtime.cs MarshalType
export enum MarshalType {
export const enum MarshalType {
NULL = 0,
INT = 1,
FP64 = 2,
Expand Down Expand Up @@ -230,7 +230,7 @@ export enum MarshalType {
}

// see src/mono/wasm/driver.c MARSHAL_ERROR_xxx and Runtime.cs
export enum MarshalError {
export const enum MarshalError {
BUFFER_TOO_SMALL = 512,
NULL_CLASS_POINTER = 513,
NULL_TYPE_POINTER = 514,
Expand Down