Norris Boyd wrote:
...
There are some name collisions, i.e. some current JS libraries (case
in point: prototype.js) define Function.bind, and I have a vague
understanding that they'll fail if it's already present. Seehttp://www.prototypejs.org/api/function/bind
I think this was discussed by the ES5 committee--certainly breaking
Prototype would be a concern for browser vendors. A quick experiment
on current Rhino shows that the new builtin Function.bind can be
overridden, so I imagine the expectation is that Prototype will
override the existing, or that it will be compatible.
HtmlUnit already uses recent features from Rhino HEAD. I haven't noticed
problems with the prototype tests of our tests suite but with the
MooTools tests. MooTools doesn't try to override Function.bind, but it
defines it by itself only if it is not already available (this is what
they do for all the functions that they define) and the problem is that
Rhino's bind function (or ES5's one) doesn't behave like MooTools' one,
what breaks some functionality. To still be able to support MooTools,
HtmlUnit now just deletes Function.bind.
Cheers,
Marc.
--
Web: http://www.efficient-webtesting.com
Blog: http://mguillem.wordpress.com
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino