Skip to content

Commit aa2708f

Browse files
committed
Prefer ChakraHost when available to node and WScript
1 parent ac6224d commit aa2708f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/compiler/sys.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -642,17 +642,17 @@ namespace ts {
642642
};
643643
}
644644

645-
if (typeof WScript !== "undefined" && typeof ActiveXObject === "function") {
645+
if (typeof ChakraHost !== "undefined") {
646+
return getChakraSystem();
647+
}
648+
else if (typeof WScript !== "undefined" && typeof ActiveXObject === "function") {
646649
return getWScriptSystem();
647650
}
648651
else if (typeof process !== "undefined" && process.nextTick && !process.browser && typeof require !== "undefined") {
649652
// process and process.nextTick checks if current environment is node-like
650653
// process.browser check excludes webpack and browserify
651654
return getNodeSystem();
652655
}
653-
else if (typeof ChakraHost !== "undefined") {
654-
return getChakraSystem();
655-
}
656656
else {
657657
return undefined; // Unsupported host
658658
}

0 commit comments

Comments
 (0)