We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ES6转ES5分为以下两种情况
The text was updated successfully, but these errors were encountered:
No branches or pull requests
ES6 代码转成 ES5 代码的实现思路是什么
1. ES6代码转AST
2. 对 AST 进行处理,在这个阶段可以对 ES6 代码进行相应转换,即转成 ES5 代码:
ES6转ES5分为以下两种情况
例如:let,const转换为var,箭头函数转换为function函数声明等
采用babel-polyfill等工具对ES5中不存在的API(包括Set等ES6中新的数据结构)做修复,例如:Array.prototype.includes Set Map等在ES5中不存在,需要用相应的ES5代码实现这些API
3. 根据处理后的 AST 再生成代码字符串
The text was updated successfully, but these errors were encountered: