[]ts继承后,代码压缩的问题
我用uglify-js对代码进行压缩有,会有很多重复的一下语句
var __extends = this && this.__extends || function() {
var extendStatics = Object.setPrototypeOf || {
__proto__: []
}instanceof Array && function(d, b) {
d.__proto__ = b
}
|| function(d, b) {
for (var p in b)
if (b.hasOwnProperty(p))
d[p] = b[p]
}
;
return function(d, b) {
extendStatics(d, b);
function __() {
this.constructor = d
}
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype,
new __)
}
}();
然后运行代码会报Uncaught TypeError: LayerManager is not a constructor的错误
我看到Laya有一个Laya.class的方法,请问这个能解决这个问题吗
var __extends = this && this.__extends || function() {
var extendStatics = Object.setPrototypeOf || {
__proto__: []
}instanceof Array && function(d, b) {
d.__proto__ = b
}
|| function(d, b) {
for (var p in b)
if (b.hasOwnProperty(p))
d[p] = b[p]
}
;
return function(d, b) {
extendStatics(d, b);
function __() {
this.constructor = d
}
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype,
new __)
}
}();
然后运行代码会报Uncaught TypeError: LayerManager is not a constructor的错误
我看到Laya有一个Laya.class的方法,请问这个能解决这个问题吗
没有找到相关结果
已邀请:
要回复问题请先登录
1 个回复
Laya_XS
赞同来自: