summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRyan <ry@tinyclouds.org>2009-07-20 21:07:34 +0200
committerRyan <ry@tinyclouds.org>2009-07-20 21:09:37 +0200
commite8a5d3d31141cca1bda02acd579da5a6eb5e4a44 (patch)
treea27770dc2cd84fefb8678ba36c098fa896908983 /src
parentb07dc31e1bbf93a098ce3e2422553b706a833fbf (diff)
downloadnodejs-e8a5d3d31141cca1bda02acd579da5a6eb5e4a44.tar.gz
nodejs-e8a5d3d31141cca1bda02acd579da5a6eb5e4a44.tar.bz2
nodejs-e8a5d3d31141cca1bda02acd579da5a6eb5e4a44.zip
remove the callback from node.cat, node.fs.cat
Diffstat (limited to 'src')
-rw-r--r--src/file.js4
-rw-r--r--src/util.js4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/file.js b/src/file.js
index c36c6aa00..42edb7374 100644
--- a/src/file.js
+++ b/src/file.js
@@ -4,7 +4,7 @@ node.fs.exists = function (path, callback) {
p.addErrback(function () { callback(false); });
}
-node.fs.cat = function (path, encoding, callback) {
+node.fs.cat = function (path, encoding) {
var open_promise = node.fs.open(path, node.O_RDONLY, 0666);
var cat_promise = new node.Promise();
@@ -12,7 +12,7 @@ node.fs.cat = function (path, encoding, callback) {
open_promise.addErrback(function () { cat_promise.emitError(); });
open_promise.addCallback(function (fd) {
- var content = (encoding == node.UTF8 ? "" : []);
+ var content = (encoding === node.UTF8 ? "" : []);
var pos = 0;
function readChunk () {
diff --git a/src/util.js b/src/util.js
index da1666a46..6d45dedfb 100644
--- a/src/util.js
+++ b/src/util.js
@@ -24,10 +24,10 @@ node.encodeUtf8 = function (array) {
return String.fromCharCode.apply(String, array);
};
-node.cat = function(location, encoding, callback) {
+node.cat = function(location, encoding) {
var url_re = new RegExp("^http:\/\/");
var f = url_re.exec(location) ? node.http.cat : node.fs.cat;
- return f(location, encoding, callback);
+ return f(location, encoding);
};
node.path = new function () {