Index: test/cctest/test-api.cc |
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc |
index e0c9f3eb65b4d35db49356e965cbb08f5ac3b6e9..e1caba3c836b318baae697b592dd66f8f1bf10ce 100644 |
--- a/test/cctest/test-api.cc |
+++ b/test/cctest/test-api.cc |
@@ -7753,3 +7753,16 @@ THREADED_TEST(ScriptContextDependence) { |
CHECK_EQ(dep->Run()->Int32Value(), 100); |
CHECK_EQ(indep->Run()->Int32Value(), 101); |
} |
+ |
+THREADED_TEST(StackTrace) { |
+ v8::HandleScope scope; |
+ LocalContext context; |
+ v8::TryCatch try_catch; |
+ const char *source = "function foo() { FAIL.FAIL; }; foo();"; |
+ v8::Handle<v8::String> src = v8::String::New(source); |
+ v8::Handle<v8::String> origin = v8::String::New("stack-trace-test"); |
+ v8::Script::New(src, origin)->Run(); |
+ CHECK(try_catch.HasCaught()); |
+ v8::String::Utf8Value stack(try_catch.StackTrace()); |
+ CHECK(strstr(*stack, "at foo (stack-trace-test") != NULL); |
+} |