Skip to content

Commit 1cccfd1

Browse files
committed
fix Node.js v4 syntax problem
1 parent c938fde commit 1cccfd1

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

index.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function findRuntimePath() {
4242
if ((upPkg.pkg.dependencies && upPkg.pkg.dependencies['node-red'])
4343
|| (upPkg.pkg.devDependencies && upPkg.pkg.devDependencies['node-red'])) {
4444
const dirpath = path.join(path.dirname(upPkg.path), 'node_modules', 'node-red');
45-
try {
45+
try {
4646
const pkg = require(path.join(dirpath, 'package.json'));
4747
return path.join(dirpath, pkg.main);
4848
} catch (ignored) {}
@@ -52,12 +52,12 @@ function findRuntimePath() {
5252
class NodeTestHelper extends EventEmitter {
5353
constructor() {
5454
super();
55-
55+
5656
this._sandbox = sinon.createSandbox();
57-
57+
5858
this._address = '127.0.0.1';
5959
this._listenPort = 0; // ephemeral
60-
60+
6161
this.init();
6262
}
6363

@@ -97,7 +97,8 @@ class NodeTestHelper extends EventEmitter {
9797
}
9898
}
9999

100-
init(runtimePath = findRuntimePath()) {
100+
init(runtimePath) {
101+
runtimePath = runtimePath || findRuntimePath();
101102
if (runtimePath) {
102103
this._initRuntime(runtimePath);
103104
}

0 commit comments

Comments
 (0)