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

Align this handing with ES5 on array builtins #324

Open
bjouhier opened this issue Jan 30, 2016 · 2 comments
Open

Align this handing with ES5 on array builtins #324

bjouhier opened this issue Jan 30, 2016 · 2 comments

Comments

@bjouhier
Copy link
Member

Array builtins are currently inconsistent with ES5 builtins in the way they handle this. There are two differences:

  • If thisArg is omitted, the callback is called with this set to undefined in ES5 (forEach, map, ...) but to the array itself in streamline's builtins (forEach_, map_, ...).
  • reduce_ and reduceRight_ take a thisArg parameter; reduce and reduceRight don't!

See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach#Parameters and related pages.

I propose to fix this and align streamline's builtins on the ES5 array builtins.

bjouhier added a commit that referenced this issue Jan 30, 2016
@bjouhier
Copy link
Member Author

Travis-ci is happy now 😄

@bjouhier
Copy link
Member Author

Issue is still pending, though. I've only disabled the unit tests that were revealing the issue.

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

No branches or pull requests

1 participant