This project is archived and is in readonly mode.

#921 ✓resolved

$$([]) throws an error (and chrashes Chrome)

Reported by Arian | June 2nd, 2010 @ 11:07 PM

Hi, I've been testing MooTools More with 1.3, and with Drag.Move (the droppables option is default []) I encountered this error.

Just type in $$([]) in the console.

Comments and changes to this ticket

  • Christoph Pojer

    Christoph Pojer June 3rd, 2010 @ 02:03 PM

    • State changed from “new” to “invalid”


    I don't see that problem with either 1.3beta1 or the current master. Please feel free to reopen this ticket with a proper testcase. Via you can create one such testcase, try it with "MooTools 1.3 nightly" which is the latest version.

  • Arian

    Arian June 3rd, 2010 @ 10:06 PM

    You should buid MooTools without the 1.2compat. And try again.

    This is what I get in Firebug:

     [Exception... "Operation is not supported" code: "9" nsresult: "0x80530009 (NS_ERROR_DOM_NOT_SUPPORTED_ERR)" location: "http://localhost/MooTools/Test/mootools-core.js Line: 1765"] { source="with(_FirebugCommandLine){$$([])\n};",  more...}
  • Michael Ficarra

    Michael Ficarra June 3rd, 2010 @ 10:56 PM

    I built MooTools 1.3pre without 1.2compat and receive no errors when running $$([]). It appears to be returning every element in the document.

  • Christoph Pojer

    Christoph Pojer June 3rd, 2010 @ 11:47 PM

    Please note that in 1.3 we do not allow passing an array to the $$ method. You should either use the compat layer or update your code.

  • Arian

    Arian June 5th, 2010 @ 10:41 AM

    So the documentation of $$ is not correct anymore because $$ only accepts one parameter that should be a string?

    according to the current docs it should accept this:

    • HTMLCollections,
    • arrays of elements,
    • elements, or
    • strings as selectors.

    "arrays of elements" could be any array, so an empty as well and if its an empty array, it just should return an empty array. But if this has been changed, the docs are not correct anymore.

    Could you confirm it only accepts a string now, so I can update the docs?

  • Christoph Pojer

    Christoph Pojer June 5th, 2010 @ 04:35 PM

    • State changed from “invalid” to “resolved”

    Please do!

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Shared Ticket Bins