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

ES6 refactoring #356

Merged
merged 7 commits into from Feb 17, 2017
Merged

ES6 refactoring #356

merged 7 commits into from Feb 17, 2017

Conversation

JPeer264
Copy link
Collaborator

@JPeer264 JPeer264 commented Feb 14, 2017

I refactored some files to ES6 according to #355 . Much things are not available in Node v4.

'use strict' is a must in Node v4 if let is used. For consistency I also put it although no let is used.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.02%) to 85.121% when pulling 01c96fe on JPeer264:feature/refactor-es6 into 108b88a on jprichardson:master.

@RyanZim
Copy link
Collaborator

RyanZim commented Feb 17, 2017

'use strict' isn't required for let in Node 4 (http://node.green/#let), but it's a good practice anyway.

@RyanZim RyanZim merged commit 082342e into jprichardson:master Feb 17, 2017
@RyanZim
Copy link
Collaborator

RyanZim commented Feb 17, 2017

@JPeer264 Thanks for doing this!

If you feel like refactoring other parts (including tests), you are more than welcome to. 😸

@JPeer264
Copy link
Collaborator Author

'use strict' isn't required for let in Node 4 (http://node.green/#let), but it's a good practice anyway.

@RyanZim I read this too but my shell output told me something else. Also it is just with let:

let mkdir = require('../mkdirs')
^^^

SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
    ...

Thanks. I will first finish all other parts (including README) and start with all tests, if that is ok 👍

@RyanZim
Copy link
Collaborator

RyanZim commented Feb 17, 2017

my shell output told me something else

Strange. My test:

$ node -v
v4.5.0
$ node
> let a = 4
undefined
> a
4

All files should be in strict mode anyhow, so don't worry about it.

@JPeer264
Copy link
Collaborator Author

JPeer264 commented Feb 17, 2017

In the shell directly it works fine for me as well. But not if you run it from a file:

$ node -v
v4.7.3
$ echo "let a = 1" >> foo.js && node foo.js

@RyanZim
Copy link
Collaborator

RyanZim commented Feb 17, 2017

Huh, never knew that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants