最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Warning of mutating the [[prototype]] of an object in d3.js? - Stack Overflow

programmeradmin10浏览0评论

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

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
Share Improve this question edited Feb 23, 2015 at 15:21 Bergi 666k161 gold badges1k silver badges1.5k bronze badges asked Feb 23, 2015 at 14:36 user4556747user4556747 7
  • Does this happen when you load the library, or does it e from your usage? Which line triggers this message? – Bergi Commented Feb 23, 2015 at 14:51
  • See this post on what the message means and by what kind of code it is caused. – Bergi Commented Feb 23, 2015 at 14:52
  • The error is shown when I launch the page and no data are shown – user4556747 Commented Feb 23, 2015 at 14:53
  • Here is the jsfiddle . Where can such error occur in my code? – user4556747 Commented Feb 23, 2015 at 15:02
  • That fiddle doesn't even import d3?! In what browser are you getting this warning? – Bergi Commented Feb 23, 2015 at 15:04
 |  Show 2 more ments

1 Answer 1

Reset to default 8

Does anyone have the idea why is this happening

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?

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

发布评论

评论列表(0)

  1. 暂无评论