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

fix: shrinkStrategy should always return an integer #645

Merged
merged 1 commit into from Dec 28, 2015

Conversation

Projects
None yet
6 participants
@dignifiedquire
Contributor

dignifiedquire commented Dec 27, 2015

Buffer inherits from Uint8Arry so the constructor needs to be
called with integers and mustn't be called with floats.

This patch ensures that the result of the the calculation
in the shrinkStrategy in Receiver returns an integer.

The reason why this has not been a problem up to now is that
a there is a V8 Bug
that the spec
is not adhered in this case.

This is a blocking issue for Karma
as the upgrade to core-js@2.0.0
now enforces this error.

fix: shrinkStrategy should always return an integer
`Buffer` inherits from `Uint8Arry` so the constructor needs to be
called with integers and mustn't be called with floats.

This patch ensures that the result of the the calculation
in the `shrinkStrategy` in `Receiver` returns an integer.

The reason why this has not been a problem up to now is that
a there is a [V8 Bug](https://code.google.com/p/v8/issues/detail?id=4552)
that the [spec](http://tc39.github.io/ecma262/#sec-typedarray-length)
is not adhered in this case.

This is a blocking issue for [Karma](karma-runner/karma#1768)
as the upgrade to [core-js@2.0.0](https://github.com/zloirock/core-js)
now enforces this error.
@egoroof

This comment has been minimized.

egoroof commented Dec 27, 2015

👍

1 similar comment
@neoziro

This comment has been minimized.

neoziro commented Dec 28, 2015

👍

3rd-Eden added a commit that referenced this pull request Dec 28, 2015

Merge pull request #645 from Dignifiedquire/buffer-length
fix: shrinkStrategy should always return an integer

@3rd-Eden 3rd-Eden merged commit c7c8172 into websockets:master Dec 28, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@3rd-Eden

This comment has been minimized.

Member

3rd-Eden commented Dec 28, 2015

👍

@dignifiedquire dignifiedquire deleted the dignifiedquire:buffer-length branch Dec 28, 2015

@diwu1989

This comment has been minimized.

diwu1989 commented Dec 28, 2015

can you make a release? we really need this for Karma to work

@DevVersion

This comment has been minimized.

DevVersion commented Dec 30, 2015

Yes, that's really important 👍

Edit: Seem's to be there is a new release deployed

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