Comparing version 3.8.0 to 3.8.1
@@ -84,3 +84,3 @@ 'use strict'; | ||
if (runtime && hostOptions.shortName) { | ||
if (runtime) { | ||
let ast = recast.parse(runtime); | ||
@@ -95,7 +95,10 @@ | ||
// Replace $ in runtime source | ||
if (node.value.type === "Identifier" && | ||
node.value.name === "$") { | ||
node.value.name = hostOptions.shortName; | ||
if (hostOptions.shortName) { | ||
// Replace $ in runtime source | ||
if (node.value.type === "Identifier" && | ||
node.value.name === "$") { | ||
node.value.name = hostOptions.shortName; | ||
} | ||
} | ||
this.traverse(node); | ||
@@ -136,2 +139,3 @@ } | ||
/* This is not the agent you're looking for */ | ||
const name = 'ConsoleAgent'; | ||
`; | ||
@@ -138,0 +142,0 @@ |
{ | ||
"name": "eshost", | ||
"version": "3.8.0", | ||
"version": "3.8.1", | ||
"description": "Invoke ECMAScript scripts in any command line JS engine.", | ||
@@ -5,0 +5,0 @@ "main": "lib/eshost.js", |
@@ -69,3 +69,3 @@ 'use strict'; | ||
assert.equal(compiled, `${ConsoleAgent.runtime}${program}`.replace(/\r?\n/g, '')); | ||
assert.equal(compiled, ` const name = 'ConsoleAgent';${program}`.replace(/\r?\n/g, '')); | ||
}); | ||
@@ -72,0 +72,0 @@ }); |
@@ -7,2 +7,3 @@ 'use strict'; | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
@@ -34,2 +35,17 @@ const isWindows = process.platform === 'win32' || | ||
// console.log(`isWindows: ${isWindows}`); | ||
if (isWindows) { | ||
hosts.forEach(record => { | ||
if (record[1].hostPath) { | ||
record[1].hostPath += '.exe'; | ||
const ESHOST_ENV_NAME = `ESHOST_${record[0].toUpperCase()}_PATH`; | ||
console.log(`ESHOST_ENV_NAME: ${ESHOST_ENV_NAME}`); | ||
if (process.env[ESHOST_ENV_NAME]) { | ||
record[1].hostPath = path.join(process.env[ESHOST_ENV_NAME], record[1].hostPath); | ||
} | ||
} | ||
}); | ||
} | ||
const timeout = function(ms) { | ||
@@ -46,9 +62,8 @@ return new Promise(res => { | ||
options.capabilities.browserName : type; | ||
if (options.hostPath && isWindows) { | ||
options.hostPath += '.exe'; | ||
} | ||
const isSkipped = process.env[`ESHOST_SKIP_${effectiveType.toUpperCase()}`]; | ||
console.log(`ESHOST_SKIP_${effectiveType.toUpperCase()} isSkipped ${isSkipped}`); | ||
if (options.hostPath && | ||
(!hasbin.sync(options.hostPath) && !fs.existsSync(options.hostPath))) { | ||
console.error('Unable to run tests - host not found: ' + options.hostPath); | ||
if (!isSkipped && | ||
(options.hostPath && (!hasbin.sync(options.hostPath) && !fs.existsSync(options.hostPath)))) { | ||
console.error(`Unable to run tests - host not found: ${options.hostPath}`); | ||
} | ||
@@ -60,3 +75,3 @@ | ||
before(function() { | ||
if (process.env['ESHOST_SKIP_' + type.toUpperCase()]) { | ||
if (isSkipped) { | ||
this.skip(); | ||
@@ -63,0 +78,0 @@ return; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
84901
44
2013
24