Title: [203402] trunk
Revision
203402
Author
[email protected]
Date
2016-07-19 00:59:05 -0700 (Tue, 19 Jul 2016)

Log Message

[Streams API] Make ReadableStream properties not enumerable
https://bugs.webkit.org/show_bug.cgi?id=159868

Patch by Youenn Fablet <[email protected]> on 2016-07-19
Reviewed by Darin Adler.

LayoutTests/imported/w3c:

* web-platform-tests/streams/readable-streams/general.https-expected.txt:
* web-platform-tests/streams/readable-streams/readable-stream-reader.https-expected.txt:

Source/WebCore:

Covered by rebased tests.

Uopdating IDL definitions to mark all functions/attributes as not enumerable.
Updating IDL constructor definitions to correctly compute constructor length.
Updating built-in implementation to correctly compute pipeTo length to 1 (second parameter being optional).

* Modules/streams/ReadableStream.idl:
* Modules/streams/ReadableStream.js:
* Modules/streams/ReadableStreamController.idl:
* Modules/streams/ReadableStreamReader.idl:

Modified Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (203401 => 203402)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2016-07-19 07:41:21 UTC (rev 203401)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2016-07-19 07:59:05 UTC (rev 203402)
@@ -1,3 +1,13 @@
+2016-07-19  Youenn Fablet  <[email protected]>
+
+        [Streams API] Make ReadableStream properties not enumerable
+        https://bugs.webkit.org/show_bug.cgi?id=159868
+
+        Reviewed by Darin Adler.
+
+        * web-platform-tests/streams/readable-streams/general.https-expected.txt:
+        * web-platform-tests/streams/readable-streams/readable-stream-reader.https-expected.txt:
+
 2016-07-18  Chris Dumez  <[email protected]>
 
         input.formEnctype / formMethod and button.formEnctype / formMethod / type should treat null as "null"

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/general.https-expected.txt (203401 => 203402)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/general.https-expected.txt	2016-07-19 07:41:21 UTC (rev 203401)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/general.https-expected.txt	2016-07-19 07:59:05 UTC (rev 203402)
@@ -2,11 +2,11 @@
 PASS ReadableStream can be constructed with no errors 
 PASS ReadableStream can't be constructed with garbage 
 FAIL ReadableStream can't be constructed with an invalid type assert_throws: constructor should throw when the type is null function "() => new ReadableStream({ type: null })" did not throw
-FAIL ReadableStream instances should have the correct list of properties assert_false: method should be non-enumerable expected false got true
+PASS ReadableStream instances should have the correct list of properties 
 PASS ReadableStream constructor should throw for non-function start arguments 
 PASS ReadableStream constructor can get initial garbage as cancel argument 
 PASS ReadableStream constructor can get initial garbage as pull argument 
-FAIL ReadableStream start should be called with the proper parameters assert_false: close should be non-enumerable expected false got true
+PASS ReadableStream start should be called with the proper parameters 
 PASS ReadableStream start controller parameter should be extensible 
 PASS ReadableStream should be able to call start method within prototype chain of its source 
 PASS ReadableStream start should be able to return a promise 
@@ -39,11 +39,11 @@
 PASS ReadableStream can be constructed with no errors 
 PASS ReadableStream can't be constructed with garbage 
 FAIL ReadableStream can't be constructed with an invalid type assert_throws: constructor should throw when the type is null function "() => new ReadableStream({ type: null })" did not throw
-FAIL ReadableStream instances should have the correct list of properties assert_false: method should be non-enumerable expected false got true
+PASS ReadableStream instances should have the correct list of properties 
 PASS ReadableStream constructor should throw for non-function start arguments 
 PASS ReadableStream constructor can get initial garbage as cancel argument 
 PASS ReadableStream constructor can get initial garbage as pull argument 
-FAIL ReadableStream start should be called with the proper parameters assert_false: close should be non-enumerable expected false got true
+PASS ReadableStream start should be called with the proper parameters 
 PASS ReadableStream start controller parameter should be extensible 
 PASS ReadableStream should be able to call start method within prototype chain of its source 
 PASS ReadableStream start should be able to return a promise 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/readable-stream-reader.https-expected.txt (203401 => 203402)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/readable-stream-reader.https-expected.txt	2016-07-19 07:41:21 UTC (rev 203401)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/readable-stream-reader.https-expected.txt	2016-07-19 07:59:05 UTC (rev 203402)
@@ -1,7 +1,7 @@
 
 PASS Can get the ReadableStreamReader constructor indirectly 
 PASS ReadableStreamReader constructor should get a ReadableStream object as argument 
-FAIL ReadableStreamReader instances should have the correct list of properties assert_equals: method should be non-enumerable expected false but got true
+PASS ReadableStreamReader instances should have the correct list of properties 
 PASS ReadableStreamReader closed should always return the same promise object 
 PASS Constructing a ReadableStreamReader directly should fail if the stream is already locked (via direct construction) 
 PASS Getting a ReadableStreamReader via getReader should fail if the stream is already locked (via direct construction) 
@@ -29,7 +29,7 @@
 FAIL Untitled undefined is not an object (evaluating 'navigator.serviceWorker.getRegistration')
 PASS Can get the ReadableStreamReader constructor indirectly 
 PASS ReadableStreamReader constructor should get a ReadableStream object as argument 
-FAIL ReadableStreamReader instances should have the correct list of properties assert_equals: method should be non-enumerable expected false but got true
+PASS ReadableStreamReader instances should have the correct list of properties 
 PASS ReadableStreamReader closed should always return the same promise object 
 PASS Constructing a ReadableStreamReader directly should fail if the stream is already locked (via direct construction) 
 PASS Getting a ReadableStreamReader via getReader should fail if the stream is already locked (via direct construction) 

Modified: trunk/Source/WebCore/ChangeLog (203401 => 203402)


--- trunk/Source/WebCore/ChangeLog	2016-07-19 07:41:21 UTC (rev 203401)
+++ trunk/Source/WebCore/ChangeLog	2016-07-19 07:59:05 UTC (rev 203402)
@@ -1,3 +1,21 @@
+2016-07-19  Youenn Fablet  <[email protected]>
+
+        [Streams API] Make ReadableStream properties not enumerable
+        https://bugs.webkit.org/show_bug.cgi?id=159868
+
+        Reviewed by Darin Adler.
+
+        Covered by rebased tests.
+
+        Uopdating IDL definitions to mark all functions/attributes as not enumerable.
+        Updating IDL constructor definitions to correctly compute constructor length.
+        Updating built-in implementation to correctly compute pipeTo length to 1 (second parameter being optional).
+
+        * Modules/streams/ReadableStream.idl:
+        * Modules/streams/ReadableStream.js:
+        * Modules/streams/ReadableStreamController.idl:
+        * Modules/streams/ReadableStreamReader.idl:
+
 2016-07-19  Chris Dumez  <[email protected]>
 
         form.enctype / encoding / method should treat null as "null" string

Modified: trunk/Source/WebCore/Modules/streams/ReadableStream.idl (203401 => 203402)


--- trunk/Source/WebCore/Modules/streams/ReadableStream.idl	2016-07-19 07:41:21 UTC (rev 203401)
+++ trunk/Source/WebCore/Modules/streams/ReadableStream.idl	2016-07-19 07:59:05 UTC (rev 203402)
@@ -29,17 +29,17 @@
 
 [
     Conditional=STREAMS_API,
-    Constructor,
+    Constructor(optional any underlyingSource, optional any options),
     Exposed=(Window,Worker),
     JSBuiltin,
     PrivateIdentifier,
     PublicIdentifier
 ] interface ReadableStream {
-    Promise cancel(optional any reason);
-    Object getReader();
-    Promise pipeTo(any streams, any options);
-    Object pipeThrough(any dest, any options);
-    Object tee();
+    [NotEnumerable] Promise cancel(optional any reason);
+    [NotEnumerable] Object getReader();
+    [NotEnumerable] Promise pipeTo(any streams, optional any options);
+    [NotEnumerable] Object pipeThrough(any dest, any options);
+    [NotEnumerable] Object tee();
 
-    readonly attribute boolean locked;
+    [NotEnumerable] readonly attribute boolean locked;
 };

Modified: trunk/Source/WebCore/Modules/streams/ReadableStream.js (203401 => 203402)


--- trunk/Source/WebCore/Modules/streams/ReadableStream.js	2016-07-19 07:41:21 UTC (rev 203401)
+++ trunk/Source/WebCore/Modules/streams/ReadableStream.js	2016-07-19 07:59:05 UTC (rev 203402)
@@ -99,10 +99,14 @@
     return readable;
 }
 
-function pipeTo(destination, options)
+function pipeTo(destination)
 {
     "use strict";
 
+    // FIXME: https://bugs.webkit.org/show_bug.cgi?id=159869.
+    // Built-in generator should be able to parse function signature to compute the function length correctly.
+    const options = arguments[1];
+
     // FIXME: rewrite pipeTo so as to require to have 'this' as a ReadableStream and destination be a WritableStream.
     // See https://github.com/whatwg/streams/issues/407.
     // We should shield the pipeTo implementation at the same time.

Modified: trunk/Source/WebCore/Modules/streams/ReadableStreamController.idl (203401 => 203402)


--- trunk/Source/WebCore/Modules/streams/ReadableStreamController.idl	2016-07-19 07:41:21 UTC (rev 203401)
+++ trunk/Source/WebCore/Modules/streams/ReadableStreamController.idl	2016-07-19 07:59:05 UTC (rev 203402)
@@ -29,14 +29,14 @@
 
 [
     Conditional=STREAMS_API,
-    CustomConstructor,
+    CustomConstructor(ReadableStream stream, any underlyingSource, unsigned long size, unsigned long highWaterMark),
     Exposed=(Window,Worker),
     JSBuiltin,
     NoInterfaceObject
 ] interface ReadableStreamController {
-    void enqueue(optional any chunk);
-    void close();
-    void error(optional any error);
+    [NotEnumerable] void enqueue(optional any chunk);
+    [NotEnumerable] void close();
+    [NotEnumerable] void error(optional any error);
 
-    readonly attribute double desiredSize;
+    [NotEnumerable] readonly attribute double desiredSize;
 };

Modified: trunk/Source/WebCore/Modules/streams/ReadableStreamReader.idl (203401 => 203402)


--- trunk/Source/WebCore/Modules/streams/ReadableStreamReader.idl	2016-07-19 07:41:21 UTC (rev 203401)
+++ trunk/Source/WebCore/Modules/streams/ReadableStreamReader.idl	2016-07-19 07:59:05 UTC (rev 203402)
@@ -29,14 +29,14 @@
 
 [
     Conditional=STREAMS_API,
-    CustomConstructor,
+    CustomConstructor(ReadableStream stream),
     Exposed=(Window,Worker),
     JSBuiltin,
     NoInterfaceObject
 ] interface ReadableStreamReader {
-    Promise read();
-    Promise cancel(optional any reason);
-    void releaseLock();
+    [NotEnumerable] Promise read();
+    [NotEnumerable] Promise cancel(optional any reason);
+    [NotEnumerable] void releaseLock();
 
-    readonly attribute Promise closed;
+    [NotEnumerable] readonly attribute Promise closed;
 };
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to