Skip to content

Use var to fix SyntaxError on Node@4#1988

Merged
vjeux merged 1 commit intoprettier:masterfrom
cvbuelow:fix/node-error
Jun 6, 2017
Merged

Use var to fix SyntaxError on Node@4#1988
vjeux merged 1 commit intoprettier:masterfrom
cvbuelow:fix/node-error

Conversation

@cvbuelow
Copy link
Copy Markdown
Contributor

@cvbuelow cvbuelow commented Jun 5, 2017

Closes #1986

I think ideally this should be addressed in uglify-es but this is more expedient.

@azz
Copy link
Copy Markdown
Member

azz commented Jun 5, 2017

Did you try "use strict" at the top of the parse function?

@cvbuelow
Copy link
Copy Markdown
Contributor Author

cvbuelow commented Jun 5, 2017

Yes, that did not make a difference.

@cvbuelow
Copy link
Copy Markdown
Contributor Author

cvbuelow commented Jun 5, 2017

That file actually already has "use strict" in it but looks like the build is stripping it out. When I tried changing the build to leave it in I got TypeError: Cannot read property 'RangeError' of undefined. Did not debug further after that.

@cvbuelow
Copy link
Copy Markdown
Contributor Author

cvbuelow commented Jun 6, 2017

@azz sorry, I misunderstood what you meant earlier, your suggestion worked after all 👍

@vjeux
Copy link
Copy Markdown
Contributor

vjeux commented Jun 6, 2017

Yeah, the ocaml -> javascript version of flow doesn't work in strict mode for some reason. Thanks for the fix!

@vjeux vjeux merged commit 19bd2a3 into prettier:master Jun 6, 2017
@cvbuelow cvbuelow deleted the fix/node-error branch June 6, 2017 13:02
vjeux added a commit that referenced this pull request Jun 7, 2017
* Fix support for node 4 (#1988)
* Fix website on iOS Safari (#1970)

Formatting change:
* Position JSX whitespace (`{" "}`) at the end of lines (#1964)

Lots of small fixes, mainly for TypeScript.
@lock lock Bot added the locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. label Jan 20, 2019
@lock lock Bot locked as resolved and limited conversation to collaborators Jan 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants