GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — deps: V8: cherry-pick 25902244ad1a · nodejs/node@f72cbb7

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • common.gypi
  • deps/v8
    • src/execution
      • isolate.cc
    • test/cctest
      • test-api.cc
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎common.gypi‎

Copy file name to clipboardExpand all lines: common.gypi
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
# Reset this number to 0 on major V8 upgrades.
3838
# Increment by one for each non-official patch applied to deps/v8.
39-
'v8_embedder_string': '-node.19',
39+
'v8_embedder_string': '-node.20',
4040

4141
##### V8 defaults for Node.js #####
4242

Collapse file

‎deps/v8/src/execution/isolate.cc‎

Copy file name to clipboardExpand all lines: deps/v8/src/execution/isolate.cc
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2451,6 +2451,7 @@ void Isolate::PrintCurrentStackTrace(std::ostream& out) {
24512451
for (int i = 0; i < frames->length(); ++i) {
24522452
Handle<CallSiteInfo> frame(CallSiteInfo::cast(frames->get(i)), this);
24532453
SerializeCallSiteInfo(this, frame, &builder);
2454+
if (i != frames->length() - 1) builder.AppendCharacter('\n');
24542455
}
24552456

24562457
Handle<String> stack_trace = builder.Finish().ToHandleChecked();
Collapse file

‎deps/v8/test/cctest/test-api.cc‎

Copy file name to clipboardExpand all lines: deps/v8/test/cctest/test-api.cc
+46Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include <csignal>
3232
#include <map>
3333
#include <memory>
34+
#include <sstream>
3435
#include <string>
3536

3637
#include "test/cctest/cctest.h"
@@ -4869,6 +4870,51 @@ TEST(MessageGetSourceLine) {
48694870
});
48704871
}
48714872

4873+
void GetCurrentStackTrace(const v8::FunctionCallbackInfo<v8::Value>& args) {
4874+
std::stringstream ss;
4875+
v8::Message::PrintCurrentStackTrace(args.GetIsolate(), ss);
4876+
std::string str = ss.str();
4877+
args.GetReturnValue().Set(v8_str(str.c_str()));
4878+
}
4879+
4880+
THREADED_TEST(MessagePrintCurrentStackTrace) {
4881+
v8::Isolate* isolate = CcTest::isolate();
4882+
v8::HandleScope scope(isolate);
4883+
Local<ObjectTemplate> templ = ObjectTemplate::New(isolate);
4884+
templ->Set(isolate, "getCurrentStackTrace",
4885+
v8::FunctionTemplate::New(isolate, GetCurrentStackTrace));
4886+
LocalContext context(nullptr, templ);
4887+
4888+
v8::ScriptOrigin origin = v8::ScriptOrigin(isolate, v8_str("test"), 0, 0);
4889+
v8::Local<v8::String> script = v8_str(
4890+
"function c() {\n"
4891+
" return getCurrentStackTrace();\n"
4892+
"}\n"
4893+
"function b() {\n"
4894+
" return c();\n"
4895+
"}\n"
4896+
"function a() {\n"
4897+
" return b();\n"
4898+
"}\n"
4899+
"a();");
4900+
v8::Local<v8::Value> stack_trace =
4901+
v8::Script::Compile(context.local(), script, &origin)
4902+
.ToLocalChecked()
4903+
->Run(context.local())
4904+
.ToLocalChecked();
4905+
4906+
CHECK(stack_trace->IsString());
4907+
v8::String::Utf8Value stack_trace_value(isolate,
4908+
stack_trace.As<v8::String>());
4909+
std::string stack_trace_string(*stack_trace_value);
4910+
std::string expected(
4911+
"c (test:2:10)\n"
4912+
"b (test:5:10)\n"
4913+
"a (test:8:10)\n"
4914+
"test:10:1");
4915+
CHECK_EQ(stack_trace_string, expected);
4916+
}
4917+
48724918
THREADED_TEST(GetSetProperty) {
48734919
LocalContext context;
48744920
v8::Isolate* isolate = context->GetIsolate();

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.