Skip to content
Myr

Fixed readFile()

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Updated using new node API

authored by visionmedia · committed by visionmedia · parent 6271006 · Browse files · 5 files+13 added−16 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

5 files+13 added−16 removed

  • tests:+6 added−9 removed
  • other:+7 added−7 removed

5 files+13 added−16 removed

modified:lib/express.core.js+7 added-7 removed
397 unmodified lines
398 }399 },400 401 readFile : function(path, callback, errorCallback) {402 node.fs.cat(path, 'utf8', function(status, content){403 if (status < 0)404 if (errorCallback) errorCallback(status)405 else throw "failed to read file `" + path + "'"406 else 407 callback(content)408 })402 var promise = node.fs.cat(path, "utf8")403 var defaultErrorCallback = function() {404 throw "failed to read file `" + path + "'"405 }406 errorCallback = errorCallback || defaultErrorCallback407 promise.addCallback(callback)408 promise.addErrback(errorCallback)409 },410 411 display : function(path) {412 // TODO: parse / remove builder
39 unmodified lines
deleted:spec/spec.builder.js-7 removed
modified:spec/spec.dom.html+2 added
modified:spec/spec.rhino.js+2 added-2 removed
modified:spec/spec.server.html+2 added