Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid the need for utile.args(arguments).array by using Object.defineProperty #10

Merged
merged 5 commits into from
May 23, 2012

Conversation

indexzero
Copy link
Member

Discussed this with @Marak over gchat the other day and decided to implement it.

imho we should be optimizing for the simple case where someone simply wants to call Array.prototype.slice.call(arguments). Check the diff on the tests for all the details of what's changing.

Usage:

  function getArgs() {
    //
    // [ 'a', 'b', 'c' ]
    //
    console.dir(utile.args(arguments));

    //
    // All additional properties not enumerable.
    // e.g. 
    //

    //
    // function ok() { console.log('ok');
    //
    console.dir(utile.args(arguments).cb.toString());
  }

@indexzero indexzero merged commit 59d7d38 into master May 23, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant