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
internal/process/warning.js:18 (node:56266) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'text' of undefined
at createChildren (/Project/node_modules/typescript/lib/typescript.js:120256:65)
at NodeObject.getChildren (/Project/node_modules/typescript/lib/typescript.js:120219:56)
at NodeObject.getChildCount (/Project/node_modules/typescript/lib/typescript.js:120212:25)
at SanIdTransformer.visitor (/Project/ts2phprc.js:105:27) // 在这里调用的 node.getChildCount()
The text was updated successfully, but these errors were encountered:
发现自定义的 customTransformers 执行会报错, 貌似是 ts2php 内置的 transformer 会破坏原 ast 的结构, 导致自定义的 transformer 里遍历 ast 会报错, 用的是
ts.visitEachChild
来遍历。猜测是这里的处理有问题:
ts2php/src/transformer.ts
Line 215 in f511257
报错时正在处理这一行源码:
const {name, data, outputData} = originalParams;
报错的 node 如下:
报错的调用是:
node.getChildCount()
错误堆栈:
The text was updated successfully, but these errors were encountered: