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

fix: shrinkStrategy should always return an integer #645

Merged
merged 1 commit into from
Dec 28, 2015

Conversation

dignifiedquire
Copy link
Contributor

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.

`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
Copy link

egoroof commented Dec 27, 2015

👍

1 similar comment
@gregberge
Copy link

👍

3rd-Eden added a commit that referenced this pull request Dec 28, 2015
fix: shrinkStrategy should always return an integer
@3rd-Eden 3rd-Eden merged commit c7c8172 into websockets:master Dec 28, 2015
@3rd-Eden
Copy link
Member

👍

@diwu1989
Copy link

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

@devversion
Copy link

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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants