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

Unified Diff: test/cctest/test-api.cc

Side-by-side diff isn't available for this file because of its large size.
Issue 2806373005: [v8] v8::StackTrace::AsArray returns correct array (Closed)
Patch Set: removed redundant semicolon Created 3 years, 8 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:
Download patch
« src/api.cc ('K') | « src/objects-inl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-api.cc
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
index 99f021d7acc3c2ad85c2ccc753822fb107849f8d..d06c013ca2997aa9fec0111f7614acd4da84a254 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -16807,6 +16807,7 @@ void AnalyzeStackInNativeCode(const v8::FunctionCallbackInfo<v8::Value>& args) {
CHECK(args.Length() == 1);
v8::Local<v8::Context> context = args.GetIsolate()->GetCurrentContext();
+ Local<Object> global = context->Global();
int testGroup = args[0]->Int32Value(context).FromJust();
if (testGroup == kOverviewTest) {
v8::Local<v8::StackTrace> stackTrace = v8::StackTrace::CurrentStackTrace(
@@ -16822,6 +16823,10 @@ void AnalyzeStackInNativeCode(const v8::FunctionCallbackInfo<v8::Value>& args) {
checkStackFrame(origin, "", 8, 7, false, false, stackTrace->GetFrame(3));
CHECK(stackTrace->AsArray()->IsArray());
+ global->Set(context, v8_str("stack"), stackTrace->AsArray()).FromJust();
+ ExpectString("JSON.stringify(stack[0])",
+ "{\"line\":3,\"column\":11,\"scriptName\":\"capture-stack-"
+ "trace-test\",\"functionName\":\"bar\"}");
} else if (testGroup == kDetailedTest) {
v8::Local<v8::StackTrace> stackTrace = v8::StackTrace::CurrentStackTrace(
args.GetIsolate(), 10, v8::StackTrace::kDetailed);
@@ -16837,6 +16842,12 @@ void AnalyzeStackInNativeCode(const v8::FunctionCallbackInfo<v8::Value>& args) {
checkStackFrame(origin, "", 10, 1, false, false, stackTrace->GetFrame(3));
CHECK(stackTrace->AsArray()->IsArray());
+ global->Set(context, v8_str("stack"), stackTrace->AsArray()).FromJust();
+ ExpectString("JSON.stringify(stack[0])",
+ "{\"line\":5,\"column\":23,\"scriptName\":\"capture-stack-"
+ "trace-test\",\"scriptNameOrSourceURL\":\"capture-stack-trace-"
+ "test\",\"functionName\":\"bat\",\"isEval\":false,"
+ "\"isConstructor\":false}");
} else if (testGroup == kFunctionName) {
v8::Local<v8::StackTrace> stackTrace = v8::StackTrace::CurrentStackTrace(
args.GetIsolate(), 5, v8::StackTrace::kOverview);
« src/api.cc ('K') | « src/objects-inl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698