Skip to content

Commit

Permalink
Don't rely process.env.hasOwnProperty as in Node <0.9.0 versions it d…
Browse files Browse the repository at this point in the history
…oesn't work like a proper JS object.

```
$ node -v
v0.8.28
$ node
> typeof process.env
'object'
> typeof process.env.hasOwnProperty
'undefined'
```

See: nodejs/node-v0.x-archive#3521
  • Loading branch information
rochoa committed Sep 24, 2014
1 parent a897fd2 commit b354251
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/mapnik.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ exports.register_system_fonts = function() {
(process.platform.indexOf('bsd') != -1)) {
dirs.push('/usr/share/fonts/');
dirs.push('/usr/local/share/fonts/');
if (process.env.hasOwnProperty('HOME')) dirs.push(path.join(process.env.HOME, '.fonts'));
if (process.env.HOME) dirs.push(path.join(process.env.HOME, '.fonts'));
} else if (process.platform === 'darwin') {
dirs.push('/Library/Fonts');
dirs.push('/System/Library/Fonts');
if (process.env.hasOwnProperty('HOME')) dirs.push(path.join(process.env.HOME, 'Library/Fonts'));
if (process.env.HOME) dirs.push(path.join(process.env.HOME, 'Library/Fonts'));
} else if (process.platform === 'win32') {
dirs.push('C:\\Windows\\Fonts');
}
Expand Down

0 comments on commit b354251

Please sign in to comment.