Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(56)

Unified Diff: test/mjsunit/stack-traces.js

Issue 3444011: Use //@ sourceURL when formatting stack trace (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/messages.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/stack-traces.js
===================================================================
--- test/mjsunit/stack-traces.js (revision 5497)
+++ test/mjsunit/stack-traces.js (working copy)
@@ -63,6 +63,16 @@
eval("function Outer() { eval('function Inner() { eval(x); }'); Inner(); }; Outer();");
}
+function testEvalWithSourceURL() {
+ eval("function Doo() { FAIL; }; Doo();\n//@ sourceURL=res://name");
+}
+
+function testNestedEvalWithSourceURL() {
+ var x = "FAIL";
+ var innerEval = 'function Inner() { eval(x); }\n//@ sourceURL=res://inner-eval';
+ eval("function Outer() { eval(innerEval); Inner(); }; Outer();\n//@ sourceURL=res://outer-eval");
+}
+
function testValue() {
Number.prototype.causeError = function () { FAIL; };
(1).causeError();
@@ -110,7 +120,7 @@
} catch (e) {
for (var i = 0; i < expected.length; i++) {
assertTrue(e.stack.indexOf(expected[i]) != -1,
- name + " doesn't contain expected[" + i + "]");
+ name + " doesn't contain expected[" + i + "] stack = " + e.stack);
}
if (unexpected) {
for (var i = 0; i < unexpected.length; i++) {
@@ -190,6 +200,11 @@
testTrace("testImplicitConversion", testImplicitConversion, ["at Nirk.valueOf"]);
testTrace("testEval", testEval, ["at Doo (eval at testEval"]);
testTrace("testNestedEval", testNestedEval, ["eval at Inner (eval at Outer"]);
+testTrace("testEvalWithSourceURL", testEvalWithSourceURL,
+ [ "at Doo (res://name:1:18)" ]);
+testTrace("testNestedEvalWithSourceURL", testNestedEvalWithSourceURL,
+ [" at Inner (res://inner-eval:1:20)",
+ " at Outer (res://outer-eval:1:37)"]);
testTrace("testValue", testValue, ["at Number.causeError"]);
testTrace("testConstructor", testConstructor, ["new Plonk"]);
testTrace("testRenamedMethod", testRenamedMethod, ["Wookie.a$b$c$d [as d]"]);
« no previous file with comments | « src/messages.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698