Permalink
Browse files

Replace sys.puts with console.log, sys module is removed from node co…

…re starting v0.7.0 .
  • Loading branch information...
1 parent 9971515 commit 66bba72ff2ed3fb66be9a7622394f249ddd64cc2 @cliffano cliffano committed Jan 18, 2012
View
@@ -49,7 +49,6 @@ result. e.g. here we simulate a blocking operation using setTimeout().
// sum.js
- var sys = require("sys");
var jazz = require("jazz");
var params = {
@@ -59,7 +58,7 @@ result. e.g. here we simulate a blocking operation using setTimeout().
}, 2000);
}
}
- jazz.compile("sum.jazz").eval(params, function(output) { sys.puts(output); });
+ jazz.compile("sum.jazz").eval(params, function(output) { console.log(output); });
Note that even though the execution of the callback is delayed, this example still
works.
View
@@ -1,5 +1,4 @@
var jazz = require("../lib/jazz");
-var sys = require("sys");
var fs = require("fs");
var data = fs.readFileSync(__dirname + "/filter.jazz", "utf8");
@@ -9,7 +8,7 @@ template.eval({
cb(s.replace(/</g, '&lt;').replace(/>/g, '&gt;'));
},
"value": "<foo!>"
-}, function(data) { sys.puts(data); });
+}, function(data) { console.log(data); });
View
@@ -1,7 +1,6 @@
var jazz = require("../lib/jazz");
-var sys = require("sys");
var fs = require("fs");
var data = fs.readFileSync(__dirname + "/foreach.jazz", "utf8");
var template = jazz.compile(data);
-template.eval({"people": ["Tom", "Danny", "Steve"]}, function(data) { sys.puts(data); });
+template.eval({"people": ["Tom", "Danny", "Steve"]}, function(data) { console.log(data); });
@@ -1,11 +1,10 @@
var jazz = require("../lib/jazz");
-var sys = require("sys");
var fs = require("fs");
var data = fs.readFileSync(__dirname + "/foreach_object.jazz", "utf8");
var template = jazz.compile(data);
template.eval({"doc": {
"title": "First",
"content": "Some content"
-}}, function(data) { sys.puts(data); });
+}}, function(data) { console.log(data); });
View
@@ -1,8 +1,7 @@
var jazz = require("../lib/jazz");
-var sys = require("sys");
var fs = require("fs");
var data = fs.readFileSync(__dirname + "/getattr.jazz", "utf8");
var template = jazz.compile(data);
-template.eval({"user": {"email_addresses": ["bob@foo.com", "bleh@blah.com"]}}, function(data) { sys.puts(data); });
+template.eval({"user": {"email_addresses": ["bob@foo.com", "bleh@blah.com"]}}, function(data) { console.log(data); });
View
@@ -1,14 +1,13 @@
var jazz = require("../lib/jazz");
-var sys = require("sys");
var fs = require("fs");
var data = fs.readFileSync(__dirname + "/html.jazz", "utf8");
var template = jazz.compile(data);
-template.eval({"username": ""}, function(data) { sys.puts(data); });
+template.eval({"username": ""}, function(data) { console.log(data); });
template.eval({
"errors": ["Invalid username", "Please try again"],
"username": "bert"
-}, function(data) { sys.puts(data); });
+}, function(data) { console.log(data); });
View
@@ -1,5 +1,4 @@
var jazz = require("../lib/jazz");
-var sys = require("sys");
var fs = require("fs");
var data = fs.readFileSync(__dirname + "/ifelse.jazz", "utf8");
@@ -11,11 +10,11 @@ var template = jazz.compile(data);
template.eval({
"firstVar": "MONKEYS!"
-}, function(data) { sys.print(data); });
+}, function(data) { console.log(data); });
template.eval({
"secondVar": "GIBBONS!"
-}, function(data) { sys.print(data); });
+}, function(data) { console.log(data); });
-template.eval({}, function(data) { sys.print(data); });
+template.eval({}, function(data) { console.log(data); });
View
@@ -1,5 +1,4 @@
var jazz = require("../lib/jazz");
-var sys = require("sys");
var fs = require("fs");
var data = fs.readFileSync(__dirname + "/include_main.jazz", "utf8");
@@ -11,5 +10,5 @@ var params = {
}
};
-template.eval(params, function(data) { sys.puts(data); });
+template.eval(params, function(data) { console.log(data); });
View
@@ -1,5 +1,4 @@
var jazz = require("../lib/jazz");
-var sys = require("sys");
var fs = require("fs");
var data = fs.readFileSync(__dirname + "/letter.jazz", "utf8");
@@ -9,4 +8,4 @@ template.eval({
"friendly":true,
"amount":"200.00",
"company": "Gimme, Inc."
-}, function(data) { sys.puts(data); });
+}, function(data) { console.log(data); });
View
@@ -1,9 +1,8 @@
var jazz = require("../lib/jazz");
-var sys = require("sys");
var fs = require("fs");
var data = fs.readFileSync(__dirname + "/simple.jazz", "utf8");
var template = jazz.compile(data);
-template.eval({}, function(data) { sys.puts(data); });
+template.eval({}, function(data) { console.log(data); });
View
@@ -3,7 +3,6 @@
* Copyright (c) 2010 Shine Technologies
*/
-var sys = require("sys");
var scanner = require("./jazz/scanner");
var parser = require("./jazz/parser");
var compiler = require("./jazz/compiler");
@@ -3,7 +3,6 @@
* Copyright (C) 2010 Shine Technologies
*/
-var sys = require("sys");
var tokens = require("./tokens");
var ast = require("./ast");
var events = require("events");
@@ -122,7 +121,7 @@ Compiler_JS.prototype.compile = function(ast) {
var code = this._prologue(ast.globals);
code += this._compileSuite(ast.root);
code += this._epilogue();
- if (this.debug) sys.puts(code);
+ if (this.debug) console.log(code);
return new Program(eval(code), ast.globals);
}
View
@@ -3,7 +3,6 @@
* Copyright (C) 2010 Shine Technologies
*/
-var sys = require("sys");
var tokens = require("./tokens");
var ast = require("./ast");
var scanner = require("./scanner");
@@ -39,7 +38,7 @@ Parser.prototype.parse = function() {
this.next(); // read first token
var suite = this._parseSuite();
this._check(tokens.EOF);
- if (this.debug) sys.puts(suite.toString());
+ if (this.debug) console.log(suite.toString());
return new ast.AST(suite, this.globals);
}
View
@@ -1,8 +1,7 @@
var assert = require("assert");
var jazz = require("../lib/jazz");
-var sys = require("sys");
-sys.puts("Running tests ...");
+console.log("Running tests ...");
function Muffin(numberOfBites) {
this._numberOfBites = numberOfBites;
@@ -205,5 +204,5 @@ testCases.forEach(function(testCase) {
});
process.on('exit', function() {
- sys.puts("OK!");
+ console.log("OK!");
});

0 comments on commit 66bba72

Please sign in to comment.