mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-26 21:21:54 +00:00
Accessor parsing; Cleanup
This commit is contained in:
2
std/assembly.d.ts
vendored
2
std/assembly.d.ts
vendored
@ -89,7 +89,7 @@ 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 evaluates to `false`. */
|
||||
declare function assert(isTrue: bool): void;
|
||||
declare function assert(isTrue: bool, message?: string): void;
|
||||
/** Parses an integer string to a 64-bit float. */
|
||||
declare function parseInt(str: string, radix?: i32): f64;
|
||||
/** Parses a string to a 64-bit float. */
|
||||
|
@ -2,6 +2,7 @@
|
||||
"extends": "../tsconfig-base.json",
|
||||
"compilerOptions": {
|
||||
"target": "esnext",
|
||||
"module": "commonjs",
|
||||
"noLib": true,
|
||||
"types": [],
|
||||
"rootDirs": [
|
||||
|
2
std/portable.d.ts
vendored
2
std/portable.d.ts
vendored
@ -51,7 +51,7 @@ declare function unreachable(): any; // sic
|
||||
/** Changes the type of a value to another one. Useful for casting class instances to their pointer values and vice-versa. */
|
||||
declare function changetype<T1,T2>(value: T1): T2;
|
||||
/** Traps if the specified value evaluates to `false`. */
|
||||
declare function assert(isTrue: bool): void;
|
||||
declare function assert(isTrue: bool, message?: string): void;
|
||||
/** Parses an integer string to a 64-bit float. */
|
||||
declare function parseInt(str: string, radix?: i32): f64;
|
||||
/** Parses a floating point string to a 64-bit float. */
|
||||
|
@ -19,14 +19,14 @@ UnreachableError.prototype.message = "unreachable";
|
||||
|
||||
globalScope["unreachable"] = function unreachable() { throw new UnreachableError(); };
|
||||
|
||||
function AssertionError() {
|
||||
function AssertionError(message) {
|
||||
this.message = message || "assertion failed";
|
||||
this.stack = new Error().stack;
|
||||
}
|
||||
AssertionError.prototype = new Error;
|
||||
AssertionError.prototype.name = "AssertionError";
|
||||
AssertionError.prototype.message = "assertion failed";
|
||||
|
||||
globalScope["assert"] = function assert(isTrue) { if (!isTrue) throw new AssertionError(); };
|
||||
globalScope["assert"] = function assert(isTrue, message) { if (!isTrue) throw new AssertionError(message); };
|
||||
globalScope["changetype"] = function changetype(value) { return value; }
|
||||
|
||||
String["fromCharCodes"] = function fromCharCodes(arr) { return String.fromCharCode.apply(String, arr); }
|
||||
|
Reference in New Issue
Block a user