parseInt compatibility layer around parseI64, see #19

This commit is contained in:
dcodeIO
2018-01-30 01:26:38 +01:00
parent cae89e0b1f
commit ab5a938ea0
9 changed files with 282 additions and 41 deletions

4
std/assembly.d.ts vendored
View File

@ -189,10 +189,12 @@ declare function changetype<T>(value: any): T;
declare function isNaN<T = f32 | f64>(value: T): bool;
/** Tests if a 32-bit or 64-bit float is finite, that is not `NaN` or +/-`Infinity`. */
declare function isFinite<T = f32 | f64>(value: T): bool;
/** Traps if the specified value is not true-ish, otherwise returns the value. */
/** Traps if the specified value is not true-ish, otherwise returns the (non-nullable) value. */
declare function assert<T>(isTrueish: T, message?: string): T & object; // any better way to model `: T != null`?
/** Parses an integer string to a 64-bit float. */
declare function parseInt(str: string, radix?: i32): f64;
/** Parses an integer string to a 64-bit integer. */
declare function parseI64(str: string, radix?: i32): i64;
/** Parses a string to a 64-bit float. */
declare function parseFloat(str: string): f64;