在真机上调试报 E/cocos js error:: assets/src/project.dev.js line:7260 msg:mutating the [[Prototype]] of an object will cause your code to run very slowly; instead create the object with the correct initial [[Prototype]] value using Object.create
这个错误,该怎么解决?
代码里都是 cc.Class继承方式,没有引用任何第三方库(原先引了socket.io,后来移除了),根据控制台输出的堆栈找到assets/src/project.dev.js line:7260,是下面的代码
function typedArraySupport () {
try {
var arr = new Uint8Array(1)
arr.proto = {proto: Uint8Array.prototype, foo: function () { return 42 }}
return arr.foo() === 42 && // typed array instances can be augmented
typeof arr.subarray === ‘function’ && // chrome 9-10 lack subarray
arr.subarray(1, 1).byteLength === 0 // ie10 has broken subarray
} catch (e) {
return false
}
}
报错是 arr.proto = {proto: Uint8Array.prototype, foo: function () { return 42 }} 这一行,关键是这是cocos自己生成的吧?这个局怎么破?
creator的版本是最新的1.5.2
