Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed linter on windows machines #22

Merged
merged 2 commits into from
Jul 23, 2015
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/helpers.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ module.exports = Helpers =
else
resolve(data.stderr.join(''))
if isNodeExecutable
spawnedProcess = new BufferedNodeProcess({command, args, stdout, stderr, exit})
options.env = JSON.parse(JSON.stringify(process.env))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about options.env ?= Object.create(process.env)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw that in the bufferedNodeProcess code, but for some reason, Object.create(process.env) returns an empty object when I use it here.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't return an empty object, it just moves stuff to the prototype. You might not see it in the debugger at top level but it's still there.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow can't believe I didn't know that... So I looked more into Object.create and an interesting thing about it is that the properties created are not writable, enumerable or configurable by default

delete options.env.OS
spawnedProcess = new BufferedNodeProcess({command, args, options, stdout, stderr, exit})
else
spawnedProcess = new BufferedProcess({command, args, stdout, stderr, exit})
spawnedProcess.onWillThrowError(reject)
Expand Down