diff --git a/lib/console.js b/lib/console.js index 8f09c5aab6a..708630725b1 100644 --- a/lib/console.js +++ b/lib/console.js @@ -84,6 +84,6 @@ exports.trace = function(label) { exports.assert = function(expression) { if (!expression) { var arr = Array.prototype.slice.call(arguments, 1); - process.assert(false, format.apply(this, arr)); + require('assert').ok(false, format.apply(this, arr)); } }; diff --git a/lib/http.js b/lib/http.js index 4bf823a3127..3b38aa1ee23 100644 --- a/lib/http.js +++ b/lib/http.js @@ -4,7 +4,7 @@ var stream = require('stream'); var EventEmitter = require('events').EventEmitter; var FreeList = require('freelist').FreeList; var HTTPParser = process.binding('http_parser').HTTPParser; -var assert = process.assert; +var assert = require('assert').ok; var debug; diff --git a/lib/module.js b/lib/module.js index c94d92930c5..de2f7abf695 100644 --- a/lib/module.js +++ b/lib/module.js @@ -2,7 +2,7 @@ var NativeModule = require('native_module'); var Script = process.binding('evals').Script; var runInThisContext = Script.runInThisContext; var runInNewContext = Script.runInNewContext; -var assert = process.assert; +var assert = require('assert').ok; function Module(id, parent) { this.id = id; diff --git a/lib/net.js b/lib/net.js index 5953c19f02b..abfc813c2cb 100644 --- a/lib/net.js +++ b/lib/net.js @@ -28,7 +28,7 @@ var FreeList = require('freelist').FreeList; var IOWatcher = process.binding('io_watcher').IOWatcher; var constants = process.binding('constants'); -var assert = process.assert; +var assert = require('assert').ok; var socket = binding.socket; var bind = binding.bind; diff --git a/lib/timers.js b/lib/timers.js index da46c5f9076..d79f64a8be1 100644 --- a/lib/timers.js +++ b/lib/timers.js @@ -1,6 +1,6 @@ var Timer = process.binding('timer').Timer; var L = require('_linklist'); -var assert = process.assert; +var assert = require('assert').ok; var debug; if (process.env.NODE_debug && /timer/.test(process.env.NODE_debug)) { diff --git a/lib/tls.js b/lib/tls.js index be820246251..1f193e7dfd9 100644 --- a/lib/tls.js +++ b/lib/tls.js @@ -4,7 +4,7 @@ var net = require('net'); var events = require('events'); var stream = require('stream'); -var assert = process.assert; +var assert = require('assert').ok; var debug; if (process.env.NODE_DEBUG && /tls/.test(process.env.NODE_DEBUG)) { diff --git a/src/node.js b/src/node.js index 0012b40a9d9..0b87289572d 100644 --- a/src/node.js +++ b/src/node.js @@ -243,6 +243,7 @@ }; startup._removedProcessMethods = { + 'assert': 'process.assert() use require("assert").ok() instead', 'debug': 'process.debug() use console.error() instead', 'error': 'process.error() use console.error() instead', 'watchFile': 'process.watchFile() has moved to fs.watchFile()',