declare var string ; declare var debug ; module JS { export class Error { private __tostring : ( ) => string ; private stack : string ; public constructor ( private message ) { this . __tostring = function ( ) : string { return this . message + '\n' + this . stack ; } ; this . stack = debug . traceback ( ) ; } public toString ( ) { return new String ( this . message ) ; } } }