Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d46446a

Browse filesBrowse files
ryzokukentargos
authored andcommitted
v8: replace Buffer with FastBuffer in deserialize
Replace the Buffer constructor with a FastBuffer in v8.deserialize in order to avoid calling the Buffer constructor and thus triggering a deprecation warning from code inside the core. Fixes: #21181 PR-URL: #21196 Fixes: #21181 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 13fd09b commit d46446a
Copy full SHA for d46446a

File tree

Expand file treeCollapse file tree

2 files changed

+9
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+9
-1
lines changed
Open diff view settings
Collapse file

‎lib/v8.js‎

Copy file name to clipboardExpand all lines: lib/v8.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ const arrayBufferViewTypeToIndex = new Map();
143143
}
144144
}
145145

146-
const bufferConstructorIndex = arrayBufferViewTypes.push(Buffer) - 1;
146+
const bufferConstructorIndex = arrayBufferViewTypes.push(FastBuffer) - 1;
147147

148148
class DefaultSerializer extends Serializer {
149149
constructor() {
Collapse file
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// Flags: --pending-deprecation --no-warnings
2+
'use strict';
3+
4+
const common = require('../common');
5+
const v8 = require('v8');
6+
7+
process.on('warning', common.mustNotCall());
8+
v8.deserialize(v8.serialize(Buffer.alloc(0)));

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.