mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
Allow v8 to optimize fs.readFileSync
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user