smalloc: deprecate whole module
authorVladimir Kurchatkin <vladimir.kurchatkin@gmail.com>
Thu, 28 May 2015 14:20:57 +0000 (17:20 +0300)
committerVladimir Kurchatkin <vladimir.kurchatkin@gmail.com>
Thu, 4 Jun 2015 08:00:19 +0000 (11:00 +0300)
It makes no sense to allow people use constants from
`smalloc`, since it will be removed completely eventually.

PR-URL: https://github.com/nodejs/io.js/pull/1822
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
lib/fs.js
lib/repl.js
lib/smalloc.js

index 35d84da..e86a7d0 100644 (file)
--- a/lib/fs.js
+++ b/lib/fs.js
@@ -19,7 +19,7 @@ const Readable = Stream.Readable;
 const Writable = Stream.Writable;
 
 const kMinPoolSpace = 128;
-const kMaxLength = require('smalloc').kMaxLength;
+const kMaxLength = require('internal/smalloc').kMaxLength;
 
 const O_APPEND = constants.O_APPEND || 0;
 const O_CREAT = constants.O_CREAT || 0;
index 4049655..420fde4 100644 (file)
@@ -61,8 +61,7 @@ exports.writer = util.inspect;
 exports._builtinLibs = ['assert', 'buffer', 'child_process', 'cluster',
   'crypto', 'dgram', 'dns', 'domain', 'events', 'fs', 'http', 'https', 'net',
   'os', 'path', 'punycode', 'querystring', 'readline', 'stream',
-  'string_decoder', 'tls', 'tty', 'url', 'util', 'v8', 'vm', 'zlib',
-  'smalloc'];
+  'string_decoder', 'tls', 'tty', 'url', 'util', 'v8', 'vm', 'zlib'];
 
 
 const BLOCK_SCOPED_ERROR = 'Block-scoped declarations (let, ' +
index 8601a8b..9a74ca9 100644 (file)
@@ -1,27 +1,6 @@
 'use strict';
 
-const smalloc = require('internal/smalloc');
-const deprecate = require('util').deprecate;
+const util = require('internal/util');
 
-exports.alloc =
-    deprecate(smalloc.alloc, 'smalloc.alloc: Deprecated, use typed arrays');
-
-exports.copyOnto =
-    deprecate(smalloc.copyOnto,
-              'smalloc.copyOnto: Deprecated, use typed arrays');
-
-exports.dispose =
-    deprecate(smalloc.dispose,
-              'smalloc.dispose: Deprecated, use typed arrays');
-
-exports.hasExternalData =
-    deprecate(smalloc.hasExternalData,
-              'smalloc.hasExternalData: Deprecated, use typed arrays');
-
-Object.defineProperty(exports, 'kMaxLength', {
-  enumerable: true, value: smalloc.kMaxLength, writable: false
-});
-
-Object.defineProperty(exports, 'Types', {
-  enumerable: true, value: Object.freeze(smalloc.Types), writable: false
-});
+module.exports = require('internal/smalloc');
+util.printDeprecationMessage('smalloc is deprecated.');