Another fix for process.assert
This commit is contained in:
parent
f71e4d8b43
commit
bfb6a67d60
@ -84,6 +84,6 @@ exports.trace = function(label) {
|
|||||||
exports.assert = function(expression) {
|
exports.assert = function(expression) {
|
||||||
if (!expression) {
|
if (!expression) {
|
||||||
var arr = Array.prototype.slice.call(arguments, 1);
|
var arr = Array.prototype.slice.call(arguments, 1);
|
||||||
process.assert(false, format.apply(this, arr));
|
require('assert').ok(false, format.apply(this, arr));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -4,7 +4,7 @@ var stream = require('stream');
|
|||||||
var EventEmitter = require('events').EventEmitter;
|
var EventEmitter = require('events').EventEmitter;
|
||||||
var FreeList = require('freelist').FreeList;
|
var FreeList = require('freelist').FreeList;
|
||||||
var HTTPParser = process.binding('http_parser').HTTPParser;
|
var HTTPParser = process.binding('http_parser').HTTPParser;
|
||||||
var assert = process.assert;
|
var assert = require('assert').ok;
|
||||||
|
|
||||||
|
|
||||||
var debug;
|
var debug;
|
||||||
|
@ -2,7 +2,7 @@ var NativeModule = require('native_module');
|
|||||||
var Script = process.binding('evals').Script;
|
var Script = process.binding('evals').Script;
|
||||||
var runInThisContext = Script.runInThisContext;
|
var runInThisContext = Script.runInThisContext;
|
||||||
var runInNewContext = Script.runInNewContext;
|
var runInNewContext = Script.runInNewContext;
|
||||||
var assert = process.assert;
|
var assert = require('assert').ok;
|
||||||
|
|
||||||
function Module(id, parent) {
|
function Module(id, parent) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
|
@ -28,7 +28,7 @@ var FreeList = require('freelist').FreeList;
|
|||||||
|
|
||||||
var IOWatcher = process.binding('io_watcher').IOWatcher;
|
var IOWatcher = process.binding('io_watcher').IOWatcher;
|
||||||
var constants = process.binding('constants');
|
var constants = process.binding('constants');
|
||||||
var assert = process.assert;
|
var assert = require('assert').ok;
|
||||||
|
|
||||||
var socket = binding.socket;
|
var socket = binding.socket;
|
||||||
var bind = binding.bind;
|
var bind = binding.bind;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
var Timer = process.binding('timer').Timer;
|
var Timer = process.binding('timer').Timer;
|
||||||
var L = require('_linklist');
|
var L = require('_linklist');
|
||||||
var assert = process.assert;
|
var assert = require('assert').ok;
|
||||||
|
|
||||||
var debug;
|
var debug;
|
||||||
if (process.env.NODE_debug && /timer/.test(process.env.NODE_debug)) {
|
if (process.env.NODE_debug && /timer/.test(process.env.NODE_debug)) {
|
||||||
|
@ -4,7 +4,7 @@ var net = require('net');
|
|||||||
var events = require('events');
|
var events = require('events');
|
||||||
var stream = require('stream');
|
var stream = require('stream');
|
||||||
|
|
||||||
var assert = process.assert;
|
var assert = require('assert').ok;
|
||||||
|
|
||||||
var debug;
|
var debug;
|
||||||
if (process.env.NODE_DEBUG && /tls/.test(process.env.NODE_DEBUG)) {
|
if (process.env.NODE_DEBUG && /tls/.test(process.env.NODE_DEBUG)) {
|
||||||
|
@ -243,6 +243,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
startup._removedProcessMethods = {
|
startup._removedProcessMethods = {
|
||||||
|
'assert': 'process.assert() use require("assert").ok() instead',
|
||||||
'debug': 'process.debug() use console.error() instead',
|
'debug': 'process.debug() use console.error() instead',
|
||||||
'error': 'process.error() use console.error() instead',
|
'error': 'process.error() use console.error() instead',
|
||||||
'watchFile': 'process.watchFile() has moved to fs.watchFile()',
|
'watchFile': 'process.watchFile() has moved to fs.watchFile()',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user