William C. Johnson
William C. Johnson
Yup, found it: https://github.com/babel/babel/blob/8a82cc060ae0ab46bf52e05e592de770bd246f6f/packages/babel-types/src/validators.js#L35 Babel doesn't consider the case of `parent.type === "ObjectTypeProperty"` when checking to determine if a node is referenced or not.
Workaround here: https://github.com/wcjohnson/babel-plugin-lightscript/commit/4dff8337882c6309848420f02b239f757cdf39c4
Possible fix here: https://github.com/wcjohnson/babylon-lightscript/commit/7e6678c4fcf6b431cf0b855995d6ba2110cc5332
I am indeed still maintaining my fork of the project, as it is used in production. The latest version is 4.0.0-alpha.34: https://www.npmjs.com/package/@lightscript/babel-preset A minimal Node app with all the tooling/setup...
Fixed at: https://github.com/wcjohnson/babylon-lightscript/commit/4d2a8ac3a4a28d44c565c38c2f61465b414a4b8e Not a Babylon bug; only happens with lsc plugin enabled. Caused by the speculative parsing of `NamedArrowFunction`s -- the speculative parsing pathway actually mutates the `node` being...
Fixed, implementing your suggestion, at: https://github.com/wcjohnson/babel-plugin-lightscript/commit/91592ad542e49f19aa8842a6d37fdf2ee20e5409
Apparently I fixed this at some point in my 2.x branch, because it's not an issue with `compiler: latest`: [lscdiag](https://wcjohnson.github.io/lscdiag/?v=1&s=eMOafVDDi07DgzAQw7wVw4snUMKDwpQ0FMKKecKoX8OAD8K0FTLDjsK6GDZ2wrHDlwgRw7nDn1kXDjnDlcKXecOsHGY8ScOrwr4pR0hSTcOyZcOUw4fCisKbw40IwqQHTcK6KsOzfsO7wrPDqnx3aMO5w7XDrmZ1R8Orw6XCp0lZKsKKGUpzLjHDiRRyNFAZJiPClcK0F8KXV087L8KEDVEgwpBww6JRwrTDtwwPwqLCq8K4WMKoehbDoksjwp_CnBXDpg3DjMOHwr95wrLCl8Osw7dzw73DhwETw4xjPcOHwq7Dp3rDpyXDl8ONwq7CtiHDvcOKwqPCt13Dk8OuG8KZAMOBEAzDj2HDoMKqPiPDllnDgVt3OH1BGMKPDiFyfcOUBMKJZCkcQMOHTG3Dj8Osw5_Cl8OyC8K_CGp5) I'm guessing it's related with the `statementsToExpressions` issue that was...
For the record, there is no grammar ambiguity here as of ES2016 (as far as I can tell, anyway) since `while` is a keyword. I fixed this one by adding...