mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-12 22:41:27 +00:00
Add compiler hints
This commit is contained in:
17
std/assembly.d.ts
vendored
17
std/assembly.d.ts
vendored
@ -34,6 +34,23 @@ declare type f32 = number;
|
||||
/** A 64-bit float. */
|
||||
declare type f64 = number;
|
||||
|
||||
/** Compiler target. 0 = JS, 1 = WASM32, 2 = WASM64. */
|
||||
declare const ASC_TARGET: i32;
|
||||
/** Provided noTreeshaking option. */
|
||||
declare const ASC_NO_TREESHAKING: bool;
|
||||
/** Provided noAssert option. */
|
||||
declare const ASC_NO_ASSERT: bool;
|
||||
/** Provided memoryBase option. */
|
||||
declare const ASC_MEMORY_BASE: i32;
|
||||
/** Provided optimizeLevel option. */
|
||||
declare const ASC_OPTIMIZE_LEVEL: i32;
|
||||
/** Provided shrinkLevel option. */
|
||||
declare const ASC_SHRINK_LEVEL: i32;
|
||||
/** Whether the mutable global feature is enabled. */
|
||||
declare const ASC_FEATURE_MUTABLE_GLOBAL: bool;
|
||||
/** Whether the sign extension feature is enabled. */
|
||||
declare const ASC_FEATURE_SIGN_EXTENSION: bool;
|
||||
|
||||
/** Converts any other numeric value to an 8-bit signed integer. */
|
||||
declare function i8(value: i8 | i16 | i32 | i64 | isize | u8 | u16 | u32 | u64 | usize | bool | f32 | f64): i8;
|
||||
declare namespace i8 {
|
||||
|
3
std/portable.d.ts
vendored
3
std/portable.d.ts
vendored
@ -28,6 +28,9 @@ declare type usize = number;
|
||||
declare type f32 = number;
|
||||
declare type f64 = number;
|
||||
|
||||
/** Compiler target. 0 = JS, 1 = WASM32, 2 = WASM64. */
|
||||
declare const ASC_TARGET: i32;
|
||||
|
||||
/** Converts any other numeric value to an 8-bit signed integer. */
|
||||
declare function i8(value: i8 | i16 | i32 | isize | u8 | u16 | u32 | usize | bool | f32 | f64): i8;
|
||||
declare namespace i8 {
|
||||
|
@ -2,6 +2,8 @@
|
||||
|
||||
var globalScope = typeof window !== "undefined" && window || typeof global !== "undefined" && global || self;
|
||||
|
||||
globalScope.ASC_TARGET = 0;
|
||||
|
||||
Object.defineProperties(
|
||||
globalScope["i8"] = function i8(value) { return value << 24 >> 24; }
|
||||
, {
|
||||
|
Reference in New Issue
Block a user