GeezerVison is showing github.com — v8: move `ToNamespacedPath` to c++ · nodejs/node@5aa2163
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: lib/v8.js -2Lines changed: 0 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -53,7 +53,6 @@ const { copy } = internalBinding('buffer'); |
53 | 53 | const { inspect } = require('internal/util/inspect'); |
54 | 54 | const { FastBuffer } = require('internal/buffer'); |
55 | 55 | const { getValidatedPath } = require('internal/fs/utils'); |
56 | | -const { toNamespacedPath } = require('path'); |
57 | 56 | const { |
58 | 57 | createHeapSnapshotStream, |
59 | 58 | triggerHeapSnapshot, |
@@ -78,7 +77,6 @@ const { getOptionValue } = require('internal/options'); |
78 | 77 | function writeHeapSnapshot(filename, options) { |
79 | 78 | if (filename !== undefined) { |
80 | 79 | filename = getValidatedPath(filename); |
81 | | - filename = toNamespacedPath(filename); |
82 | 80 | } |
83 | 81 | const optionArray = getHeapSnapshotOptions(options); |
84 | 82 | return triggerHeapSnapshot(filename, optionArray); |
|
Collapse file
Copy file name to clipboardExpand all lines: src/heap_utils.cc +2Lines changed: 2 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
2 | 2 | #include "env-inl.h" |
3 | 3 | #include "memory_tracker-inl.h" |
4 | 4 | #include "node_external_reference.h" |
| 5 | +#include "path.h" |
5 | 6 | #include "permission/permission.h" |
6 | 7 | #include "stream_base-inl.h" |
7 | 8 | #include "util-inl.h" |
@@ -468,6 +469,7 @@ void TriggerHeapSnapshot(const FunctionCallbackInfo<Value>& args) { |
468 | 469 |
|
469 | 470 | BufferValue path(isolate, filename_v); |
470 | 471 | CHECK_NOT_NULL(*path); |
| 472 | + ToNamespacedPath(env, &path); |
471 | 473 | THROW_IF_INSUFFICIENT_PERMISSIONS( |
472 | 474 | env, permission::PermissionScope::kFileSystemWrite, path.ToStringView()); |
473 | 475 | if (WriteSnapshot(env, *path, options).IsNothing()) return; |
|