Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Array.of() fails in browser when used in combination with prototypejs #2

dertseha opened this Issue Aug 19, 2012 · 1 comment


None yet
2 participants

prototypejs (http://prototypejs.org/) has an own implementation of Array.prototype.reverse:

  function reverse(inline) {
    return (inline === false ? this.toArray() : this)._reverse();

with _reverse pointing to the original implementation.

Array.of() calls

var args = Array.prototype.reverse.call(arguments)

but arguments is not an object of type Array, thus doesn't have the _reverse method - and fails.

For a test, modified the minified version of js-schema to call


and it worked. (as per http://www.sitepoint.com/arguments-a-javascript-oddity/ : "Convert it to a real Array")

I didn't check other uses or similar constructs, but so far the scripts of my site run again.
Side question: How do you create the minified version before doing a commit?

@molnarg molnarg closed this in d108713 Aug 19, 2012


molnarg commented Aug 19, 2012

Thanks for the detailed description of this bug! I just committed the fix. It affected the String.of extension as well.

Regarding the build process: I added a build script to the root of the repository, and a section about it in the README!

Btw. I usually don't build the project every time I commit, because the testing is done in node.js.

Have a nice day :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment