From db4eec3e2acce201e596d6ddedca5f9742bf0470 Mon Sep 17 00:00:00 2001 From: Ivo Julca Date: Thu, 21 May 2015 18:10:01 -0500 Subject: [PATCH] Fix support for Node 0.12 Update the detection of legacy engines, as Node 0.12 has native Map support enabled by default --- app.js | 4 ++-- battle-engine.js | 2 +- team-validator.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app.js b/app.js index c728110cc3..d2f4c05963 100644 --- a/app.js +++ b/app.js @@ -56,7 +56,7 @@ function runNpm(command) { process.exit(0); } -var isLegacyEngine = !global.Map; +var isLegacyEngine = !(''.includes); var fs = require('fs'); var path = require('path'); @@ -66,7 +66,7 @@ try { } catch (e) { runNpm('install --production'); } -if (isLegacyEngine && !new Map().set()) { +if (isLegacyEngine && !(''.includes)) { runNpm('update --production'); } diff --git a/battle-engine.js b/battle-engine.js index 61bc08a703..62310aebf6 100644 --- a/battle-engine.js +++ b/battle-engine.js @@ -11,7 +11,7 @@ */ require('sugar'); -if (!global.Map) require('es6-shim'); +if (!''.includes) require('es6-shim'); global.Config = require('./config/config.js'); diff --git a/team-validator.js b/team-validator.js index bb36703c66..0fe3612a58 100644 --- a/team-validator.js +++ b/team-validator.js @@ -100,7 +100,7 @@ if (!process.send) { }; } else { require('sugar'); - if (!global.Map) require('es6-shim'); + if (!''.includes) require('es6-shim'); global.Config = require('./config/config.js'); if (Config.crashguard) {