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

@dignifiedquire 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.

`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 egoroof commented Dec 27, 2015

👍

1 similar comment
@gregberge
Copy link

@gregberge gregberge commented Dec 28, 2015

👍

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
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@3rd-Eden
Copy link
Member

@3rd-Eden 3rd-Eden commented Dec 28, 2015

👍

@diwu1989
Copy link

@diwu1989 diwu1989 commented Dec 28, 2015

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

@devversion
Copy link

@devversion 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
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants
You can’t perform that action at this time.