Quantcast
Channel: Cocos中文社区 - 最新主题
Viewing all articles
Browse latest Browse all 88737

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

$
0
0

@gaofei_dev 写道:

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
}
}net.rar (9.4 KB)

异常的位置是require("buffer") 引发的。请官方同学帮忙看看

帖子: 1

参与者: 1

阅读整个主题


Viewing all articles
Browse latest Browse all 88737

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>