Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update sys module to util for Node >= 0.5.

  • Loading branch information...
commit f2e67f392778e4438f46fe51ec2c00b5a6651333 1 parent 6d4f511
@doxavore doxavore authored
Showing with 18 additions and 18 deletions.
  1. +9 −9 jslint/node.coffee
  2. +9 −9 jslint/node.js
View
18 jslint/node.coffee
@@ -8,16 +8,16 @@
###
###jslint rhino: false, node: true, strict: false
###
-###global require,sys,__filename,process
+###global require,util,__filename,process
###
((args) ->
- sys = require 'sys'
+ util = require 'util'
fs = require 'fs'
path = require 'path'
print_syntax = () ->
- sys.puts 'Usage: jslint.js [options] file.js'
+ util.puts 'Usage: jslint.js [options] file.js'
process.exit 1
print_syntax() if args.length is 0
@@ -45,10 +45,10 @@
input_filename = arg
input = fs.readFileSync input_filename
if not input
- sys.puts "jslint: Couldn't open file '#{input_filename}'."
+ util.puts "jslint: Couldn't open file '#{input_filename}'."
process.exit 1
else
- # sys.debug('opening input');
+ # util.debug('opening input');
input = input.toString 'UTF8'
return
@@ -57,12 +57,12 @@
if not JSLINT input, options
JSLINT.errors.forEach (error) ->
if error
- sys.puts "Lint at line #{error.line} character #{error.character}: #{error.reason}"
- sys.puts (error.evidence or '').replace /^\s*(\S*(\s+\S+)*)\s*$/, "$1"
- sys.puts ''
+ util.puts "Lint at line #{error.line} character #{error.character}: #{error.reason}"
+ util.puts (error.evidence or '').replace /^\s*(\S*(\s+\S+)*)\s*$/, "$1"
+ util.puts ''
process.exit 2
else
- sys.puts "jslint: No problems found in #{input_filename}"
+ util.puts "jslint: No problems found in #{input_filename}"
process.exit 0
return
View
18 jslint/node.js
@@ -8,14 +8,14 @@
*/
/*jslint rhino: false, node: true, strict: false
*/
-/*global require,sys,__filename,process
+/*global require,util,__filename,process
*/(function(args) {
- var JSLINT, filename, fs, input, input_filename, options, path, print_syntax, sys;
- sys = require('sys');
+ var JSLINT, filename, fs, input, input_filename, options, path, print_syntax, util;
+ util = require('util');
fs = require('fs');
path = require('path');
print_syntax = function() {
- sys.puts('Usage: jslint.js [options] file.js');
+ util.puts('Usage: jslint.js [options] file.js');
return process.exit(1);
};
if (args.length === 0) {
@@ -51,7 +51,7 @@
input_filename = arg;
input = fs.readFileSync(input_filename);
if (!input) {
- sys.puts("jslint: Couldn't open file '" + input_filename + "'.");
+ util.puts("jslint: Couldn't open file '" + input_filename + "'.");
process.exit(1);
} else {
input = input.toString('UTF8');
@@ -64,14 +64,14 @@
if (!JSLINT(input, options)) {
JSLINT.errors.forEach(function(error) {
if (error) {
- sys.puts("Lint at line " + error.line + " character " + error.character + ": " + error.reason);
- sys.puts((error.evidence || '').replace(/^\s*(\S*(\s+\S+)*)\s*$/, "$1"));
- return sys.puts('');
+ util.puts("Lint at line " + error.line + " character " + error.character + ": " + error.reason);
+ util.puts((error.evidence || '').replace(/^\s*(\S*(\s+\S+)*)\s*$/, "$1"));
+ return util.puts('');
}
});
process.exit(2);
} else {
- sys.puts("jslint: No problems found in " + input_filename);
+ util.puts("jslint: No problems found in " + input_filename);
process.exit(0);
}
})(process.argv.slice(2));
Please sign in to comment.
Something went wrong with that request. Please try again.