Browse Source

Fix node.js detection.

Herby Vojčík 5 years ago
parent
commit
8d6353966d
2 changed files with 3 additions and 3 deletions
  1. 2 2
      lang/src/Platform-Node.js
  2. 1 1
      lang/src/Platform-Node.st

+ 2 - 2
lang/src/Platform-Node.js

@@ -94,7 +94,7 @@ var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-return typeof global !== "undefined";
+return typeof process !== "undefined" && process && process.versions && process.versions.node;
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"isFeasible",{},$globals.NodePlatform.a$cls)});
@@ -102,7 +102,7 @@ return self;
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: [],
-source: "isFeasible\x0a<inlineJS: 'return typeof global !== \x22undefined\x22'>",
+source: "isFeasible\x0a<inlineJS: 'return typeof process !== \x22undefined\x22 && process && process.versions && process.versions.node'>",
 referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: []

+ 1 - 1
lang/src/Platform-Node.st

@@ -24,6 +24,6 @@ initialize
 !
 
 isFeasible
-<inlineJS: 'return typeof global !!== "undefined"'>
+<inlineJS: 'return typeof process !!== "undefined" && process && process.versions && process.versions.node'>
 ! !