gpt4 book ai didi

javascript - 在 d3.js 中改变对象的 [[prototype]] 的警告?

转载 作者:数据小太阳 更新时间:2023-10-29 06:01:33 25 4
gpt4 key购买 nike

我正在使用 d3.js 进行数据可视化。我收到下图中显示的警告。 enter image description here有谁知道为什么会这样,我该如何解决?错误中显示的消息如下

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

最佳答案

Does anyone have the idea why is this happening

看起来是 d3 的错。他们似乎用它来子类化数组 here :

// Until ECMAScript supports array subclassing, prototype injection works well.
var d3_subclass = function(object, prototype) {
object.__proto__ = prototype;
};

how can I solve this?

忽略警告。或者提交错误看看this issue d3.js 的。

关于javascript - 在 d3.js 中改变对象的 [[prototype]] 的警告?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28676186/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com