Fixing #1774 about issues when running node with --harmony_block_scoping v8 option
Fixes #1837.
This commit is contained in:
parent
fcad5e35fd
commit
10f97f9424
@ -412,7 +412,7 @@ fs.readlinkSync = function(path) {
|
|||||||
fs.symlink = function(destination, path, mode_, callback) {
|
fs.symlink = function(destination, path, mode_, callback) {
|
||||||
var mode = (typeof(mode_) == 'string' ? mode_ : null);
|
var mode = (typeof(mode_) == 'string' ? mode_ : null);
|
||||||
var callback_ = arguments[arguments.length - 1];
|
var callback_ = arguments[arguments.length - 1];
|
||||||
var callback = (typeof(callback_) == 'function' ? callback_ : null);
|
callback = (typeof(callback_) == 'function' ? callback_ : null);
|
||||||
binding.symlink(destination, path, mode, callback);
|
binding.symlink(destination, path, mode, callback);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -564,7 +564,7 @@ function writeAll(fd, buffer, offset, length, callback) {
|
|||||||
fs.writeFile = function(path, data, encoding_, callback) {
|
fs.writeFile = function(path, data, encoding_, callback) {
|
||||||
var encoding = (typeof(encoding_) == 'string' ? encoding_ : 'utf8');
|
var encoding = (typeof(encoding_) == 'string' ? encoding_ : 'utf8');
|
||||||
var callback_ = arguments[arguments.length - 1];
|
var callback_ = arguments[arguments.length - 1];
|
||||||
var callback = (typeof(callback_) == 'function' ? callback_ : null);
|
callback = (typeof(callback_) == 'function' ? callback_ : null);
|
||||||
fs.open(path, 'w', 0666, function(openErr, fd) {
|
fs.open(path, 'w', 0666, function(openErr, fd) {
|
||||||
if (openErr) {
|
if (openErr) {
|
||||||
if (callback) callback(openErr);
|
if (callback) callback(openErr);
|
||||||
@ -747,7 +747,7 @@ if (isWindows) {
|
|||||||
|
|
||||||
// windows version
|
// windows version
|
||||||
fs.realpathSync = function realpathSync(p, cache) {
|
fs.realpathSync = function realpathSync(p, cache) {
|
||||||
var p = path.resolve(p);
|
p = path.resolve(p);
|
||||||
if (cache && Object.prototype.hasOwnProperty.call(cache, p)) {
|
if (cache && Object.prototype.hasOwnProperty.call(cache, p)) {
|
||||||
return cache[p];
|
return cache[p];
|
||||||
}
|
}
|
||||||
@ -762,7 +762,7 @@ if (isWindows) {
|
|||||||
cb = cache;
|
cb = cache;
|
||||||
cache = null;
|
cache = null;
|
||||||
}
|
}
|
||||||
var p = path.resolve(p);
|
p = path.resolve(p);
|
||||||
if (cache && Object.prototype.hasOwnProperty.call(cache, p)) {
|
if (cache && Object.prototype.hasOwnProperty.call(cache, p)) {
|
||||||
return cb(null, cache[p]);
|
return cb(null, cache[p]);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user