Closed azl397985856 closed 4 years ago
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
写一个babel 插件转化一下,思路:
VariableDeclaration
关于如何找到作用域中不存在,实际上 eslint 有专门的 api 可以用。 如果你自己写的话, 基本上就是扫描所有的变量声明然后把每一个变量声明记录到一个哈希表中即可。
特别需要注意的是:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
假如你的代码使用了ES关键字。 比如
这在ES6以前的Runtime 运行是没有问题的。 但是在支持ES6+的Runtime 就会报错。 如果项目有很多这样的东西么,那么如何解决这个问题呢?
扩展:
var let = 'something';
是可以的,这是为什么?