警告突变d3.js中的对象的[[原型]]? [英] Warning of mutating the [[prototype]] of an object in d3.js?

查看:277
本文介绍了警告突变d3.js中的对象的[[原型]]?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用d3.js进行数据可视化。我得到如下图所示的警告。有没有人知道为什么这种情况发生我该如何解决这个问题?错误中显示的消息如下

I am working with d3.js for Data visualization. I am getting the warning shown in the following image. Does anyone have the idea why is this happening and how can I solve this? The message shown in the error is following

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故障。他们似乎使用它来子类化数组此处

Looks like it's d3's fault. They seem to use it to subclass arrays here:

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




如何解决这个问题?

how can I solve this?

忽略警告。或针对提出错误,请查看此问题的d3.js.

Ignore the warning. Or file a bug against have a look at this issue of d3.js.

这篇关于警告突变d3.js中的对象的[[原型]]?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆