我正在使用 6to5 编译 ES6 代码片段,但ReferenceError: unknown: Line 1: Top level this is undefined in strict mode
在编译时出现错误,例如
var to5 = require('6to5');
to5.transform('this.x = 42').code
该错误是有道理的,但我想编译引用的片段,this
有没有办法抑制错误并继续编译?
我正在使用 6to5 编译 ES6 代码片段,但ReferenceError: unknown: Line 1: Top level this is undefined in strict mode
在编译时出现错误,例如
var to5 = require('6to5');
to5.transform('this.x = 42').code
该错误是有道理的,但我想编译引用的片段,this
有没有办法抑制错误并继续编译?