Allow v8 to optimize fs.readFileSync

This commit is contained in:
Antonio Scandurra 2015-10-30 10:30:08 +01:00
parent 21a7c459d8
commit 9c69877421

View file

@ -254,7 +254,8 @@ exports.wrapFsWithAsar = (fs) ->
openSync = fs.openSync
readFileSync = fs.readFileSync
fs.readFileSync = (p, options) ->
fs.readFileSync = (p, opts) ->
options = opts # this allows v8 to optimize this function
[isAsar, asarPath, filePath] = splitPath p
return readFileSync.apply this, arguments unless isAsar