摘要: 一、开始 工具链接: 每一个节点都有如下所示的接口(Interface): 每一个节点都会有 start,end,loc 这几个属性。 转换步骤接收 AST 并对其进行遍历,在此过程中对节点进行添加、更新及移除等操作。 这是 Babel 或是其他编译器中最复杂的过程 同时也是插件将要介入工作的部分, 阅读全文
posted @ 2019-04-17 19:17 shangyueyue 阅读(527) 评论(0) 推荐(0) 编辑
摘要: class Lazyman { constructor() { this.tasks = []; this.init(); } init() { const task = () => { console.log('i am a lazyman'); this.next(); }; this.tasks.unshift(... 阅读全文
posted @ 2019-04-17 14:22 shangyueyue 阅读(152) 评论(0) 推荐(0) 编辑