From b547a38b3f4500432e38741dae1db4dc98f7dcb0 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 11 Jan 2016 17:39:11 -0800 Subject: [PATCH] Add wrapper functions to mirror old CoffeeScript --- atom/common/lib/asar.js | 2 ++ atom/common/lib/asar_init.js | 2 ++ 2 files changed, 4 insertions(+) diff --git a/atom/common/lib/asar.js b/atom/common/lib/asar.js index 60e4c5c69f8c..158d50da18be 100644 --- a/atom/common/lib/asar.js +++ b/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'); }; +})() diff --git a/atom/common/lib/asar_init.js b/atom/common/lib/asar_init.js index 51d438c2c001..0379865acf33 100644 --- a/atom/common/lib/asar_init.js +++ b/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);"; }; +})()