This project is archived and is in readonly mode.

#93 ✓wontfix
David

$arguments according to specs

Reported by David | June 5th, 2008 @ 01:33 PM | in 2.0 (closed)

$arguments specs has two empty tests: "should return all the arguments if no index is passed" and "should support negative index accessing". This is a modified $arguments that would pass those specs.

Like in $lambda the conditional operator is outside of the returned function so that the check is only performed once.

Comments and changes to this ticket

  • David

    David June 5th, 2008 @ 01:35 PM

    function $arguments(i) {

    return (i || i === 0) ? i < 0 ? function () {

    return arguments[arguments.length + i];

    } : function () {

    return arguments[i];

    } : function () {

    return Array.slice(arguments);

    };

    };

  • Jan Kassens

    Jan Kassens June 5th, 2008 @ 02:54 PM

    • State changed from “new” to “hold”

    i cant think of a usecase for both additional cases, so i suggest just removing the empty specs.

  • Christoph Pojer

    Christoph Pojer November 9th, 2010 @ 07:25 PM

    • Tag set to enhancement
    • State changed from “hold” to “wontfix”
    • Milestone order changed from “0” to “0”

Create your profile

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

Shared Ticket Bins

People watching this ticket

Pages