Utility method for detecting ES module syntax#69
Utility method for detecting ES module syntax#69GeoffreyBooth wants to merge 1 commit intonodejs:modules-lkgrfrom
Conversation
|
With a quick audit I noticed that we have a somewhat similar lower level function currently in assert called Perhaps we can move that into an internal util function and share the use of acorn between the two places in the code base? I'm going to be honest that I'm not super thrilled about using acorn more in core... and there might be similar push back upstream. |
|
I understand the hesitance to further dependence on Acorn, but the alternative would be to reimplement Acorn’s token parsing, which is even less appealing. I looked at I guess the question is, do you ever see a day when Node refactors out its dependence on Acorn? Because if so, then yes, we should avoid adding more things to Node core that depend on it; but if not, then depending on a library that’s already in core doesn’t really come at any cost. Besides |
45954e1 to
f68af55
Compare
|
Update: @MylesBorins and I spoke offline and we’re not sure if core will object to further dependencies on Acorn, but based on no objections being raised to nodejs/node#27400 we think it’s worth submitting this to core and seeing if that comes up. Especially since the current implementation of this PR isn’t used by Node core anywhere (since it’s no longer coupled with the now-defunct |
b635988 to
1ffb68c
Compare
1ffb68c to
695d780
Compare
|
Upstream PR: nodejs/node#27808 |
Per #68 (comment)