RESOLVED FIXED 150389
[Streams API] Add writable stream attributes
https://bugs.webkit.org/show_bug.cgi?id=150389
Summary [Streams API] Add writable stream attributes
Xabier Rodríguez Calvar
Reported 2015-10-21 03:02:06 PDT
[Streams API] Add writable stream attributes
Attachments
Patch (14.81 KB, patch)
2015-10-21 03:06 PDT, Xabier Rodríguez Calvar
no flags
Patch (14.93 KB, patch)
2015-10-21 06:28 PDT, Xabier Rodríguez Calvar
no flags
Xabier Rodríguez Calvar
Comment 1 2015-10-21 03:06:36 PDT
Created attachment 263672 [details] Patch Added WS attributes.
youenn fablet
Comment 2 2015-10-21 05:14:40 PDT
Comment on attachment 263672 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=263672&action=review > Source/WebCore/Modules/streams/WritableStream.js:93 > + return Promise.reject(new @TypeError("Callee of closed is not a WritableStream")); We should start thinking in RS and WS to move from Promise.reject/Promise.resolve to private functions (like new @Promise -> new @InternalPromise). Also, we may want to have consistent error messages. ReadableStream error message would translate in "Function should be called on a WritableStream" which in not very good since it is a getter. DOM C++ binding would say something like "The WritableStream.closed getter can only be used on instances of WritableStream". Maybe we should think of introducing functions available from JS built-ins based on DOM binding (throwGetterTypeError...)?
Xabier Rodríguez Calvar
Comment 3 2015-10-21 05:58:16 PDT
(In reply to comment #2) > Comment on attachment 263672 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=263672&action=review > > > Source/WebCore/Modules/streams/WritableStream.js:93 > > + return Promise.reject(new @TypeError("Callee of closed is not a WritableStream")); > > We should start thinking in RS and WS to move from > Promise.reject/Promise.resolve to private functions (like new @Promise -> > new @InternalPromise). I'm on it. First I would get rid of the @createNewStreamsPromise and then I would take on that. Maybe together or in a separate patch, but I am definitely on it. I would like to upstream what I have because it takes some time to review the patches so this way I can do several things at the same time. > Also, we may want to have consistent error messages. > ReadableStream error message would translate in "Function should be called > on a WritableStream" which in not very good since it is a getter. > DOM C++ binding would say something like "The WritableStream.closed getter > can only be used on instances of WritableStream". > Maybe we should think of introducing functions available from JS built-ins > based on DOM binding (throwGetterTypeError...)? That would be an option, yes. I can change the error message to something more meaningful meanwhile.
Xabier Rodríguez Calvar
Comment 4 2015-10-21 06:28:43 PDT
Created attachment 263676 [details] Patch Use more meaningful error messages
WebKit Commit Bot
Comment 5 2015-10-22 00:51:51 PDT
Comment on attachment 263676 [details] Patch Clearing flags on attachment: 263676 Committed r191446: <http://trac.webkit.org/changeset/191446>
WebKit Commit Bot
Comment 6 2015-10-22 00:51:55 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.