Skip to content

Commit

Permalink
deps: escape funtionName in CPU Profiles
Browse files Browse the repository at this point in the history
PR-URL: #179
Fixes: #178
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
  • Loading branch information
santigimeno committed Nov 21, 2024
1 parent 369c34d commit c55c35a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions deps/v8/src/profiler/profile-generator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -809,9 +809,9 @@ void CpuProfileJSONSerializer::SerializePositionTicks(

void CpuProfileJSONSerializer::SerializeCallFrame(
const v8::CpuProfileNode* node) {
writer_->AddString("\"functionName\":\"");
writer_->AddString(node->GetFunctionNameStr());
writer_->AddString("\",\"lineNumber\":");
writer_->AddString("\"functionName\":");
writer_->EscapeAndAddString(node->GetFunctionNameStr());
writer_->AddString(",\"lineNumber\":");
writer_->AddNumber(node->GetLineNumber() - 1);
writer_->AddString(",\"columnNumber\":");
writer_->AddNumber(node->GetColumnNumber() - 1);
Expand Down

0 comments on commit c55c35a

Please sign in to comment.