renciso218 / blockly

Automatically exported from code.google.com/p/blockly
0 stars 0 forks source link

Use iFrame safe instanceof #211

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The instanceof Array checks used in blockly are not safe for code that runs in 
an iFrame. Please use an iFrame safe function, such as

function isArray(o) {
  return Object.prototype.toString.call(o) === '[object Array]';
}

For more information, please visit: 
http://perfectionkills.com/instanceof-considered-harmful-or-how-to-write-a-robus
t-isarray/

Original issue reported on code.google.com by chris.ma...@gmail.com on 21 Feb 2014 at 5:01

GoogleCodeExporter commented 8 years ago
Well, one learns something new every day.  Thank you very much!

I've replaced all five offending instances with calls to Closure's goog.isArray 
which handles the problem with the robustness I've come to expect from that 
library.
http://docs.closure-library.googlecode.com/git/closure_goog_base.js.source.html#
line817

Fixed in r1646.

Original comment by neil.fra...@gmail.com on 6 Mar 2014 at 6:22

GoogleCodeExporter commented 8 years ago
I just did an update and everything works great for me. Thanks!

Original comment by chris.ma...@gmail.com on 6 Mar 2014 at 10:59