mirror of
https://github.com/nodejs/node.git
synced 2026-10-14 10:26:26 -04:00
lib: turn on strict mode
Turn on strict mode for the files in the lib/ directory. It helps catch bugs and can have a positive effect on performance. PR-URL: https://github.com/node-forward/node/pull/64 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Fedor Indutny <fedor@indutny.com>
This commit is contained in:
1 parent
963f5e8a88
commit
21130c7d6f
52 files changed
+110
-9
No files matched your search
+4
-2
@@ -19,6 +19,8 @@
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||||
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
'use strict';
|
||||
|
||||
var util = require('util');
|
||||
|
||||
function Console(stdout, stderr) {
|
||||
@@ -89,13 +91,13 @@ Console.prototype.timeEnd = function(label) {
|
||||
};
|
||||
|
||||
|
||||
Console.prototype.trace = function() {
|
||||
Console.prototype.trace = function trace() {
|
||||
// TODO probably can to do this better with V8's debug object once that is
|
||||
// exposed.
|
||||
var err = new Error;
|
||||
err.name = 'Trace';
|
||||
err.message = util.format.apply(this, arguments);
|
||||
Error.captureStackTrace(err, arguments.callee);
|
||||
Error.captureStackTrace(err, trace);
|
||||
this.error(err.stack);
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user