-
Notifications
You must be signed in to change notification settings - Fork 41
Use acorn for JS parsing #20
Conversation
This allows electron-link to handle code with ecmaScipt 9th edition features.
|
Edit: There's an error when using this modified version 😟 Don't know why the whole |
smashwilson
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One nit, then this should be good to go.
Co-Authored-By: rafeca <[email protected]>
as-cii
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! 💯
By default, `recast` sets it to `module` (even if `acorn` has it set as `script`). This causes parsing issues since all files are treated in strict mode.
|
The previous This caused issues with some non-strict JS files that were parsed as strict and lead to syntax errors. |
When trying to land an upgrade of the
markdown-previewpackage, we realized thatelectron-linkdoes not support some modern JS syntax features. This was due to theesprimaparser which is quite old.To solve this, I've changed the
esprimaconfiguration to useacornas a parser, specifying that we want to support the 9th edition syntax features.Verification process
electron-linkversion used in ⬆️ [email protected] atom#19209 and check that the build passes