private void initializeBackingError() { this.stackTrace = null; // Invalidate the cached trace // Replace newlines with spaces so that we don't confuse the parser // below which splits on newlines, and will otherwise try to parse // the error message as part of the stack trace. // TODO: use string.asNativeString.replace instead when available. String errorMessage = internalToString().replace('\n', ' '); setBackingJsObject(fixIE(createError(errorMessage))); captureStackTrace(); }
Throwable(Object backingJsObject) { setBackingJsObject(backingJsObject); }