Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Detect for 'util', and use it if it's there. Otherwise fall back to '…

…sys'.

This is the recommended check by isaacs.
  • Loading branch information...
commit 8006e18cf64642dd97bf37c395915de105d511d3 1 parent 2415405
@TooTallNate TooTallNate authored
Showing with 4 additions and 5 deletions.
  1. +2 −2 lib/wheat/data.js
  2. +2 −3 lib/wheat/tools.js
View
4 lib/wheat/data.js
@@ -1,7 +1,7 @@
var Git = require('git-fs'),
Path = require('path'),
Step = require('step'),
- sys = require('sys'),
+ util = require(process.binding('natives').util ? 'util' : 'sys'),
Script = process.binding('evals').Script,
QueryString = require('querystring');
@@ -78,7 +78,7 @@ function sandbox(snippet) {
},
dir: function fakeP(data) {
arguments.forEach(function (data) {
- snippet.output += sys.inspect(data) + "\n";
+ snippet.output += util.inspect(data) + "\n";
});
}
} };
View
5 lib/wheat/tools.js
@@ -1,5 +1,4 @@
-var Sys = require('sys'),
- Step = require('step'),
+var Step = require('step'),
Haml = require('haml'),
Markdown = require('./markdown'),
MD5 = require('./md5'),
@@ -36,7 +35,7 @@ var aMonths = new Array("Jan", "Feb", "Mar", "Apr", "May", "Jun",
var aDays = new Array( "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat");
var Helpers = {
- inspect: Sys.inspect,
+ inspect: require(process.binding('natives').util ? 'util' : 'sys').inspect,
intro: function intro(markdown) {
var html = Markdown.encode(markdown);
return html.substr(0, html.indexOf("<h2"));
Please sign in to comment.
Something went wrong with that request. Please try again.