Skip to content

Commit

Permalink
Merge pull request #351 from Gerhut/patch-1
Browse files Browse the repository at this point in the history
Fix redundancy of process dependence.
  • Loading branch information
matthewp authored Jan 19, 2018
2 parents 9052918 + a718bbb commit 0d50d06
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,9 @@
/**
* Handle "click" events.
*/

/* jshint -W054 */
var hasProcess = new Function('return typeof process')() !== 'undefined';
/* jshint +W054 */
function onclick(e) {
if (1 !== which(e)) return;

Expand Down Expand Up @@ -650,7 +652,7 @@
path = path[0] !== '/' ? '/' + path : path;

// strip leading "/[drive letter]:" on NW.js on Windows
if (typeof process !== 'undefined' && path.match(/^\/[a-zA-Z]:\//)) {
if (hasProcess && path.match(/^\/[a-zA-Z]:\//)) {
path = path.replace(/^\/[a-zA-Z]:\//, '/');
}

Expand Down

0 comments on commit 0d50d06

Please sign in to comment.