Bug 151089

Summary: [Streams API] Fix style issues
Product: WebKit Reporter: Xabier Rodríguez Calvar <calvaris>
Component: New BugsAssignee: Xabier Rodríguez Calvar <calvaris>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, commit-queue, darin, youennf
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch for landing none

Description Xabier Rodríguez Calvar 2015-11-10 04:50:27 PST
[Streams API] Fix style issues
Comment 1 Xabier Rodríguez Calvar 2015-11-10 04:52:24 PST
Created attachment 265167 [details]
Patch

Inlined some things, var -> const and let, removed some undefined parameters and returns, added missing use strict and other minor changes
Comment 2 youenn fablet 2015-11-10 05:39:30 PST
Comment on attachment 265167 [details]
Patch

Nice clean-up.
Use of bind() may not be safe.
Would you be able to land the patch without the bind changes.
Doing a quick check, bind seems already in use in WritableStream.
A follow-up should fix that. 

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

> Source/WebCore/Modules/streams/ReadableStream.js:58
> +    @Promise.prototype.@then.@call(@Promise.@resolve(@invokeOrNoop(underlyingSource, "start", [this.@controller])), function() {

This line is rather hard to parse.
I would keep it as two different lines.

> Source/WebCore/Modules/streams/ReadableStreamInternals.js:243
> +    @Promise.prototype.@then.@call(@promiseInvokeOrNoop(stream.@underlyingSource, "pull", [stream.@controller]), function() {

Ditto.

> Source/WebCore/Modules/streams/WritableStreamInternals.js:112
> +        @errorWritableStream.bind(stream)

Using bind may not be safe.
What if someone does Function.prototype.bind = evilFunction?

I would remove the change from this patch.
As a later patch and if that is worth it, @bind may be added and this change may be done.

> Source/WebCore/Modules/streams/WritableStreamInternals.js:129
> +        @errorWritableStream.bind(stream)

Ditto.
Comment 3 Xabier Rodríguez Calvar 2015-11-10 06:47:20 PST
Created attachment 265175 [details]
Patch for landing
Comment 4 WebKit Commit Bot 2015-11-10 07:45:21 PST
Comment on attachment 265175 [details]
Patch for landing

Clearing flags on attachment: 265175

Committed r192246: <http://trac.webkit.org/changeset/192246>
Comment 5 WebKit Commit Bot 2015-11-10 07:45:25 PST
All reviewed patches have been landed.  Closing bug.