2015-05-28 17:01:56 +03:00
|
|
|
'use strict';
|
|
|
|
|
2018-03-04 22:16:24 +01:00
|
|
|
const {
|
|
|
|
ERR_INVALID_ARG_TYPE,
|
|
|
|
ERR_NO_CRYPTO,
|
|
|
|
ERR_UNKNOWN_SIGNAL
|
|
|
|
} = require('internal/errors').codes;
|
2017-10-07 22:50:42 +08:00
|
|
|
const { signals } = process.binding('constants').os;
|
2015-06-13 16:44:39 +00:00
|
|
|
|
2017-10-26 21:34:15 -07:00
|
|
|
const {
|
|
|
|
createPromise,
|
|
|
|
getHiddenValue,
|
|
|
|
promiseResolve,
|
|
|
|
promiseReject,
|
|
|
|
setHiddenValue,
|
|
|
|
arrow_message_private_symbol: kArrowMessagePrivateSymbolIndex,
|
|
|
|
decorated_private_symbol: kDecoratedPrivateSymbolIndex
|
|
|
|
} = process.binding('util');
|
2018-01-17 03:21:16 +08:00
|
|
|
const { errmap } = process.binding('uv');
|
2017-04-14 18:28:16 +02:00
|
|
|
|
2017-02-15 13:00:21 -08:00
|
|
|
const noCrypto = !process.versions.openssl;
|
2016-05-31 19:58:31 +02:00
|
|
|
|
2017-10-25 12:11:10 -07:00
|
|
|
const experimentalWarnings = new Set();
|
|
|
|
|
2017-12-11 06:32:59 -02:00
|
|
|
const colorRegExp = /\u001b\[\d\d?m/g;
|
|
|
|
|
|
|
|
function removeColors(str) {
|
|
|
|
return str.replace(colorRegExp, '');
|
|
|
|
}
|
|
|
|
|
2017-02-15 13:00:21 -08:00
|
|
|
function isError(e) {
|
|
|
|
return objectToString(e) === '[object Error]' || e instanceof Error;
|
|
|
|
}
|
|
|
|
|
|
|
|
function objectToString(o) {
|
|
|
|
return Object.prototype.toString.call(o);
|
|
|
|
}
|
2016-08-19 00:26:36 +02:00
|
|
|
|
2017-10-22 12:26:32 -07:00
|
|
|
// Keep a list of deprecation codes that have been warned on so we only warn on
|
|
|
|
// each one once.
|
|
|
|
const codesWarned = {};
|
|
|
|
|
2015-06-15 21:51:41 -07:00
|
|
|
// Mark that a method should not be used.
|
|
|
|
// Returns a modified function which warns once by default.
|
|
|
|
// If --no-deprecation is set, then it is a no-op.
|
2017-02-15 13:00:21 -08:00
|
|
|
function deprecate(fn, msg, code) {
|
2015-06-15 21:51:41 -07:00
|
|
|
if (process.noDeprecation === true) {
|
|
|
|
return fn;
|
|
|
|
}
|
|
|
|
|
2016-12-04 12:47:01 -08:00
|
|
|
if (code !== undefined && typeof code !== 'string')
|
2018-03-04 22:16:24 +01:00
|
|
|
throw new ERR_INVALID_ARG_TYPE('code', 'string');
|
2016-12-04 12:47:01 -08:00
|
|
|
|
2018-02-16 07:28:38 -05:00
|
|
|
let warned = false;
|
2017-02-15 13:00:21 -08:00
|
|
|
function deprecated(...args) {
|
2016-08-18 11:51:10 -07:00
|
|
|
if (!warned) {
|
|
|
|
warned = true;
|
2016-12-04 12:47:01 -08:00
|
|
|
if (code !== undefined) {
|
2017-10-22 12:26:32 -07:00
|
|
|
if (!codesWarned[code]) {
|
|
|
|
process.emitWarning(msg, 'DeprecationWarning', code, deprecated);
|
|
|
|
codesWarned[code] = true;
|
|
|
|
}
|
2016-12-04 12:47:01 -08:00
|
|
|
} else {
|
|
|
|
process.emitWarning(msg, 'DeprecationWarning', deprecated);
|
|
|
|
}
|
2016-08-18 11:51:10 -07:00
|
|
|
}
|
2016-07-12 23:09:12 +02:00
|
|
|
if (new.target) {
|
2017-02-15 13:00:21 -08:00
|
|
|
return Reflect.construct(fn, args, new.target);
|
2016-07-12 23:09:12 +02:00
|
|
|
}
|
2017-02-15 13:00:21 -08:00
|
|
|
return fn.apply(this, args);
|
2015-06-15 21:51:41 -07:00
|
|
|
}
|
|
|
|
|
2016-07-12 23:09:12 +02:00
|
|
|
// The wrapper will keep the same prototype as fn to maintain prototype chain
|
|
|
|
Object.setPrototypeOf(deprecated, fn);
|
|
|
|
if (fn.prototype) {
|
2016-08-14 15:27:40 -07:00
|
|
|
// Setting this (rather than using Object.setPrototype, as above) ensures
|
|
|
|
// that calling the unwrapped constructor gives an instanceof the wrapped
|
|
|
|
// constructor.
|
|
|
|
deprecated.prototype = fn.prototype;
|
2016-07-12 23:09:12 +02:00
|
|
|
}
|
|
|
|
|
2015-06-15 21:51:41 -07:00
|
|
|
return deprecated;
|
2017-02-15 13:00:21 -08:00
|
|
|
}
|
2015-11-25 22:37:43 +01:00
|
|
|
|
2017-02-15 13:00:21 -08:00
|
|
|
function decorateErrorStack(err) {
|
|
|
|
if (!(isError(err) && err.stack) ||
|
2017-10-26 21:34:15 -07:00
|
|
|
getHiddenValue(err, kDecoratedPrivateSymbolIndex) === true)
|
2015-11-25 22:37:43 +01:00
|
|
|
return;
|
|
|
|
|
2017-10-26 21:34:15 -07:00
|
|
|
const arrow = getHiddenValue(err, kArrowMessagePrivateSymbolIndex);
|
2015-11-25 22:37:43 +01:00
|
|
|
|
2015-12-15 03:55:35 -05:00
|
|
|
if (arrow) {
|
2015-11-25 22:37:43 +01:00
|
|
|
err.stack = arrow + err.stack;
|
2017-10-26 21:34:15 -07:00
|
|
|
setHiddenValue(err, kDecoratedPrivateSymbolIndex, true);
|
2015-12-15 03:55:35 -05:00
|
|
|
}
|
2017-02-15 13:00:21 -08:00
|
|
|
}
|
2016-03-08 15:31:31 -08:00
|
|
|
|
2017-02-15 13:00:21 -08:00
|
|
|
function assertCrypto() {
|
2016-03-08 15:31:31 -08:00
|
|
|
if (noCrypto)
|
2018-03-04 22:16:24 +01:00
|
|
|
throw new ERR_NO_CRYPTO();
|
2017-02-15 13:00:21 -08:00
|
|
|
}
|
2016-12-25 03:32:26 +08:00
|
|
|
|
|
|
|
// Return undefined if there is no match.
|
2018-02-14 23:48:35 +01:00
|
|
|
// Move the "slow cases" to a separate function to make sure this function gets
|
|
|
|
// inlined properly. That prioritizes the common case.
|
2017-02-15 13:00:21 -08:00
|
|
|
function normalizeEncoding(enc) {
|
2018-02-14 23:48:35 +01:00
|
|
|
if (enc == null || enc === 'utf8' || enc === 'utf-8') return 'utf8';
|
|
|
|
return slowCases(enc);
|
|
|
|
}
|
|
|
|
|
|
|
|
function slowCases(enc) {
|
|
|
|
switch (enc.length) {
|
|
|
|
case 4:
|
|
|
|
if (enc === 'UTF8') return 'utf8';
|
|
|
|
if (enc === 'ucs2' || enc === 'UCS2') return 'utf16le';
|
|
|
|
enc = `${enc}`.toLowerCase();
|
|
|
|
if (enc === 'utf8') return 'utf8';
|
|
|
|
if (enc === 'ucs2' || enc === 'UCS2') return 'utf16le';
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
if (enc === 'hex' || enc === 'HEX' || `${enc}`.toLowerCase() === 'hex')
|
|
|
|
return 'hex';
|
|
|
|
break;
|
|
|
|
case 5:
|
|
|
|
if (enc === 'ascii') return 'ascii';
|
|
|
|
if (enc === 'ucs-2') return 'utf16le';
|
|
|
|
if (enc === 'UTF-8') return 'utf8';
|
|
|
|
if (enc === 'ASCII') return 'ascii';
|
|
|
|
if (enc === 'UCS-2') return 'utf16le';
|
|
|
|
enc = `${enc}`.toLowerCase();
|
|
|
|
if (enc === 'utf-8') return 'utf8';
|
|
|
|
if (enc === 'ascii') return 'ascii';
|
|
|
|
if (enc === 'usc-2') return 'utf16le';
|
|
|
|
break;
|
|
|
|
case 6:
|
|
|
|
if (enc === 'base64') return 'base64';
|
|
|
|
if (enc === 'latin1' || enc === 'binary') return 'latin1';
|
|
|
|
if (enc === 'BASE64') return 'base64';
|
|
|
|
if (enc === 'LATIN1' || enc === 'BINARY') return 'latin1';
|
|
|
|
enc = `${enc}`.toLowerCase();
|
|
|
|
if (enc === 'base64') return 'base64';
|
|
|
|
if (enc === 'latin1' || enc === 'binary') return 'latin1';
|
|
|
|
break;
|
|
|
|
case 7:
|
|
|
|
if (enc === 'utf16le' || enc === 'UTF16LE' ||
|
|
|
|
`${enc}`.toLowerCase() === 'utf16le')
|
2016-06-07 16:03:27 -07:00
|
|
|
return 'utf16le';
|
2018-02-14 23:48:35 +01:00
|
|
|
break;
|
|
|
|
case 8:
|
|
|
|
if (enc === 'utf-16le' || enc === 'UTF-16LE' ||
|
|
|
|
`${enc}`.toLowerCase() === 'utf-16le')
|
|
|
|
return 'utf16le';
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
if (enc === '') return 'utf8';
|
2016-06-07 16:03:27 -07:00
|
|
|
}
|
2017-02-15 13:00:21 -08:00
|
|
|
}
|
2016-06-08 08:18:26 -07:00
|
|
|
|
2017-10-25 12:11:10 -07:00
|
|
|
function emitExperimentalWarning(feature) {
|
|
|
|
if (experimentalWarnings.has(feature)) return;
|
|
|
|
const msg = `${feature} is an experimental feature. This feature could ` +
|
|
|
|
'change at any time';
|
|
|
|
experimentalWarnings.add(feature);
|
|
|
|
process.emitWarning(msg, 'ExperimentalWarning');
|
|
|
|
}
|
|
|
|
|
2017-02-15 13:00:21 -08:00
|
|
|
function filterDuplicateStrings(items, low) {
|
2016-06-08 08:18:26 -07:00
|
|
|
const map = new Map();
|
2017-01-07 20:12:08 -08:00
|
|
|
for (var i = 0; i < items.length; i++) {
|
2016-06-08 08:18:26 -07:00
|
|
|
const item = items[i];
|
|
|
|
const key = item.toLowerCase();
|
|
|
|
if (low) {
|
|
|
|
map.set(key, key);
|
|
|
|
} else {
|
2017-01-07 20:12:08 -08:00
|
|
|
map.set(key, item);
|
2016-06-08 08:18:26 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return Array.from(map.values()).sort();
|
2017-02-15 13:00:21 -08:00
|
|
|
}
|
2016-06-08 08:18:26 -07:00
|
|
|
|
2017-02-15 13:00:21 -08:00
|
|
|
function cachedResult(fn) {
|
2018-02-16 07:28:38 -05:00
|
|
|
let result;
|
2016-06-08 08:18:26 -07:00
|
|
|
return () => {
|
|
|
|
if (result === undefined)
|
|
|
|
result = fn();
|
2017-01-13 14:28:35 -08:00
|
|
|
return result.slice();
|
2016-06-08 08:18:26 -07:00
|
|
|
};
|
2017-02-15 13:00:21 -08:00
|
|
|
}
|
buffer: convert offset & length to int properly
As per ecma-262 2015's #sec-%typedarray%-buffer-byteoffset-length,
`offset` would be an integer, not a 32 bit unsigned integer. Also,
`length` would be an integer with the maximum value of 2^53 - 1, not a
32 bit unsigned integer.
This would be a problem because, if we create a buffer from an
arraybuffer, from an offset which is greater than 2^32, it would be
actually pointing to a different location in arraybuffer. For example,
if we use 2^40 as offset, then the actual value used will be 0,
because `byteOffset >>>= 0` will convert `byteOffset` to a 32 bit
unsigned int, which is based on 2^32 modulo.
This is a redo, as the ca37fa527f174b547893817fe8c67a3befa02317 broke
CI.
Refer: https://github.com/nodejs/node/pull/9814
Refer: https://github.com/nodejs/node/pull/9492
PR-URL: https://github.com/nodejs/node/pull/9815
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2016-11-27 15:08:17 +05:30
|
|
|
|
2017-02-15 07:43:22 -08:00
|
|
|
// Useful for Wrapping an ES6 Class with a constructor Function that
|
|
|
|
// does not require the new keyword. For instance:
|
|
|
|
// class A { constructor(x) {this.x = x;}}
|
|
|
|
// const B = createClassWrapper(A);
|
|
|
|
// B() instanceof A // true
|
|
|
|
// B() instanceof B // true
|
2017-02-15 13:00:21 -08:00
|
|
|
function createClassWrapper(type) {
|
2017-04-27 17:27:05 -07:00
|
|
|
function fn(...args) {
|
2017-02-15 07:43:22 -08:00
|
|
|
return Reflect.construct(type, args, new.target || type);
|
2017-04-27 17:27:05 -07:00
|
|
|
}
|
2017-02-15 07:43:22 -08:00
|
|
|
// Mask the wrapper function name and length values
|
|
|
|
Object.defineProperties(fn, {
|
2017-07-10 20:55:21 -04:00
|
|
|
name: { value: type.name },
|
|
|
|
length: { value: type.length }
|
2017-02-15 07:43:22 -08:00
|
|
|
});
|
|
|
|
Object.setPrototypeOf(fn, type);
|
|
|
|
fn.prototype = type.prototype;
|
|
|
|
return fn;
|
2017-02-15 13:00:21 -08:00
|
|
|
}
|
2016-12-23 14:36:20 +05:30
|
|
|
|
|
|
|
let signalsToNamesMapping;
|
|
|
|
function getSignalsToNamesMapping() {
|
|
|
|
if (signalsToNamesMapping !== undefined)
|
|
|
|
return signalsToNamesMapping;
|
|
|
|
|
|
|
|
signalsToNamesMapping = Object.create(null);
|
2017-04-24 02:21:20 -04:00
|
|
|
for (var key in signals) {
|
2016-12-23 14:36:20 +05:30
|
|
|
signalsToNamesMapping[signals[key]] = key;
|
|
|
|
}
|
|
|
|
|
|
|
|
return signalsToNamesMapping;
|
|
|
|
}
|
|
|
|
|
2017-02-15 13:00:21 -08:00
|
|
|
function convertToValidSignal(signal) {
|
2016-12-23 14:36:20 +05:30
|
|
|
if (typeof signal === 'number' && getSignalsToNamesMapping()[signal])
|
|
|
|
return signal;
|
|
|
|
|
|
|
|
if (typeof signal === 'string') {
|
|
|
|
const signalName = signals[signal.toUpperCase()];
|
|
|
|
if (signalName) return signalName;
|
|
|
|
}
|
|
|
|
|
2018-03-04 22:16:24 +01:00
|
|
|
throw new ERR_UNKNOWN_SIGNAL(signal);
|
2017-02-15 13:00:21 -08:00
|
|
|
}
|
|
|
|
|
2017-04-19 23:07:39 -07:00
|
|
|
function getConstructorOf(obj) {
|
|
|
|
while (obj) {
|
2018-02-16 07:28:38 -05:00
|
|
|
const descriptor = Object.getOwnPropertyDescriptor(obj, 'constructor');
|
2017-04-19 23:07:39 -07:00
|
|
|
if (descriptor !== undefined &&
|
|
|
|
typeof descriptor.value === 'function' &&
|
|
|
|
descriptor.value.name !== '') {
|
|
|
|
return descriptor.value;
|
|
|
|
}
|
|
|
|
|
|
|
|
obj = Object.getPrototypeOf(obj);
|
|
|
|
}
|
|
|
|
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2018-01-17 03:21:16 +08:00
|
|
|
function getSystemErrorName(err) {
|
|
|
|
const entry = errmap.get(err);
|
|
|
|
return entry ? entry[0] : `Unknown system error ${err}`;
|
|
|
|
}
|
|
|
|
|
2017-11-11 10:35:01 -06:00
|
|
|
// getConstructorOf is wrapped into this to save iterations
|
|
|
|
function getIdentificationOf(obj) {
|
|
|
|
const original = obj;
|
2018-02-17 03:45:07 +01:00
|
|
|
let constructor;
|
|
|
|
let tag;
|
2017-11-11 10:35:01 -06:00
|
|
|
|
|
|
|
while (obj) {
|
|
|
|
if (constructor === undefined) {
|
|
|
|
const desc = Object.getOwnPropertyDescriptor(obj, 'constructor');
|
|
|
|
if (desc !== undefined &&
|
|
|
|
typeof desc.value === 'function' &&
|
|
|
|
desc.value.name !== '')
|
|
|
|
constructor = desc.value.name;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (tag === undefined) {
|
|
|
|
const desc = Object.getOwnPropertyDescriptor(obj, Symbol.toStringTag);
|
|
|
|
if (desc !== undefined) {
|
|
|
|
if (typeof desc.value === 'string') {
|
|
|
|
tag = desc.value;
|
|
|
|
} else if (desc.get !== undefined) {
|
|
|
|
tag = desc.get.call(original);
|
|
|
|
if (typeof tag !== 'string')
|
|
|
|
tag = undefined;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (constructor !== undefined && tag !== undefined)
|
|
|
|
break;
|
|
|
|
|
|
|
|
obj = Object.getPrototypeOf(obj);
|
|
|
|
}
|
|
|
|
|
|
|
|
return { constructor, tag };
|
|
|
|
}
|
|
|
|
|
2017-04-14 18:28:16 +02:00
|
|
|
const kCustomPromisifiedSymbol = Symbol('util.promisify.custom');
|
|
|
|
const kCustomPromisifyArgsSymbol = Symbol('customPromisifyArgs');
|
|
|
|
|
2017-06-20 23:20:10 +02:00
|
|
|
function promisify(original) {
|
|
|
|
if (typeof original !== 'function')
|
2018-03-04 22:16:24 +01:00
|
|
|
throw new ERR_INVALID_ARG_TYPE('original', 'Function');
|
2017-04-14 18:28:16 +02:00
|
|
|
|
2017-06-20 23:20:10 +02:00
|
|
|
if (original[kCustomPromisifiedSymbol]) {
|
|
|
|
const fn = original[kCustomPromisifiedSymbol];
|
2017-04-14 18:28:16 +02:00
|
|
|
if (typeof fn !== 'function') {
|
2018-03-04 22:16:24 +01:00
|
|
|
throw new ERR_INVALID_ARG_TYPE('util.promisify.custom', 'Function', fn);
|
2017-04-14 18:28:16 +02:00
|
|
|
}
|
|
|
|
Object.defineProperty(fn, kCustomPromisifiedSymbol, {
|
|
|
|
value: fn, enumerable: false, writable: false, configurable: true
|
|
|
|
});
|
|
|
|
return fn;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Names to create an object from in case the callback receives multiple
|
|
|
|
// arguments, e.g. ['stdout', 'stderr'] for child_process.exec.
|
2017-06-20 23:20:10 +02:00
|
|
|
const argumentNames = original[kCustomPromisifyArgsSymbol];
|
2017-04-14 18:28:16 +02:00
|
|
|
|
|
|
|
function fn(...args) {
|
|
|
|
const promise = createPromise();
|
|
|
|
try {
|
2017-06-20 23:20:10 +02:00
|
|
|
original.call(this, ...args, (err, ...values) => {
|
2017-04-14 18:28:16 +02:00
|
|
|
if (err) {
|
|
|
|
promiseReject(promise, err);
|
|
|
|
} else if (argumentNames !== undefined && values.length > 1) {
|
|
|
|
const obj = {};
|
|
|
|
for (var i = 0; i < argumentNames.length; i++)
|
|
|
|
obj[argumentNames[i]] = values[i];
|
|
|
|
promiseResolve(promise, obj);
|
|
|
|
} else {
|
|
|
|
promiseResolve(promise, values[0]);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
} catch (err) {
|
|
|
|
promiseReject(promise, err);
|
|
|
|
}
|
|
|
|
return promise;
|
|
|
|
}
|
|
|
|
|
2017-06-20 23:20:10 +02:00
|
|
|
Object.setPrototypeOf(fn, Object.getPrototypeOf(original));
|
2017-04-14 18:28:16 +02:00
|
|
|
|
|
|
|
Object.defineProperty(fn, kCustomPromisifiedSymbol, {
|
|
|
|
value: fn, enumerable: false, writable: false, configurable: true
|
|
|
|
});
|
2017-06-20 23:20:10 +02:00
|
|
|
return Object.defineProperties(
|
|
|
|
fn,
|
|
|
|
Object.getOwnPropertyDescriptors(original)
|
|
|
|
);
|
2017-04-14 18:28:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
promisify.custom = kCustomPromisifiedSymbol;
|
|
|
|
|
2017-08-21 23:20:59 -03:00
|
|
|
// The build-in Array#join is slower in v8 6.0
|
|
|
|
function join(output, separator) {
|
2018-02-16 07:28:38 -05:00
|
|
|
let str = '';
|
2017-08-21 23:20:59 -03:00
|
|
|
if (output.length !== 0) {
|
|
|
|
for (var i = 0; i < output.length - 1; i++) {
|
|
|
|
// It is faster not to use a template string here
|
|
|
|
str += output[i];
|
|
|
|
str += separator;
|
|
|
|
}
|
|
|
|
str += output[i];
|
|
|
|
}
|
|
|
|
return str;
|
|
|
|
}
|
|
|
|
|
2017-10-15 23:59:53 +08:00
|
|
|
// About 1.5x faster than the two-arg version of Array#splice().
|
|
|
|
function spliceOne(list, index) {
|
|
|
|
for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1)
|
|
|
|
list[i] = list[k];
|
|
|
|
list.pop();
|
|
|
|
}
|
|
|
|
|
2017-05-12 08:37:32 -07:00
|
|
|
module.exports = {
|
|
|
|
assertCrypto,
|
|
|
|
cachedResult,
|
|
|
|
convertToValidSignal,
|
|
|
|
createClassWrapper,
|
|
|
|
decorateErrorStack,
|
|
|
|
deprecate,
|
2017-10-25 12:11:10 -07:00
|
|
|
emitExperimentalWarning,
|
2017-05-12 08:37:32 -07:00
|
|
|
filterDuplicateStrings,
|
|
|
|
getConstructorOf,
|
2018-01-17 03:21:16 +08:00
|
|
|
getSystemErrorName,
|
2017-11-11 10:35:01 -06:00
|
|
|
getIdentificationOf,
|
2017-05-12 08:37:32 -07:00
|
|
|
isError,
|
2017-10-15 23:59:53 +08:00
|
|
|
join,
|
2017-05-12 08:37:32 -07:00
|
|
|
normalizeEncoding,
|
|
|
|
objectToString,
|
|
|
|
promisify,
|
2017-10-15 23:59:53 +08:00
|
|
|
spliceOne,
|
2017-12-11 06:32:59 -02:00
|
|
|
removeColors,
|
2017-05-12 08:37:32 -07:00
|
|
|
|
|
|
|
// Symbol used to customize promisify conversion
|
|
|
|
customPromisifyArgs: kCustomPromisifyArgsSymbol,
|
|
|
|
|
|
|
|
// Symbol used to provide a custom inspect function for an object as an
|
|
|
|
// alternative to using 'inspect'
|
|
|
|
customInspectSymbol: Symbol('util.inspect.custom'),
|
|
|
|
|
|
|
|
// Used by the buffer module to capture an internal reference to the
|
|
|
|
// default isEncoding implementation, just in case userland overrides it.
|
2018-02-26 15:46:50 +01:00
|
|
|
kIsEncodingSymbol: Symbol('kIsEncodingSymbol'),
|
|
|
|
kExpandStackSymbol: Symbol('kExpandStackSymbol')
|
2017-05-12 08:37:32 -07:00
|
|
|
};
|