Allow v8 to optimize fs.readFileSync
authorAntonio Scandurra <me@as-cii.com>
Fri, 30 Oct 2015 09:30:08 +0000 (10:30 +0100)
committerAntonio Scandurra <me@as-cii.com>
Fri, 30 Oct 2015 09:30:27 +0000 (10:30 +0100)
atom/common/lib/asar.coffee

index d2a7799fa69436c030e838f0b849fe5de7e0bc6a..e7f845bba9284db3d531aad39b5af28bae4a2cfe 100644 (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