You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Should generate() code much like the original src above.
Actual behavior
Error:
file:///Users/brev/Desktop/tmp/node_modules/astring/dist/astring.mjs:830
this[node.value.type](node.value, state)
^
TypeError: Cannot read properties of null (reading 'type')
at Object.PropertyDefinition (file:///Users/brev/Desktop/tmp/node_modules/astring/dist/astring.mjs:830:21)
at Object.BlockStatement (file:///Users/brev/Desktop/tmp/node_modules/astring/dist/astring.mjs:286:29)
at Object.ClassDeclaration (file:///Users/brev/Desktop/tmp/node_modules/astring/dist/astring.mjs:529:10)
at Object.Program (file:///Users/brev/Desktop/tmp/node_modules/astring/dist/astring.mjs:261:27)
at generate (file:///Users/brev/Desktop/tmp/node_modules/astring/dist/astring.mjs:1165:29)
at file:///Users/brev/Desktop/tmp/index.js:18:16
at ModuleJob.run (node:internal/modules/esm/module_job:197:25)
at async Promise.all (index 0)
at async ESMLoader.import (node:internal/modules/esm/loader:337:24)
at async loadESM (node:internal/process/esm_loader:88:5)
I believe this is an example of the failing section of the AST:
Thanks @brev for raising the issue. Indeed, the value of a PropertyDefinition can be null.
davidbonnet
changed the title
Uninitialized private properties in ESnext classes are failing under generate()
Does not handle uninitialized private properties
Apr 28, 2022
davidbonnet
changed the title
Does not handle uninitialized private properties
Does not handle undefined private properties
Apr 28, 2022
Hello, thanks for the great code!
Motivation
Uninitialized private properties in ESnext classes are failing under
generate()
:Here is an example of this style of code in the wild:
https://github.com/node-fetch/fetch-blob/blob/main/from.js#L60-L65
Expected behavior
Should
generate()
code much like the originalsrc
above.Actual behavior
Error:
I believe this is an example of the failing section of the AST:
The text was updated successfully, but these errors were encountered: