Browse Source

Add wrapper functions to mirror old CoffeeScript

Kevin Sawicki 9 years ago
parent
commit
b547a38b3f
2 changed files with 4 additions and 0 deletions
  1. 2 0
      atom/common/lib/asar.js
  2. 2 0
      atom/common/lib/asar_init.js

+ 2 - 0
atom/common/lib/asar.js

@@ -1,3 +1,4 @@
+(function () {
 var asar, asarStatsToFsStats, cachedArchives, child_process, fakeTime, getOrCreateArchive, gid, invalidArchiveError, nextInode, notDirError, notFoundError, overrideAPI, overrideAPISync, path, splitPath, uid, util,
   hasProp = {}.hasOwnProperty;
 
@@ -606,3 +607,4 @@ exports.wrapFsWithAsar = function(fs) {
   overrideAPISync(fs, 'openSync');
   return overrideAPISync(child_process, 'execFileSync');
 };
+})()

+ 2 - 0
atom/common/lib/asar_init.js

@@ -1,3 +1,4 @@
+(function () {
 return function(process, require, asarSource) {
   var createArchive, source;
   createArchive = process.binding('atom_common_asar').createArchive;
@@ -13,3 +14,4 @@ return function(process, require, asarSource) {
   source['original-fs'] = source.fs;
   return source['fs'] = "var src = '(function (exports, require, module, __filename, __dirname) { ' +\n          process.binding('natives')['original-fs'] +\n          ' });';\nvar vm = require('vm');\nvar fn = vm.runInThisContext(src, { filename: 'fs.js' });\nfn(exports, require, module);\nvar asar = require('ATOM_SHELL_ASAR');\nasar.wrapFsWithAsar(exports);";
 };
+})()