Skip to content

Commit 6d95f4f

Browse files
committed
smalloc: deprecate whole module
It makes no sense to allow people use constants from `smalloc`, since it will be removed completely eventually. PR-URL: #1822 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
1 parent 628845b commit 6d95f4f

File tree

3 files changed

+5
-27
lines changed

3 files changed

+5
-27
lines changed

lib/fs.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const Readable = Stream.Readable;
1919
const Writable = Stream.Writable;
2020

2121
const kMinPoolSpace = 128;
22-
const kMaxLength = require('smalloc').kMaxLength;
22+
const kMaxLength = require('internal/smalloc').kMaxLength;
2323

2424
const O_APPEND = constants.O_APPEND || 0;
2525
const O_CREAT = constants.O_CREAT || 0;

lib/repl.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@ exports.writer = util.inspect;
6161
exports._builtinLibs = ['assert', 'buffer', 'child_process', 'cluster',
6262
'crypto', 'dgram', 'dns', 'domain', 'events', 'fs', 'http', 'https', 'net',
6363
'os', 'path', 'punycode', 'querystring', 'readline', 'stream',
64-
'string_decoder', 'tls', 'tty', 'url', 'util', 'v8', 'vm', 'zlib',
65-
'smalloc'];
64+
'string_decoder', 'tls', 'tty', 'url', 'util', 'v8', 'vm', 'zlib'];
6665

6766

6867
const BLOCK_SCOPED_ERROR = 'Block-scoped declarations (let, ' +

lib/smalloc.js

+3-24
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,6 @@
11
'use strict';
22

3-
const smalloc = require('internal/smalloc');
4-
const deprecate = require('util').deprecate;
3+
const util = require('internal/util');
54

6-
exports.alloc =
7-
deprecate(smalloc.alloc, 'smalloc.alloc: Deprecated, use typed arrays');
8-
9-
exports.copyOnto =
10-
deprecate(smalloc.copyOnto,
11-
'smalloc.copyOnto: Deprecated, use typed arrays');
12-
13-
exports.dispose =
14-
deprecate(smalloc.dispose,
15-
'smalloc.dispose: Deprecated, use typed arrays');
16-
17-
exports.hasExternalData =
18-
deprecate(smalloc.hasExternalData,
19-
'smalloc.hasExternalData: Deprecated, use typed arrays');
20-
21-
Object.defineProperty(exports, 'kMaxLength', {
22-
enumerable: true, value: smalloc.kMaxLength, writable: false
23-
});
24-
25-
Object.defineProperty(exports, 'Types', {
26-
enumerable: true, value: Object.freeze(smalloc.Types), writable: false
27-
});
5+
module.exports = require('internal/smalloc');
6+
util.printDeprecationMessage('smalloc is deprecated.');

0 commit comments

Comments
 (0)