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 — src: prevent hard coding stack trace limit · jigfox/node@8baee5e

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src
    • env.cc
    • env.h
    • node_errors.cc
  • test/message
    • throw_error_with_getter_throw_traced.out
    • throw_null_traced.out
    • throw_undefined_traced.out
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/env.cc‎

Copy file name to clipboardExpand all lines: src/env.cc
+6-6Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -592,9 +592,9 @@ void Environment::PrintSyncTrace() const {
592592

593593
fprintf(
594594
stderr, "(node:%d) WARNING: Detected use of sync API\n", uv_os_getpid());
595-
PrintStackTrace(
596-
isolate(),
597-
StackTrace::CurrentStackTrace(isolate(), 10, StackTrace::kDetailed));
595+
PrintStackTrace(isolate(),
596+
StackTrace::CurrentStackTrace(
597+
isolate(), stack_trace_limit(), StackTrace::kDetailed));
598598
}
599599

600600
void Environment::RunCleanup() {
@@ -949,9 +949,9 @@ void Environment::Exit(int exit_code) {
949949

950950
fprintf(
951951
stderr, "WARNING: Exited the environment with code %d\n", exit_code);
952-
PrintStackTrace(
953-
isolate(),
954-
StackTrace::CurrentStackTrace(isolate(), 10, StackTrace::kDetailed));
952+
PrintStackTrace(isolate(),
953+
StackTrace::CurrentStackTrace(
954+
isolate(), stack_trace_limit(), StackTrace::kDetailed));
955955
}
956956
if (is_main_thread()) {
957957
stop_sub_worker_contexts();
Collapse file

‎src/env.h‎

Copy file name to clipboardExpand all lines: src/env.h
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1234,6 +1234,8 @@ class Environment : public MemoryRetainer {
12341234
inline void modify_base_object_count(int64_t delta);
12351235
inline int64_t base_object_count() const;
12361236

1237+
inline int32_t stack_trace_limit() const { return 10; }
1238+
12371239
#if HAVE_INSPECTOR
12381240
void set_coverage_connection(
12391241
std::unique_ptr<profiler::V8CoverageConnection> connection);
Collapse file

‎src/node_errors.cc‎

Copy file name to clipboardExpand all lines: src/node_errors.cc
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ static std::string GetErrorSource(Isolate* isolate,
145145
}
146146

147147
void PrintStackTrace(Isolate* isolate, Local<StackTrace> stack) {
148-
for (int i = 0; i < stack->GetFrameCount() - 1; i++) {
148+
for (int i = 0; i < stack->GetFrameCount(); i++) {
149149
Local<StackFrame> stack_frame = stack->GetFrame(isolate, i);
150150
node::Utf8Value fn_name_s(isolate, stack_frame->GetFunctionName());
151151
node::Utf8Value script_name(isolate, stack_frame->GetScriptName());
Collapse file

‎test/message/throw_error_with_getter_throw_traced.out‎

Copy file name to clipboardExpand all lines: test/message/throw_error_with_getter_throw_traced.out
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ Thrown at:
1010
at Module.load (internal/modules/cjs/loader.js:*:*)
1111
at Module._load (internal/modules/cjs/loader.js:*:*)
1212
at executeUserEntryPoint (internal/modules/run_main.js:*:*)
13+
at internal/main/run_main_module.js:*:*
Collapse file

‎test/message/throw_null_traced.out‎

Copy file name to clipboardExpand all lines: test/message/throw_null_traced.out
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ Thrown at:
1010
at Module.load (internal/modules/cjs/loader.js:*:*)
1111
at Module._load (internal/modules/cjs/loader.js:*:*)
1212
at executeUserEntryPoint (internal/modules/run_main.js:*:*)
13+
at internal/main/run_main_module.js:*:*
Collapse file

‎test/message/throw_undefined_traced.out‎

Copy file name to clipboardExpand all lines: test/message/throw_undefined_traced.out
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ Thrown at:
1010
at Module.load (internal/modules/cjs/loader.js:*:*)
1111
at Module._load (internal/modules/cjs/loader.js:*:*)
1212
at executeUserEntryPoint (internal/modules/run_main.js:*:*)
13+
at internal/main/run_main_module.js:*:*

0 commit comments

Comments
0 (0)
You are visitor 01402792 — 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.