From 983027b27f4f26e75eff04e599257c780574ef5f Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 17 Feb 2015 16:50:03 -0800 Subject: [PATCH] :racehorse: inline vm compatibility patch --- package.json | 3 +-- static/index.js | 9 +++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 352c1693c..4fe7e960b 100644 --- a/package.json +++ b/package.json @@ -66,8 +66,7 @@ "temp": "0.8.1", "text-buffer": "^4.1.5", "theorist": "^1.0.2", - "underscore-plus": "^1.6.6", - "vm-compatibility-layer": "0.1.0" + "underscore-plus": "^1.6.6" }, "packageDependencies": { "atom-dark-syntax": "0.26.0", diff --git a/static/index.js b/static/index.js index fb56a84bd..bd9fbe9a0 100644 --- a/static/index.js +++ b/static/index.js @@ -44,8 +44,7 @@ window.onload = function() { extra: {_version: loadSettings.appVersion} }); - require('vm-compatibility-layer'); - + setupVmCompatibility(); setupCsonCache(cacheDir); setupSourceMapCache(cacheDir); setup6to5(cacheDir); @@ -104,3 +103,9 @@ var setupCsonCache = function(cacheDir) { var setupSourceMapCache = function(cacheDir) { require('coffeestack').setCacheDirectory(path.join(cacheDir, 'coffee', 'source-maps')); } + +var setupVmCompatibility = function() { + var vm = require('vm'); + if (!vm.Script.createContext) + vm.Script.createContext = vm.createContext; +}