Skip to content

Commit 5aa2163

Browse files
anonrigaduh95
authored andcommitted
v8: move ToNamespacedPath to c++
PR-URL: #53655 Reviewed-By: Vinícius Lourenço Claro Cardoso <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent ecd8fce commit 5aa2163

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/v8.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ const { copy } = internalBinding('buffer');
5353
const { inspect } = require('internal/util/inspect');
5454
const { FastBuffer } = require('internal/buffer');
5555
const { getValidatedPath } = require('internal/fs/utils');
56-
const { toNamespacedPath } = require('path');
5756
const {
5857
createHeapSnapshotStream,
5958
triggerHeapSnapshot,
@@ -78,7 +77,6 @@ const { getOptionValue } = require('internal/options');
7877
function writeHeapSnapshot(filename, options) {
7978
if (filename !== undefined) {
8079
filename = getValidatedPath(filename);
81-
filename = toNamespacedPath(filename);
8280
}
8381
const optionArray = getHeapSnapshotOptions(options);
8482
return triggerHeapSnapshot(filename, optionArray);

src/heap_utils.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#include "env-inl.h"
33
#include "memory_tracker-inl.h"
44
#include "node_external_reference.h"
5+
#include "path.h"
56
#include "permission/permission.h"
67
#include "stream_base-inl.h"
78
#include "util-inl.h"
@@ -468,6 +469,7 @@ void TriggerHeapSnapshot(const FunctionCallbackInfo<Value>& args) {
468469

469470
BufferValue path(isolate, filename_v);
470471
CHECK_NOT_NULL(*path);
472+
ToNamespacedPath(env, &path);
471473
THROW_IF_INSUFFICIENT_PERMISSIONS(
472474
env, permission::PermissionScope::kFileSystemWrite, path.ToStringView());
473475
if (WriteSnapshot(env, *path, options).IsNothing()) return;

0 commit comments

Comments
 (0)