Add ArrayBuffer/DataView/Symbol#toString and improve Errors (#332)

This commit is contained in:
Max Graey
2018-11-18 12:43:44 +02:00
committed by Daniel Wirtz
parent a79db87af9
commit 1928404f3b
13 changed files with 3479 additions and 118 deletions

View File

@ -1,12 +1,11 @@
export class Error {
name: string = "Error";
message: string;
name: string = "Error";
stack: string = ""; // TODO
constructor(message: string = "") {
this.message = message;
}
constructor(
public message: string = ""
) {}
toString(): string {
var message = this.message;
@ -29,3 +28,10 @@ export class TypeError extends Error {
this.name = "TypeError";
}
}
export class SyntaxError extends Error {
constructor(message: string = "") {
super(message);
this.name = "SyntaxError";
}
}