From aa2708f5107a8ff011e2a8dbfc6556182b5eee1c Mon Sep 17 00:00:00 2001 From: mihailik Date: Sun, 10 Apr 2016 12:07:47 +0100 Subject: [PATCH] Prefer ChakraHost when available to node and WScript --- src/compiler/sys.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/compiler/sys.ts b/src/compiler/sys.ts index 7ee012c6cf0..c391560befd 100644 --- a/src/compiler/sys.ts +++ b/src/compiler/sys.ts @@ -642,7 +642,10 @@ namespace ts { }; } - if (typeof WScript !== "undefined" && typeof ActiveXObject === "function") { + if (typeof ChakraHost !== "undefined") { + return getChakraSystem(); + } + else if (typeof WScript !== "undefined" && typeof ActiveXObject === "function") { return getWScriptSystem(); } else if (typeof process !== "undefined" && process.nextTick && !process.browser && typeof require !== "undefined") { @@ -650,9 +653,6 @@ namespace ts { // process.browser check excludes webpack and browserify return getNodeSystem(); } - else if (typeof ChakraHost !== "undefined") { - return getChakraSystem(); - } else { return undefined; // Unsupported host }