Bug 151499 - [Streams API] streams should not directly use Number and related methods
Summary: [Streams API] streams should not directly use Number and related methods
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: youenn fablet
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-20 10:00 PST by youenn fablet
Modified: 2015-12-01 01:06 PST (History)
8 users (show)

See Also:


Attachments
Patch (6.57 KB, patch)
2015-11-20 10:14 PST, youenn fablet
no flags Details | Formatted Diff | Diff
Patch for landing (9.20 KB, patch)
2015-12-01 00:11 PST, youenn fablet
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description youenn fablet 2015-11-20 10:00:12 PST
Instead @Number should be used.
Comment 1 youenn fablet 2015-11-20 10:14:59 PST
Created attachment 265967 [details]
Patch
Comment 2 Darin Adler 2015-11-30 11:55:23 PST
Comment on attachment 265967 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=265967&action=review

Shouldn’t we make a test that shows the problems this side steps?

> Source/WebCore/Modules/streams/ReadableStreamInternals.js:326
> +            if (@isNaN(size) || !@isFinite(size) || size < 0)

The @isNaN here is not needed, since @isFinite returns false for NaN.

> Source/WebCore/Modules/streams/StreamInternals.js:112
> +    if (@isNaN(size) || !@isFinite(size) || size < 0)

The @isNaN here is not needed, since @isFinite returns false for NaN.
Comment 3 youenn fablet 2015-12-01 00:11:17 PST
Created attachment 266338 [details]
Patch for landing
Comment 4 youenn fablet 2015-12-01 00:16:13 PST
Thanks for the review.

(In reply to comment #2)
> Comment on attachment 265967 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=265967&action=review
> 
> Shouldn’t we make a test that shows the problems this side steps?

Right, I added a test for that.
I think though we should have a better way of checking these issues.

> 
> > Source/WebCore/Modules/streams/ReadableStreamInternals.js:326
> > +            if (@isNaN(size) || !@isFinite(size) || size < 0)
> 
> The @isNaN here is not needed, since @isFinite returns false for NaN.

OK

> > Source/WebCore/Modules/streams/StreamInternals.js:112
> > +    if (@isNaN(size) || !@isFinite(size) || size < 0)
> 
> The @isNaN here is not needed, since @isFinite returns false for NaN.

OK
Comment 5 WebKit Commit Bot 2015-12-01 01:06:39 PST
Comment on attachment 266338 [details]
Patch for landing

Clearing flags on attachment: 266338

Committed r192874: <http://trac.webkit.org/changeset/192874>
Comment 6 WebKit Commit Bot 2015-12-01 01:06:43 PST
All reviewed patches have been landed.  Closing bug.