提交 be8f49b3 编写于 作者: K Kevin (Kun) "Kassimo" Qian 提交者: Ryan Dahl

Add `toString` for CallSite of eval origin (#809)

上级 3fe4be07
......@@ -17,5 +17,5 @@ import "./symlink_test.ts";
import "./platform_test.ts";
import "./text_encoding_test.ts";
import "./trace_test.ts";
import "./v8_source_maps_test.ts";
import "../website/app_test.js";
......@@ -88,6 +88,7 @@ export function wrapCallSite(frame: CallSite): CallSite {
origin = mapEvalOrigin(origin);
frame = cloneCallSite(frame);
frame.getEvalOrigin = () => origin;
frame.toString = () => CallSiteToString(frame);
return frame;
}
......
// Copyright 2018 the Deno authors. All rights reserved. MIT license.
import { test, assert, assertEqual } from "./test_util.ts";
// This test demonstrates a bug:
// https://github.com/denoland/deno/issues/808
test(function evalErrorFormatted() {
let err;
try {
eval("boom");
} catch (e) {
err = e;
}
assert(!!err);
// tslint:disable-next-line:no-unused-expression
err.stack; // This would crash if err.stack is malformed
assertEqual(err.name, "ReferenceError");
});
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册