Skip to content
This repository was archived by the owner on Dec 16, 2023. It is now read-only.

Possibly bug in pipeline.js #1108

Closed
rafis opened this issue Mar 21, 2017 · 0 comments
Closed

Possibly bug in pipeline.js #1108

rafis opened this issue Mar 21, 2017 · 0 comments

Comments

@rafis
Copy link
Contributor

rafis commented Mar 21, 2017

The following code does not perform filtering:

const requestHandlers = this.filter(fn => fn.length === 2).concat(Pipeline.makeHTTPRequest);

requestHandlers should contain only three handlers Pipeline.normalizeURL, Pipeline.mergeHeaders, Pipeline.makeHTTPRequest, but it contains all six Pipeline.normalizeURL, Pipeline.mergeHeaders, Pipeline.handleHeaders, Pipeline.handleCookies, Pipeline.handleRedirect, Pipeline.makeHTTPRequest.

I've asked this question on SO:
http://stackoverflow.com/questions/42927253/javascript-after-inheriting-array-the-filter-function-becomes-broken

@eur00t detaily explained why it happens.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant