Builtins generator should emit ENABLE(FEATURE) guards based on @conditional annotation
authorbburg@apple.com <bburg@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 28 Oct 2015 20:00:36 +0000 (20:00 +0000)
committerbburg@apple.com <bburg@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 28 Oct 2015 20:00:36 +0000 (20:00 +0000)
https://bugs.webkit.org/show_bug.cgi?id=150536

Reviewed by Yusuke Suzuki.

Source/JavaScriptCore:

Scan JS builtin files for @key=value and @flag annotations in single-line comments.
For @conditional=CONDITIONAL, emit CONDITIONAL guards around the relevant object's code.

Generate primary header includes separately from secondary header includes so we can
put the guard between the two header groups, as is customary in WebKit C++ code.

New tests:

Scripts/tests/builtins/WebCore-ArbitraryConditionalGuard-Separate.js
Scripts/tests/builtins/WebCore-DuplicateFlagAnnotation-Separate.js
Scripts/tests/builtins/WebCore-DuplicateKeyValueAnnotation-Separate.js

* Scripts/builtins/builtins_generate_combined_implementation.py:
(BuiltinsCombinedImplementationGenerator.generate_output):
(BuiltinsCombinedImplementationGenerator.generate_secondary_header_includes):
(BuiltinsCombinedImplementationGenerator.generate_header_includes): Deleted.
* Scripts/builtins/builtins_generate_separate_header.py:
(BuiltinsSeparateHeaderGenerator.generate_output):
(generate_secondary_header_includes):
(generate_header_includes): Deleted.
* Scripts/builtins/builtins_generate_separate_implementation.py:
(BuiltinsSeparateImplementationGenerator.generate_output):
(BuiltinsSeparateImplementationGenerator.generate_secondary_header_includes):
(BuiltinsSeparateImplementationGenerator.generate_header_includes): Deleted.
* Scripts/builtins/builtins_generate_separate_wrapper.py:
(BuiltinsSeparateWrapperGenerator.generate_output):
(BuiltinsSeparateWrapperGenerator.generate_secondary_header_includes):
(BuiltinsSeparateWrapperGenerator.generate_header_includes): Deleted.
* Scripts/builtins/builtins_generator.py:
(BuiltinsGenerator.generate_includes_from_entries):
(BuiltinsGenerator):
(BuiltinsGenerator.generate_primary_header_includes):
* Scripts/builtins/builtins_model.py:
(BuiltinObject.__init__):
(BuiltinsCollection.parse_builtins_file):
(BuiltinsCollection._parse_annotations):
* Scripts/tests/builtins/WebCore-ArbitraryConditionalGuard-Separate.js: Added.
* Scripts/tests/builtins/WebCore-DuplicateFlagAnnotation-Separate.js: Added.
* Scripts/tests/builtins/WebCore-DuplicateKeyValueAnnotation-Separate.js: Added.
* Scripts/tests/builtins/WebCore-GuardedBuiltin-Separate.js: Simplify.
* Scripts/tests/builtins/WebCore-GuardedInternalBuiltin-Separate.js: Simplify.
* Scripts/tests/builtins/WebCore-UnguardedBuiltin-Separate.js: Simplify.
* Scripts/tests/builtins/expected/WebCore-ArbitraryConditionalGuard-Separate.js-result: Added.
* Scripts/tests/builtins/expected/WebCore-DuplicateFlagAnnotation-Separate.js-error: Added.
* Scripts/tests/builtins/expected/WebCore-DuplicateKeyValueAnnotation-Separate.js-error: Added.
* Scripts/tests/builtins/expected/WebCore-GuardedBuiltin-Separate.js-result:
* Scripts/tests/builtins/expected/WebCore-GuardedInternalBuiltin-Separate.js-result:
* Scripts/tests/builtins/expected/WebCore-UnguardedBuiltin-Separate.js-result:
* Scripts/tests/builtins/expected/WebCore-xmlCasingTest-Separate.js-result:

Source/WebCore:

Replace @optional=FEATURE with @conditional=ENABLE(FEATURE) in builtins files.

* Modules/streams/ByteLengthQueuingStrategy.js:
* Modules/streams/CountQueuingStrategy.js:
* Modules/streams/ReadableStream.js:
* Modules/streams/ReadableStreamController.js:
* Modules/streams/ReadableStreamInternals.js:
* Modules/streams/ReadableStreamReader.js:
* Modules/streams/StreamInternals.js:
* Modules/streams/WritableStream.js:
* Modules/streams/WritableStreamInternals.js:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@191687 268f45cc-cd09-0410-ab3c-d52691b4dbfc

31 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/Scripts/builtins/builtins_generate_combined_implementation.py
Source/JavaScriptCore/Scripts/builtins/builtins_generate_separate_header.py
Source/JavaScriptCore/Scripts/builtins/builtins_generate_separate_implementation.py
Source/JavaScriptCore/Scripts/builtins/builtins_generate_separate_wrapper.py
Source/JavaScriptCore/Scripts/builtins/builtins_generator.py
Source/JavaScriptCore/Scripts/builtins/builtins_model.py
Source/JavaScriptCore/Scripts/tests/builtins/WebCore-ArbitraryConditionalGuard-Separate.js [new file with mode: 0644]
Source/JavaScriptCore/Scripts/tests/builtins/WebCore-DuplicateFlagAnnotation-Separate.js [new file with mode: 0644]
Source/JavaScriptCore/Scripts/tests/builtins/WebCore-DuplicateKeyValueAnnotation-Separate.js [new file with mode: 0644]
Source/JavaScriptCore/Scripts/tests/builtins/WebCore-GuardedBuiltin-Separate.js
Source/JavaScriptCore/Scripts/tests/builtins/WebCore-GuardedInternalBuiltin-Separate.js
Source/JavaScriptCore/Scripts/tests/builtins/WebCore-UnguardedBuiltin-Separate.js
Source/JavaScriptCore/Scripts/tests/builtins/WebCore-xmlCasingTest-Separate.js
Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-ArbitraryConditionalGuard-Separate.js-result [new file with mode: 0644]
Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-DuplicateFlagAnnotation-Separate.js-error [new file with mode: 0644]
Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-DuplicateKeyValueAnnotation-Separate.js-error [new file with mode: 0644]
Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-GuardedBuiltin-Separate.js-result
Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-GuardedInternalBuiltin-Separate.js-result
Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-UnguardedBuiltin-Separate.js-result
Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-xmlCasingTest-Separate.js-result
Source/WebCore/ChangeLog
Source/WebCore/Modules/streams/ByteLengthQueuingStrategy.js
Source/WebCore/Modules/streams/CountQueuingStrategy.js
Source/WebCore/Modules/streams/ReadableStream.js
Source/WebCore/Modules/streams/ReadableStreamController.js
Source/WebCore/Modules/streams/ReadableStreamInternals.js
Source/WebCore/Modules/streams/ReadableStreamReader.js
Source/WebCore/Modules/streams/StreamInternals.js
Source/WebCore/Modules/streams/WritableStream.js
Source/WebCore/Modules/streams/WritableStreamInternals.js

index ebeca296cb97a50b221d880a5bec4915e80f78a0..c0cb37d2fe9eb4231cc6d78cafd74a2e0ec13018 100644 (file)
@@ -1,3 +1,60 @@
+2015-10-28  Brian Burg  <bburg@apple.com>
+
+        Builtins generator should emit ENABLE(FEATURE) guards based on @conditional annotation
+        https://bugs.webkit.org/show_bug.cgi?id=150536
+
+        Reviewed by Yusuke Suzuki.
+
+        Scan JS builtin files for @key=value and @flag annotations in single-line comments.
+        For @conditional=CONDITIONAL, emit CONDITIONAL guards around the relevant object's code.
+
+        Generate primary header includes separately from secondary header includes so we can
+        put the guard between the two header groups, as is customary in WebKit C++ code.
+
+        New tests:
+
+        Scripts/tests/builtins/WebCore-ArbitraryConditionalGuard-Separate.js
+        Scripts/tests/builtins/WebCore-DuplicateFlagAnnotation-Separate.js
+        Scripts/tests/builtins/WebCore-DuplicateKeyValueAnnotation-Separate.js
+
+        * Scripts/builtins/builtins_generate_combined_implementation.py:
+        (BuiltinsCombinedImplementationGenerator.generate_output):
+        (BuiltinsCombinedImplementationGenerator.generate_secondary_header_includes):
+        (BuiltinsCombinedImplementationGenerator.generate_header_includes): Deleted.
+        * Scripts/builtins/builtins_generate_separate_header.py:
+        (BuiltinsSeparateHeaderGenerator.generate_output):
+        (generate_secondary_header_includes):
+        (generate_header_includes): Deleted.
+        * Scripts/builtins/builtins_generate_separate_implementation.py:
+        (BuiltinsSeparateImplementationGenerator.generate_output):
+        (BuiltinsSeparateImplementationGenerator.generate_secondary_header_includes):
+        (BuiltinsSeparateImplementationGenerator.generate_header_includes): Deleted.
+        * Scripts/builtins/builtins_generate_separate_wrapper.py:
+        (BuiltinsSeparateWrapperGenerator.generate_output):
+        (BuiltinsSeparateWrapperGenerator.generate_secondary_header_includes):
+        (BuiltinsSeparateWrapperGenerator.generate_header_includes): Deleted.
+        * Scripts/builtins/builtins_generator.py:
+        (BuiltinsGenerator.generate_includes_from_entries):
+        (BuiltinsGenerator):
+        (BuiltinsGenerator.generate_primary_header_includes):
+        * Scripts/builtins/builtins_model.py:
+        (BuiltinObject.__init__):
+        (BuiltinsCollection.parse_builtins_file):
+        (BuiltinsCollection._parse_annotations):
+        * Scripts/tests/builtins/WebCore-ArbitraryConditionalGuard-Separate.js: Added.
+        * Scripts/tests/builtins/WebCore-DuplicateFlagAnnotation-Separate.js: Added.
+        * Scripts/tests/builtins/WebCore-DuplicateKeyValueAnnotation-Separate.js: Added.
+        * Scripts/tests/builtins/WebCore-GuardedBuiltin-Separate.js: Simplify.
+        * Scripts/tests/builtins/WebCore-GuardedInternalBuiltin-Separate.js: Simplify.
+        * Scripts/tests/builtins/WebCore-UnguardedBuiltin-Separate.js: Simplify.
+        * Scripts/tests/builtins/expected/WebCore-ArbitraryConditionalGuard-Separate.js-result: Added.
+        * Scripts/tests/builtins/expected/WebCore-DuplicateFlagAnnotation-Separate.js-error: Added.
+        * Scripts/tests/builtins/expected/WebCore-DuplicateKeyValueAnnotation-Separate.js-error: Added.
+        * Scripts/tests/builtins/expected/WebCore-GuardedBuiltin-Separate.js-result:
+        * Scripts/tests/builtins/expected/WebCore-GuardedInternalBuiltin-Separate.js-result:
+        * Scripts/tests/builtins/expected/WebCore-UnguardedBuiltin-Separate.js-result:
+        * Scripts/tests/builtins/expected/WebCore-xmlCasingTest-Separate.js-result:
+
 2015-10-28  Mark Lam  <mark.lam@apple.com>
 
         Update FTL to support UntypedUse operands for op_sub.
index b2878d3610bc3d1397dc11583b4d39b82f426d88..094434b6468a153f0f86ca85d179ff6c6f3c8b8b 100644 (file)
@@ -53,7 +53,8 @@ class BuiltinsCombinedImplementationGenerator(BuiltinsGenerator):
         sections = []
         sections.append(self.generate_license())
         sections.append(Template(Templates.DoNotEditWarning).substitute(args))
-        sections.append(self.generate_header_includes())
+        sections.append(self.generate_primary_header_includes())
+        sections.append(self.generate_secondary_header_includes())
         sections.append(Template(Templates.NamespaceTop).substitute(args))
         for function in self.model().all_functions():
             sections.append(self.generate_embedded_code_string_section_for_function(function))
@@ -65,7 +66,7 @@ class BuiltinsCombinedImplementationGenerator(BuiltinsGenerator):
 
         return "\n\n".join(sections)
 
-    def generate_header_includes(self):
+    def generate_secondary_header_includes(self):
         header_includes = [
             (["JavaScriptCore"],
                 ("JavaScriptCore", "builtins/BuiltinExecutables.h"),
index 5b1eb7d671ca11c358a5197dadade795190d0030..f81a9e5bae890be9d4caafa48ce5f4bb51c7378d 100644 (file)
@@ -55,11 +55,15 @@ class BuiltinsSeparateHeaderGenerator(BuiltinsGenerator):
             'objectName': self.object.object_name.upper(),
         }
 
+        conditional_guard = self.object.annotations.get('conditional')
+
         sections = []
         sections.append(self.generate_license())
         sections.append(Template(Templates.DoNotEditWarning).substitute(args))
         sections.append(Template(Templates.HeaderIncludeGuardTop).substitute(args))
-        sections.append(self.generate_header_includes())
+        if conditional_guard is not None:
+            sections.append("#if %s" % conditional_guard)
+        sections.append(self.generate_secondary_header_includes())
         sections.append(self.generate_forward_declarations())
         sections.append(Template(Templates.NamespaceTop).substitute(args))
         sections.append(self.generate_section_for_object(self.object))
@@ -67,6 +71,8 @@ class BuiltinsSeparateHeaderGenerator(BuiltinsGenerator):
         sections.append(self.generate_section_for_code_name_macro())
         sections.append(Template(Templates.SeparateHeaderStaticMacros).substitute(args))
         sections.append(Template(Templates.NamespaceBottom).substitute(args))
+        if conditional_guard is not None:
+            sections.append("#endif // %s" % conditional_guard)
         sections.append(Template(Templates.HeaderIncludeGuardBottom).substitute(args))
 
         return "\n\n".join(sections)
@@ -76,7 +82,7 @@ class BuiltinsSeparateHeaderGenerator(BuiltinsGenerator):
 class FunctionExecutable;
 }"""
 
-    def generate_header_includes(self):
+    def generate_secondary_header_includes(self):
         header_includes = [
             (["WebCore"],
                 ("JavaScriptCore", "builtins/BuiltinUtils.h"),
index 6c22904b5ce025d786ec9335105ef9bd5ced6447..0443975dadf1b37a63c18feef55a855382f41d94 100644 (file)
@@ -56,10 +56,15 @@ class BuiltinsSeparateImplementationGenerator(BuiltinsGenerator):
             'objectNameLC': WK_lcfirst(self.object.object_name),
         }
 
+        conditional_guard = self.object.annotations.get('conditional')
+
         sections = []
         sections.append(self.generate_license())
         sections.append(Template(Templates.DoNotEditWarning).substitute(args))
-        sections.append(self.generate_header_includes())
+        sections.append(self.generate_primary_header_includes())
+        if conditional_guard is not None:
+            sections.append("#if %s" % conditional_guard)
+        sections.append(self.generate_secondary_header_includes())
         sections.append(Template(Templates.NamespaceTop).substitute(args))
         for function in self.object.functions:
             sections.append(self.generate_embedded_code_string_section_for_function(function))
@@ -68,10 +73,12 @@ class BuiltinsSeparateImplementationGenerator(BuiltinsGenerator):
         elif self.model().framework is Frameworks.WebCore:
             sections.append(Template(Templates.SeparateWebCoreImplementationStaticMacros).substitute(args))
         sections.append(Template(Templates.NamespaceBottom).substitute(args))
+        if conditional_guard is not None:
+            sections.append("#endif // %s\n" % conditional_guard)
 
         return "\n\n".join(sections)
 
-    def generate_header_includes(self):
+    def generate_secondary_header_includes(self):
         header_includes = [
             (["JavaScriptCore"],
                 ("JavaScriptCore", "builtins/BuiltinExecutables.h"),
index daa88cf7620cda137186b9916437bc6d0b481d9e..32bc3364c0eff0bb997b654bd0d9697fdd0c2120 100644 (file)
@@ -56,19 +56,25 @@ class BuiltinsSeparateWrapperGenerator(BuiltinsGenerator):
             'objectMacro': self.object.object_name.upper(),
         }
 
+        conditional_guard = self.object.annotations.get('conditional')
+
         sections = []
         sections.append(self.generate_license())
         sections.append(Template(Templates.DoNotEditWarning).substitute(args))
         sections.append(Template(Templates.HeaderIncludeGuardTop).substitute(args))
-        sections.append(self.generate_header_includes())
+        if conditional_guard is not None:
+            sections.append("#if %s" % conditional_guard)
+        sections.append(self.generate_secondary_header_includes())
         sections.append(Template(Templates.NamespaceTop).substitute(args))
         sections.append(Template(Templates.SeparateWrapperHeaderBoilerplate).substitute(args))
         sections.append(Template(Templates.NamespaceBottom).substitute(args))
+        if conditional_guard is not None:
+            sections.append("#endif // %s" % conditional_guard)
         sections.append(Template(Templates.HeaderIncludeGuardBottom).substitute(args))
 
         return "\n\n".join(sections)
 
-    def generate_header_includes(self):
+    def generate_secondary_header_includes(self):
         header_includes = [
             (["WebCore"],
                 ("WebCore", "%sBuiltins.h" % self.object.object_name),
index 58483e0c22315f77dbaa976d4badcf77de2d3f19..7f469d3b46b92fc7fe0300bf34f1dc8f93c441c6 100644 (file)
@@ -101,17 +101,14 @@ class BuiltinsGenerator:
             else:
                 includes.add("#include \"%s\"" % os.path.basename(header_path))
 
-        sorted_includes = sorted(list(includes))
-        # Always include config.h and the counterpart header before other headers.
-        name, ext = os.path.splitext(self.output_filename())
-        if ext != '.h':
-            sorted_includes[:0] = [
-                "#include \"config.h\"",
-                "#include \"%s.h\"" % name,
-                "",
-            ]
-
-        return sorted_includes
+        return sorted(list(includes))
+
+    def generate_primary_header_includes(self):
+        name, _ = os.path.splitext(self.output_filename())
+        return '\n'.join([
+            "#include \"config.h\"",
+            "#include \"%s.h\"" % name,
+        ])
 
     def generate_embedded_code_string_section_for_function(self, function):
         text = function.function_source
index b5d4bde64d6ba6cd1d07353d4f2bd5ea1450aa3f..f1a300f27a9f21b298788f311f91d9a34b919ff5 100644 (file)
@@ -47,7 +47,8 @@ functionParameterFinder = re.compile(r"^(?:function|constructor)\s+(?:\w+)\s*\((
 
 multilineCommentRegExp = re.compile(r"\/\*.*?\*\/", re.MULTILINE | re.S)
 singleLineCommentRegExp = re.compile(r"\/\/.*?\n", re.MULTILINE | re.S)
-
+keyValueAnnotationCommentRegExp = re.compile(r"^\/\/ @(\w+)=([^=]+?)\n", re.MULTILINE | re.S)
+flagAnnotationCommentRegExp = re.compile(r"^\/\/ @(\w+)[^=]*?\n", re.MULTILINE | re.S)
 
 class ParseException(Exception):
     pass
@@ -78,8 +79,9 @@ class Frameworks:
 
 
 class BuiltinObject:
-    def __init__(self, object_name, functions):
+    def __init__(self, object_name, annotations, functions):
         self.object_name = object_name
+        self.annotations = annotations
         self.functions = functions
         self.collection = None  # Set by the owning BuiltinsCollection
 
@@ -132,6 +134,8 @@ class BuiltinsCollection:
             log.debug(line)
         log.debug("")
 
+        object_annotations = self._parse_annotations(text)
+
         object_name, ext = os.path.splitext(os.path.basename(filename))
         log.debug("Parsing object: %s" % object_name)
 
@@ -144,7 +148,7 @@ class BuiltinsCollection:
             log.debug(func)
         log.debug("")
 
-        new_object = BuiltinObject(object_name, parsed_functions)
+        new_object = BuiltinObject(object_name, object_annotations, parsed_functions)
         new_object.collection = self
         self.objects.append(new_object)
 
@@ -205,6 +209,27 @@ class BuiltinsCollection:
 
         return copyrightLines
 
+    def _parse_annotations(self, text):
+        annotations = {}
+
+        for match in keyValueAnnotationCommentRegExp.finditer(text):
+            (key, value) = match.group(1, 2)
+            log.debug("Found annotation: '%s' => '%s'" % (key, value))
+            if key in annotations:
+                raise ParseException("Duplicate annotation found: %s" % key)
+
+            annotations[key] = value
+
+        for match in flagAnnotationCommentRegExp.finditer(text):
+            key = match.group(1)
+            log.debug("Found annotation: '%s' => 'TRUE'" % key)
+            if key in annotations:
+                raise ParseException("Duplicate annotation found: %s" % key)
+
+            annotations[key] = True
+
+        return annotations
+
     def _parse_functions(self, text):
         text = multilineCommentRegExp.sub("/**/", singleLineCommentRegExp.sub("//\n", text))
 
diff --git a/Source/JavaScriptCore/Scripts/tests/builtins/WebCore-ArbitraryConditionalGuard-Separate.js b/Source/JavaScriptCore/Scripts/tests/builtins/WebCore-ArbitraryConditionalGuard-Separate.js
new file mode 100644 (file)
index 0000000..c808b3c
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2015 Canon Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// @conditional=ENABLE(STREAMS_API) || USE(CF)
+
+function isReadableStreamLocked(stream)
+{
+   "use strict";
+
+    return !!stream.@reader;
+}
diff --git a/Source/JavaScriptCore/Scripts/tests/builtins/WebCore-DuplicateFlagAnnotation-Separate.js b/Source/JavaScriptCore/Scripts/tests/builtins/WebCore-DuplicateFlagAnnotation-Separate.js
new file mode 100644 (file)
index 0000000..73e7c71
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2015 Canon Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// @internal
+// @internal
diff --git a/Source/JavaScriptCore/Scripts/tests/builtins/WebCore-DuplicateKeyValueAnnotation-Separate.js b/Source/JavaScriptCore/Scripts/tests/builtins/WebCore-DuplicateKeyValueAnnotation-Separate.js
new file mode 100644 (file)
index 0000000..6d6fe60
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2015 Canon Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// @conditional=ENABLE(STREAMS_API)
+// @conditional=USE(CF)
+
+function isReadableStreamLocked(stream)
+{
+   "use strict";
+
+    return !!stream.@reader;
+}
index 46887e7edcad6b2a87ef5e7829d293cef01e3722..2acec589dd991742c35513978c1ef9091cba0db4 100644 (file)
@@ -23,7 +23,7 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-// @optional=STREAMS_API
+// @conditional=ENABLE(STREAMS_API)
 
 function isReadableStreamLocked(stream)
 {
@@ -31,34 +31,3 @@ function isReadableStreamLocked(stream)
 
     return !!stream.@reader;
 }
-
-
-function cancelReadableStream(stream, reason)
-{
-    "use strict";
-
-    if (stream.@state === @readableStreamClosed)
-        return Promise.resolve();
-    if (stream.@state === @readableStreamErrored)
-        return Promise.reject(stream.@storedError);
-    stream.@queue = [];
-    @finishClosingReadableStream(stream);
-    return @promiseInvokeOrNoop(stream.@underlyingSource, "cancel", [reason]).then(function() { });
-}
-
-
-function promiseInvokeOrNoop(object, key, args)
-{
-    "use strict";
-
-    try {
-        var method = object[key];
-        if (typeof method === "undefined")
-            return Promise.resolve();
-        var result = method.@apply(object, args);
-        return Promise.resolve(result);
-    }
-    catch(error) {
-        return Promise.reject(error);
-    }
-}
index 4f5e7b3b841d510a29f576f9436099e8e2762657..80d53cd1abf648e93db6494a2ad5b22381e5cf1b 100644 (file)
@@ -23,7 +23,7 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-// @optional=STREAMS_API
+// @conditional=ENABLE(STREAMS_API)
 // @internal
 
 function isReadableStreamLocked(stream)
@@ -32,34 +32,3 @@ function isReadableStreamLocked(stream)
 
     return !!stream.@reader;
 }
-
-
-function cancelReadableStream(stream, reason)
-{
-    "use strict";
-
-    if (stream.@state === @readableStreamClosed)
-        return Promise.resolve();
-    if (stream.@state === @readableStreamErrored)
-        return Promise.reject(stream.@storedError);
-    stream.@queue = [];
-    @finishClosingReadableStream(stream);
-    return @promiseInvokeOrNoop(stream.@underlyingSource, "cancel", [reason]).then(function() { });
-}
-
-
-function promiseInvokeOrNoop(object, key, args)
-{
-    "use strict";
-
-    try {
-        var method = object[key];
-        if (typeof method === "undefined")
-            return Promise.resolve();
-        var result = method.@apply(object, args);
-        return Promise.resolve(result);
-    }
-    catch(error) {
-        return Promise.reject(error);
-    }
-}
index 9bdc8d3b7e9be2980afdd6b6138c0488feb26a0f..9647f2bdd787e648e69f0d43b86e671de70589a8 100644 (file)
@@ -29,34 +29,3 @@ function isReadableStreamLocked(stream)
 
     return !!stream.@reader;
 }
-
-
-function cancelReadableStream(stream, reason)
-{
-    "use strict";
-
-    if (stream.@state === @readableStreamClosed)
-        return Promise.resolve();
-    if (stream.@state === @readableStreamErrored)
-        return Promise.reject(stream.@storedError);
-    stream.@queue = [];
-    @finishClosingReadableStream(stream);
-    return @promiseInvokeOrNoop(stream.@underlyingSource, "cancel", [reason]).then(function() { });
-}
-
-
-function promiseInvokeOrNoop(object, key, args)
-{
-    "use strict";
-
-    try {
-        var method = object[key];
-        if (typeof method === "undefined")
-            return Promise.resolve();
-        var result = method.@apply(object, args);
-        return Promise.resolve(result);
-    }
-    catch(error) {
-        return Promise.reject(error);
-    }
-}
index de393bc5981428287e0f04319db6e4202b55e268..550c89e02616e56c556a4190bf9f6117d8f1b56e 100644 (file)
@@ -23,7 +23,7 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-// @optional=STREAMS_API
+// @conditional=ENABLE(STREAMS_API)
 // @internal
 
 function xmlCasingTest(stream)
diff --git a/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-ArbitraryConditionalGuard-Separate.js-result b/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-ArbitraryConditionalGuard-Separate.js-result
new file mode 100644 (file)
index 0000000..98c1f3c
--- /dev/null
@@ -0,0 +1,280 @@
+### Begin File: ArbitraryConditionalGuardBuiltins.h
+/*
+ * Copyright (c) 2015 Canon Inc. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from JavaScript files for
+// builtins by the script: Source/JavaScriptCore/Scripts/generate-js-builtins.py
+
+#ifndef ArbitraryConditionalGuardBuiltins_h
+#define ArbitraryConditionalGuardBuiltins_h
+
+#if ENABLE(STREAMS_API) || USE(CF)
+
+#include <builtins/BuiltinUtils.h>
+
+namespace JSC {
+class FunctionExecutable;
+}
+
+namespace WebCore {
+
+/* ArbitraryConditionalGuard */
+extern const char* s_arbitraryConditionalGuardIsReadableStreamLockedCode;
+extern const int s_arbitraryConditionalGuardIsReadableStreamLockedCodeLength;
+extern const JSC::ConstructAbility s_arbitraryConditionalGuardIsReadableStreamLockedCodeConstructAbility;
+
+#define WEBCORE_FOREACH_ARBITRARYCONDITIONALGUARD_BUILTIN_DATA(macro) \
+    macro(isReadableStreamLocked, arbitraryConditionalGuardIsReadableStreamLocked, 1) \
+
+#define WEBCORE_BUILTIN_ARBITRARYCONDITIONALGUARD_ISREADABLESTREAMLOCKED 1
+
+#define WEBCORE_FOREACH_ARBITRARYCONDITIONALGUARD_BUILTIN_CODE(macro) \
+    macro(arbitraryConditionalGuardIsReadableStreamLockedCode, isReadableStreamLocked, s_arbitraryConditionalGuardIsReadableStreamLockedCodeLength) \
+
+#define WEBCORE_FOREACH_ARBITRARYCONDITIONALGUARD_BUILTIN_FUNCTION_NAME(macro) \
+    macro(isReadableStreamLocked) \
+
+#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \
+    JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
+
+WEBCORE_FOREACH_ARBITRARYCONDITIONALGUARD_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR)
+#undef DECLARE_BUILTIN_GENERATOR
+
+#define WEBCORE_BUILTIN_ARBITRARYCONDITIONALGUARD_EXISTS(object, func) defined WEBCORE_BUILTIN_ ## object ## _ ## func
+
+} // namespace WebCore
+
+#endif // ENABLE(STREAMS_API) || USE(CF)
+
+#endif // ArbitraryConditionalGuardBuiltins_h
+
+### End File: ArbitraryConditionalGuardBuiltins.h
+
+### Begin File: ArbitraryConditionalGuardBuiltins.cpp
+/*
+ * Copyright (c) 2015 Canon Inc. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from JavaScript files for
+// builtins by the script: Source/JavaScriptCore/Scripts/generate-js-builtins.py
+
+#include "config.h"
+#include "ArbitraryConditionalGuardBuiltins.h"
+
+#if ENABLE(STREAMS_API) || USE(CF)
+
+#include "WebCoreJSClientData.h"
+#include <runtime/Executable.h>
+#include <runtime/JSCJSValueInlines.h>
+#include <runtime/JSCellInlines.h>
+#include <runtime/StructureInlines.h>
+#include <runtime/VM.h>
+
+namespace WebCore {
+
+const JSC::ConstructAbility s_arbitraryConditionalGuardIsReadableStreamLockedCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const int s_arbitraryConditionalGuardIsReadableStreamLockedCodeLength = 71;
+const char* s_arbitraryConditionalGuardIsReadableStreamLockedCode =
+    "(function (stream)\n" \
+    "{\n" \
+    "   \"use strict\";\n" \
+    "\n" \
+    "    return !!stream.@reader;\n" \
+    "})\n" \
+;
+
+
+#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \
+JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
+{\
+    JSVMClientData* clientData = static_cast<JSVMClientData*>(vm.clientData); \
+    return clientData->builtinFunctions().arbitraryConditionalGuardBuiltins().codeName##Executable()->link(vm, clientData->builtinFunctions().arbitraryConditionalGuardBuiltins().codeName##Source()); \
+}
+WEBCORE_FOREACH_ARBITRARYCONDITIONALGUARD_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
+#undef DEFINE_BUILTIN_GENERATOR
+
+
+} // namespace WebCore
+
+#endif // ENABLE(STREAMS_API) || USE(CF)
+
+### End File: ArbitraryConditionalGuardBuiltins.cpp
+
+### Begin File: ArbitraryConditionalGuardBuiltinsWrapper.h
+/*
+ * Copyright (c) 2015 Canon Inc. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from JavaScript files for
+// builtins by the script: Source/JavaScriptCore/Scripts/generate-js-builtins.py
+
+#ifndef ArbitraryConditionalGuardBuiltinsWrapper_h
+#define ArbitraryConditionalGuardBuiltinsWrapper_h
+
+#if ENABLE(STREAMS_API) || USE(CF)
+
+#include "ArbitraryConditionalGuardBuiltins.h"
+#include <builtins/BuiltinUtils.h>
+#include <bytecode/UnlinkedFunctionExecutable.h>
+#include <runtime/Identifier.h>
+#include <runtime/JSFunction.h>
+
+namespace WebCore {
+
+class ArbitraryConditionalGuardBuiltinsWrapper : private JSC::WeakHandleOwner {
+public:
+    explicit ArbitraryConditionalGuardBuiltinsWrapper(JSC::VM* vm)
+        : m_vm(*vm)
+        WEBCORE_FOREACH_ARBITRARYCONDITIONALGUARD_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES)
+#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, length) , m_##name##Source(JSC::makeSource(StringImpl::createFromLiteral(s_##name, length)))
+        WEBCORE_FOREACH_ARBITRARYCONDITIONALGUARD_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
+#undef INITIALIZE_BUILTIN_SOURCE_MEMBERS
+    {
+    }
+
+#define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, length) \
+    JSC::UnlinkedFunctionExecutable* name##Executable(); \
+    const JSC::SourceCode& name##Source() const { return m_##name##Source; }
+    WEBCORE_FOREACH_ARBITRARYCONDITIONALGUARD_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES)
+#undef EXPOSE_BUILTIN_EXECUTABLES
+
+    WEBCORE_FOREACH_ARBITRARYCONDITIONALGUARD_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR)
+
+    void exportNames();
+
+private:
+    JSC::VM& m_vm;
+
+    WEBCORE_FOREACH_ARBITRARYCONDITIONALGUARD_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES)
+
+#define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, length) \
+    JSC::SourceCode m_##name##Source;\
+    JSC::Weak<JSC::UnlinkedFunctionExecutable> m_##name##Executable;
+    WEBCORE_FOREACH_ARBITRARYCONDITIONALGUARD_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS)
+#undef DECLARE_BUILTIN_SOURCE_MEMBERS
+
+};
+
+#define DEFINE_BUILTIN_EXECUTABLES(name, functionName, length) \
+inline JSC::UnlinkedFunctionExecutable* ArbitraryConditionalGuardBuiltinsWrapper::name##Executable() \
+{\
+    if (!m_##name##Executable)\
+        m_##name##Executable = JSC::Weak<JSC::UnlinkedFunctionExecutable>(JSC::createBuiltinExecutable(m_vm, m_##name##Source, functionName##PublicName(), s_##name##ConstructAbility), this, &m_##name##Executable);\
+    return m_##name##Executable.get();\
+}
+WEBCORE_FOREACH_ARBITRARYCONDITIONALGUARD_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES)
+#undef DEFINE_BUILTIN_EXECUTABLES
+
+inline void ArbitraryConditionalGuardBuiltinsWrapper::exportNames()
+{
+#define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName());
+    WEBCORE_FOREACH_ARBITRARYCONDITIONALGUARD_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME)
+#undef EXPORT_FUNCTION_NAME
+}
+
+class ArbitraryConditionalGuardBuiltinFunctions {
+public:
+    explicit ArbitraryConditionalGuardBuiltinFunctions(JSC::VM& vm) : m_vm(vm) { }
+
+    void init(JSC::JSGlobalObject&);
+    void visit(JSC::SlotVisitor&);
+
+public:
+    JSC::VM& m_vm;
+
+#define DECLARE_BUILTIN_SOURCE_MEMBERS(functionName) \
+    JSC::WriteBarrier<JSC::JSFunction> m_##functionName##Function;
+    WEBCORE_FOREACH_ARBITRARYCONDITIONALGUARD_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_SOURCE_MEMBERS)
+#undef DECLARE_BUILTIN_SOURCE_MEMBERS
+};
+
+inline void ArbitraryConditionalGuardBuiltinFunctions::init(JSC::JSGlobalObject& globalObject)
+{
+#define EXPORT_FUNCTION(codeName, functionName, length)\
+    m_##functionName##Function.set(m_vm, &globalObject, JSC::JSFunction::createBuiltinFunction(m_vm, codeName##Generator(m_vm), &globalObject));
+    WEBCORE_FOREACH_ARBITRARYCONDITIONALGUARD_BUILTIN_CODE(EXPORT_FUNCTION)
+#undef EXPORT_FUNCTION
+}
+
+inline void ArbitraryConditionalGuardBuiltinFunctions::visit(JSC::SlotVisitor& visitor)
+{
+#define VISIT_FUNCTION(name) visitor.append(&m_##name##Function);
+    WEBCORE_FOREACH_ARBITRARYCONDITIONALGUARD_BUILTIN_FUNCTION_NAME(VISIT_FUNCTION)
+#undef VISIT_FUNCTION
+}
+
+
+} // namespace WebCore
+
+#endif // ENABLE(STREAMS_API) || USE(CF)
+
+#endif // ArbitraryConditionalGuardBuiltinsWrapper_h
+
+### End File: ArbitraryConditionalGuardBuiltinsWrapper.h
diff --git a/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-DuplicateFlagAnnotation-Separate.js-error b/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-DuplicateFlagAnnotation-Separate.js-error
new file mode 100644 (file)
index 0000000..b15152e
--- /dev/null
@@ -0,0 +1 @@
+ERROR: Duplicate annotation found: internal
diff --git a/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-DuplicateKeyValueAnnotation-Separate.js-error b/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-DuplicateKeyValueAnnotation-Separate.js-error
new file mode 100644 (file)
index 0000000..f1b429e
--- /dev/null
@@ -0,0 +1 @@
+ERROR: Duplicate annotation found: conditional
index 55a21d4656866fe8f737f18307b12624a74482aa..bea7ad311b581eecc6fc96e126012de5188e81b6 100644 (file)
@@ -31,6 +31,8 @@
 #ifndef GuardedBuiltinBuiltins_h
 #define GuardedBuiltinBuiltins_h
 
+#if ENABLE(STREAMS_API)
+
 #include <builtins/BuiltinUtils.h>
 
 namespace JSC {
@@ -43,31 +45,17 @@ namespace WebCore {
 extern const char* s_guardedBuiltinIsReadableStreamLockedCode;
 extern const int s_guardedBuiltinIsReadableStreamLockedCodeLength;
 extern const JSC::ConstructAbility s_guardedBuiltinIsReadableStreamLockedCodeConstructAbility;
-extern const char* s_guardedBuiltinCancelReadableStreamCode;
-extern const int s_guardedBuiltinCancelReadableStreamCodeLength;
-extern const JSC::ConstructAbility s_guardedBuiltinCancelReadableStreamCodeConstructAbility;
-extern const char* s_guardedBuiltinPromiseInvokeOrNoopCode;
-extern const int s_guardedBuiltinPromiseInvokeOrNoopCodeLength;
-extern const JSC::ConstructAbility s_guardedBuiltinPromiseInvokeOrNoopCodeConstructAbility;
 
 #define WEBCORE_FOREACH_GUARDEDBUILTIN_BUILTIN_DATA(macro) \
     macro(isReadableStreamLocked, guardedBuiltinIsReadableStreamLocked, 1) \
-    macro(cancelReadableStream, guardedBuiltinCancelReadableStream, 2) \
-    macro(promiseInvokeOrNoop, guardedBuiltinPromiseInvokeOrNoop, 3) \
 
 #define WEBCORE_BUILTIN_GUARDEDBUILTIN_ISREADABLESTREAMLOCKED 1
-#define WEBCORE_BUILTIN_GUARDEDBUILTIN_CANCELREADABLESTREAM 1
-#define WEBCORE_BUILTIN_GUARDEDBUILTIN_PROMISEINVOKEORNOOP 1
 
 #define WEBCORE_FOREACH_GUARDEDBUILTIN_BUILTIN_CODE(macro) \
     macro(guardedBuiltinIsReadableStreamLockedCode, isReadableStreamLocked, s_guardedBuiltinIsReadableStreamLockedCodeLength) \
-    macro(guardedBuiltinCancelReadableStreamCode, cancelReadableStream, s_guardedBuiltinCancelReadableStreamCodeLength) \
-    macro(guardedBuiltinPromiseInvokeOrNoopCode, promiseInvokeOrNoop, s_guardedBuiltinPromiseInvokeOrNoopCodeLength) \
 
 #define WEBCORE_FOREACH_GUARDEDBUILTIN_BUILTIN_FUNCTION_NAME(macro) \
-    macro(cancelReadableStream) \
     macro(isReadableStreamLocked) \
-    macro(promiseInvokeOrNoop) \
 
 #define DECLARE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \
     JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
@@ -79,6 +67,8 @@ WEBCORE_FOREACH_GUARDEDBUILTIN_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR)
 
 } // namespace WebCore
 
+#endif // ENABLE(STREAMS_API)
+
 #endif // GuardedBuiltinBuiltins_h
 
 ### End File: GuardedBuiltinBuiltins.h
@@ -116,6 +106,8 @@ WEBCORE_FOREACH_GUARDEDBUILTIN_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR)
 #include "config.h"
 #include "GuardedBuiltinBuiltins.h"
 
+#if ENABLE(STREAMS_API)
+
 #include "WebCoreJSClientData.h"
 #include <runtime/Executable.h>
 #include <runtime/JSCJSValueInlines.h>
@@ -136,43 +128,6 @@ const char* s_guardedBuiltinIsReadableStreamLockedCode =
     "})\n" \
 ;
 
-const JSC::ConstructAbility s_guardedBuiltinCancelReadableStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const int s_guardedBuiltinCancelReadableStreamCodeLength = 402;
-const char* s_guardedBuiltinCancelReadableStreamCode =
-    "(function (stream, reason)\n" \
-    "{\n" \
-    "    \"use strict\";\n" \
-    "\n" \
-    "    if (stream.@state === @readableStreamClosed)\n" \
-    "        return Promise.resolve();\n" \
-    "    if (stream.@state === @readableStreamErrored)\n" \
-    "        return Promise.reject(stream.@storedError);\n" \
-    "    stream.@queue = [];\n" \
-    "    @finishClosingReadableStream(stream);\n" \
-    "    return @promiseInvokeOrNoop(stream.@underlyingSource, \"cancel\", [reason]).then(function() { });\n" \
-    "})\n" \
-;
-
-const JSC::ConstructAbility s_guardedBuiltinPromiseInvokeOrNoopCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const int s_guardedBuiltinPromiseInvokeOrNoopCodeLength = 338;
-const char* s_guardedBuiltinPromiseInvokeOrNoopCode =
-    "(function (object, key, args)\n" \
-    "{\n" \
-    "    \"use strict\";\n" \
-    "\n" \
-    "    try {\n" \
-    "        var method = object[key];\n" \
-    "        if (typeof method === \"undefined\")\n" \
-    "            return Promise.resolve();\n" \
-    "        var result = method.@apply(object, args);\n" \
-    "        return Promise.resolve(result);\n" \
-    "    }\n" \
-    "    catch(error) {\n" \
-    "        return Promise.reject(error);\n" \
-    "    }\n" \
-    "})\n" \
-;
-
 
 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \
 JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
@@ -185,6 +140,9 @@ WEBCORE_FOREACH_GUARDEDBUILTIN_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
 
 
 } // namespace WebCore
+
+#endif // ENABLE(STREAMS_API)
+
 ### End File: GuardedBuiltinBuiltins.cpp
 
 ### Begin File: GuardedBuiltinBuiltinsWrapper.h
@@ -220,6 +178,8 @@ WEBCORE_FOREACH_GUARDEDBUILTIN_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
 #ifndef GuardedBuiltinBuiltinsWrapper_h
 #define GuardedBuiltinBuiltinsWrapper_h
 
+#if ENABLE(STREAMS_API)
+
 #include "GuardedBuiltinBuiltins.h"
 #include <builtins/BuiltinUtils.h>
 #include <bytecode/UnlinkedFunctionExecutable.h>
@@ -313,6 +273,8 @@ inline void GuardedBuiltinBuiltinFunctions::visit(JSC::SlotVisitor& visitor)
 
 } // namespace WebCore
 
+#endif // ENABLE(STREAMS_API)
+
 #endif // GuardedBuiltinBuiltinsWrapper_h
 
 ### End File: GuardedBuiltinBuiltinsWrapper.h
index 348a1cfc4484aef3f760e879466efbab966e50f4..8d988893cddf7d5d7370233b84eb9deda6dc7a01 100644 (file)
@@ -31,6 +31,8 @@
 #ifndef GuardedInternalBuiltinBuiltins_h
 #define GuardedInternalBuiltinBuiltins_h
 
+#if ENABLE(STREAMS_API)
+
 #include <builtins/BuiltinUtils.h>
 
 namespace JSC {
@@ -43,31 +45,17 @@ namespace WebCore {
 extern const char* s_guardedInternalBuiltinIsReadableStreamLockedCode;
 extern const int s_guardedInternalBuiltinIsReadableStreamLockedCodeLength;
 extern const JSC::ConstructAbility s_guardedInternalBuiltinIsReadableStreamLockedCodeConstructAbility;
-extern const char* s_guardedInternalBuiltinCancelReadableStreamCode;
-extern const int s_guardedInternalBuiltinCancelReadableStreamCodeLength;
-extern const JSC::ConstructAbility s_guardedInternalBuiltinCancelReadableStreamCodeConstructAbility;
-extern const char* s_guardedInternalBuiltinPromiseInvokeOrNoopCode;
-extern const int s_guardedInternalBuiltinPromiseInvokeOrNoopCodeLength;
-extern const JSC::ConstructAbility s_guardedInternalBuiltinPromiseInvokeOrNoopCodeConstructAbility;
 
 #define WEBCORE_FOREACH_GUARDEDINTERNALBUILTIN_BUILTIN_DATA(macro) \
     macro(isReadableStreamLocked, guardedInternalBuiltinIsReadableStreamLocked, 1) \
-    macro(cancelReadableStream, guardedInternalBuiltinCancelReadableStream, 2) \
-    macro(promiseInvokeOrNoop, guardedInternalBuiltinPromiseInvokeOrNoop, 3) \
 
 #define WEBCORE_BUILTIN_GUARDEDINTERNALBUILTIN_ISREADABLESTREAMLOCKED 1
-#define WEBCORE_BUILTIN_GUARDEDINTERNALBUILTIN_CANCELREADABLESTREAM 1
-#define WEBCORE_BUILTIN_GUARDEDINTERNALBUILTIN_PROMISEINVOKEORNOOP 1
 
 #define WEBCORE_FOREACH_GUARDEDINTERNALBUILTIN_BUILTIN_CODE(macro) \
     macro(guardedInternalBuiltinIsReadableStreamLockedCode, isReadableStreamLocked, s_guardedInternalBuiltinIsReadableStreamLockedCodeLength) \
-    macro(guardedInternalBuiltinCancelReadableStreamCode, cancelReadableStream, s_guardedInternalBuiltinCancelReadableStreamCodeLength) \
-    macro(guardedInternalBuiltinPromiseInvokeOrNoopCode, promiseInvokeOrNoop, s_guardedInternalBuiltinPromiseInvokeOrNoopCodeLength) \
 
 #define WEBCORE_FOREACH_GUARDEDINTERNALBUILTIN_BUILTIN_FUNCTION_NAME(macro) \
-    macro(cancelReadableStream) \
     macro(isReadableStreamLocked) \
-    macro(promiseInvokeOrNoop) \
 
 #define DECLARE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \
     JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
@@ -79,6 +67,8 @@ WEBCORE_FOREACH_GUARDEDINTERNALBUILTIN_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR)
 
 } // namespace WebCore
 
+#endif // ENABLE(STREAMS_API)
+
 #endif // GuardedInternalBuiltinBuiltins_h
 
 ### End File: GuardedInternalBuiltinBuiltins.h
@@ -116,6 +106,8 @@ WEBCORE_FOREACH_GUARDEDINTERNALBUILTIN_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR)
 #include "config.h"
 #include "GuardedInternalBuiltinBuiltins.h"
 
+#if ENABLE(STREAMS_API)
+
 #include "WebCoreJSClientData.h"
 #include <runtime/Executable.h>
 #include <runtime/JSCJSValueInlines.h>
@@ -136,43 +128,6 @@ const char* s_guardedInternalBuiltinIsReadableStreamLockedCode =
     "})\n" \
 ;
 
-const JSC::ConstructAbility s_guardedInternalBuiltinCancelReadableStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const int s_guardedInternalBuiltinCancelReadableStreamCodeLength = 402;
-const char* s_guardedInternalBuiltinCancelReadableStreamCode =
-    "(function (stream, reason)\n" \
-    "{\n" \
-    "    \"use strict\";\n" \
-    "\n" \
-    "    if (stream.@state === @readableStreamClosed)\n" \
-    "        return Promise.resolve();\n" \
-    "    if (stream.@state === @readableStreamErrored)\n" \
-    "        return Promise.reject(stream.@storedError);\n" \
-    "    stream.@queue = [];\n" \
-    "    @finishClosingReadableStream(stream);\n" \
-    "    return @promiseInvokeOrNoop(stream.@underlyingSource, \"cancel\", [reason]).then(function() { });\n" \
-    "})\n" \
-;
-
-const JSC::ConstructAbility s_guardedInternalBuiltinPromiseInvokeOrNoopCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const int s_guardedInternalBuiltinPromiseInvokeOrNoopCodeLength = 338;
-const char* s_guardedInternalBuiltinPromiseInvokeOrNoopCode =
-    "(function (object, key, args)\n" \
-    "{\n" \
-    "    \"use strict\";\n" \
-    "\n" \
-    "    try {\n" \
-    "        var method = object[key];\n" \
-    "        if (typeof method === \"undefined\")\n" \
-    "            return Promise.resolve();\n" \
-    "        var result = method.@apply(object, args);\n" \
-    "        return Promise.resolve(result);\n" \
-    "    }\n" \
-    "    catch(error) {\n" \
-    "        return Promise.reject(error);\n" \
-    "    }\n" \
-    "})\n" \
-;
-
 
 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \
 JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
@@ -185,6 +140,9 @@ WEBCORE_FOREACH_GUARDEDINTERNALBUILTIN_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
 
 
 } // namespace WebCore
+
+#endif // ENABLE(STREAMS_API)
+
 ### End File: GuardedInternalBuiltinBuiltins.cpp
 
 ### Begin File: GuardedInternalBuiltinBuiltinsWrapper.h
@@ -220,6 +178,8 @@ WEBCORE_FOREACH_GUARDEDINTERNALBUILTIN_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
 #ifndef GuardedInternalBuiltinBuiltinsWrapper_h
 #define GuardedInternalBuiltinBuiltinsWrapper_h
 
+#if ENABLE(STREAMS_API)
+
 #include "GuardedInternalBuiltinBuiltins.h"
 #include <builtins/BuiltinUtils.h>
 #include <bytecode/UnlinkedFunctionExecutable.h>
@@ -313,6 +273,8 @@ inline void GuardedInternalBuiltinBuiltinFunctions::visit(JSC::SlotVisitor& visi
 
 } // namespace WebCore
 
+#endif // ENABLE(STREAMS_API)
+
 #endif // GuardedInternalBuiltinBuiltinsWrapper_h
 
 ### End File: GuardedInternalBuiltinBuiltinsWrapper.h
index 58ee2dabbac9c1a6b659ab132b0a6c471e63e458..2d8a0ab3cf62a144968743e6c9fa74752dbb79dc 100644 (file)
@@ -43,31 +43,17 @@ namespace WebCore {
 extern const char* s_unguardedBuiltinIsReadableStreamLockedCode;
 extern const int s_unguardedBuiltinIsReadableStreamLockedCodeLength;
 extern const JSC::ConstructAbility s_unguardedBuiltinIsReadableStreamLockedCodeConstructAbility;
-extern const char* s_unguardedBuiltinCancelReadableStreamCode;
-extern const int s_unguardedBuiltinCancelReadableStreamCodeLength;
-extern const JSC::ConstructAbility s_unguardedBuiltinCancelReadableStreamCodeConstructAbility;
-extern const char* s_unguardedBuiltinPromiseInvokeOrNoopCode;
-extern const int s_unguardedBuiltinPromiseInvokeOrNoopCodeLength;
-extern const JSC::ConstructAbility s_unguardedBuiltinPromiseInvokeOrNoopCodeConstructAbility;
 
 #define WEBCORE_FOREACH_UNGUARDEDBUILTIN_BUILTIN_DATA(macro) \
     macro(isReadableStreamLocked, unguardedBuiltinIsReadableStreamLocked, 1) \
-    macro(cancelReadableStream, unguardedBuiltinCancelReadableStream, 2) \
-    macro(promiseInvokeOrNoop, unguardedBuiltinPromiseInvokeOrNoop, 3) \
 
 #define WEBCORE_BUILTIN_UNGUARDEDBUILTIN_ISREADABLESTREAMLOCKED 1
-#define WEBCORE_BUILTIN_UNGUARDEDBUILTIN_CANCELREADABLESTREAM 1
-#define WEBCORE_BUILTIN_UNGUARDEDBUILTIN_PROMISEINVOKEORNOOP 1
 
 #define WEBCORE_FOREACH_UNGUARDEDBUILTIN_BUILTIN_CODE(macro) \
     macro(unguardedBuiltinIsReadableStreamLockedCode, isReadableStreamLocked, s_unguardedBuiltinIsReadableStreamLockedCodeLength) \
-    macro(unguardedBuiltinCancelReadableStreamCode, cancelReadableStream, s_unguardedBuiltinCancelReadableStreamCodeLength) \
-    macro(unguardedBuiltinPromiseInvokeOrNoopCode, promiseInvokeOrNoop, s_unguardedBuiltinPromiseInvokeOrNoopCodeLength) \
 
 #define WEBCORE_FOREACH_UNGUARDEDBUILTIN_BUILTIN_FUNCTION_NAME(macro) \
-    macro(cancelReadableStream) \
     macro(isReadableStreamLocked) \
-    macro(promiseInvokeOrNoop) \
 
 #define DECLARE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \
     JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
@@ -136,43 +122,6 @@ const char* s_unguardedBuiltinIsReadableStreamLockedCode =
     "})\n" \
 ;
 
-const JSC::ConstructAbility s_unguardedBuiltinCancelReadableStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const int s_unguardedBuiltinCancelReadableStreamCodeLength = 402;
-const char* s_unguardedBuiltinCancelReadableStreamCode =
-    "(function (stream, reason)\n" \
-    "{\n" \
-    "    \"use strict\";\n" \
-    "\n" \
-    "    if (stream.@state === @readableStreamClosed)\n" \
-    "        return Promise.resolve();\n" \
-    "    if (stream.@state === @readableStreamErrored)\n" \
-    "        return Promise.reject(stream.@storedError);\n" \
-    "    stream.@queue = [];\n" \
-    "    @finishClosingReadableStream(stream);\n" \
-    "    return @promiseInvokeOrNoop(stream.@underlyingSource, \"cancel\", [reason]).then(function() { });\n" \
-    "})\n" \
-;
-
-const JSC::ConstructAbility s_unguardedBuiltinPromiseInvokeOrNoopCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
-const int s_unguardedBuiltinPromiseInvokeOrNoopCodeLength = 338;
-const char* s_unguardedBuiltinPromiseInvokeOrNoopCode =
-    "(function (object, key, args)\n" \
-    "{\n" \
-    "    \"use strict\";\n" \
-    "\n" \
-    "    try {\n" \
-    "        var method = object[key];\n" \
-    "        if (typeof method === \"undefined\")\n" \
-    "            return Promise.resolve();\n" \
-    "        var result = method.@apply(object, args);\n" \
-    "        return Promise.resolve(result);\n" \
-    "    }\n" \
-    "    catch(error) {\n" \
-    "        return Promise.reject(error);\n" \
-    "    }\n" \
-    "})\n" \
-;
-
 
 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \
 JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
index 868fc6fc6fbf85edd7b8d3c88ec6d22667e1e77d..899cc4e4d0384338795072e199fcd6ca6462b452 100644 (file)
@@ -31,6 +31,8 @@
 #ifndef xmlCasingTestBuiltins_h
 #define xmlCasingTestBuiltins_h
 
+#if ENABLE(STREAMS_API)
+
 #include <builtins/BuiltinUtils.h>
 
 namespace JSC {
@@ -79,6 +81,8 @@ WEBCORE_FOREACH_XMLCASINGTEST_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR)
 
 } // namespace WebCore
 
+#endif // ENABLE(STREAMS_API)
+
 #endif // xmlCasingTestBuiltins_h
 
 ### End File: xmlCasingTestBuiltins.h
@@ -116,6 +120,8 @@ WEBCORE_FOREACH_XMLCASINGTEST_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR)
 #include "config.h"
 #include "xmlCasingTestBuiltins.h"
 
+#if ENABLE(STREAMS_API)
+
 #include "WebCoreJSClientData.h"
 #include <runtime/Executable.h>
 #include <runtime/JSCJSValueInlines.h>
@@ -185,6 +191,9 @@ WEBCORE_FOREACH_XMLCASINGTEST_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
 
 
 } // namespace WebCore
+
+#endif // ENABLE(STREAMS_API)
+
 ### End File: xmlCasingTestBuiltins.cpp
 
 ### Begin File: xmlCasingTestBuiltinsWrapper.h
@@ -220,6 +229,8 @@ WEBCORE_FOREACH_XMLCASINGTEST_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
 #ifndef xmlCasingTestBuiltinsWrapper_h
 #define xmlCasingTestBuiltinsWrapper_h
 
+#if ENABLE(STREAMS_API)
+
 #include "xmlCasingTestBuiltins.h"
 #include <builtins/BuiltinUtils.h>
 #include <bytecode/UnlinkedFunctionExecutable.h>
@@ -313,6 +324,8 @@ inline void xmlCasingTestBuiltinFunctions::visit(JSC::SlotVisitor& visitor)
 
 } // namespace WebCore
 
+#endif // ENABLE(STREAMS_API)
+
 #endif // xmlCasingTestBuiltinsWrapper_h
 
 ### End File: xmlCasingTestBuiltinsWrapper.h
index 00e348fd3396e7d10c3c5bfccd0c37e1b9b88579..76a924826f3934654ca211c2d848c52bb0d2d442 100644 (file)
@@ -1,3 +1,22 @@
+2015-10-28  Brian Burg  <bburg@apple.com>
+
+        Builtins generator should emit ENABLE(FEATURE) guards based on @conditional annotation
+        https://bugs.webkit.org/show_bug.cgi?id=150536
+
+        Reviewed by Yusuke Suzuki.
+
+        Replace @optional=FEATURE with @conditional=ENABLE(FEATURE) in builtins files.
+
+        * Modules/streams/ByteLengthQueuingStrategy.js:
+        * Modules/streams/CountQueuingStrategy.js:
+        * Modules/streams/ReadableStream.js:
+        * Modules/streams/ReadableStreamController.js:
+        * Modules/streams/ReadableStreamInternals.js:
+        * Modules/streams/ReadableStreamReader.js:
+        * Modules/streams/StreamInternals.js:
+        * Modules/streams/WritableStream.js:
+        * Modules/streams/WritableStreamInternals.js:
+
 2015-10-28  Zalan Bujtas  <zalan@apple.com>
 
         Should never be reached failure in WebCore::backgroundRectForBox
index f9481258a05112012ef0d416e9cc46b09411f5ee..59ea2d71d969f225f117217450d5b9edd1e53fa4 100644 (file)
@@ -24,7 +24,7 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-// @optional=STREAMS_API
+// @conditional=ENABLE(STREAMS_API)
 
 function size(chunk)
 {
index 44d630b8b8dc3f224660e9812d3f13f61c682af3..3ae923e5f0c35ba0c8c763d456d8c4119fe117fa 100644 (file)
@@ -23,7 +23,7 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-// @optional=STREAMS_API
+// @conditional=ENABLE(STREAMS_API)
 
 function size()
 {
index 5f56f1ec2f06fe989c0f1074c2ebb481cc1c00b2..694e99fb644e2ea6c5c401f6f0f429d9c29f068b 100644 (file)
@@ -24,7 +24,7 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-// @optional=STREAMS_API
+// @conditional=ENABLE(STREAMS_API)
 
 function initializeReadableStream(underlyingSource, strategy)
 {
index 99f37c9e22f1048562f944853c6aaeedda7d8158..e6a86d2f9c26f30884f9d787e6e39cdbc971800e 100644 (file)
@@ -23,7 +23,7 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-// @optional=STREAMS_API
+// @conditional=ENABLE(STREAMS_API)
 
 function enqueue(chunk)
 {
index 8ad13a709a182dd753b17bc056bbc731e2d5970f..c762e6da033c6a9c8630519323983bf881f9d376 100644 (file)
@@ -24,7 +24,7 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-// @optional=STREAMS_API
+// @conditional=ENABLE(STREAMS_API)
 // @internals
 
 function privateInitializeReadableStreamReader(stream)
index ce273a8d9be3ff543459035f6655fc116d15c0cb..2bd104124c1accbb1f60de0590a4500ffc88aa3f 100644 (file)
@@ -23,7 +23,7 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-// @optional=STREAMS_API
+// @conditional=ENABLE(STREAMS_API)
 
 function cancel(reason)
 {
index 6301ffd40c69eb185cbf23e18c916360e3ce4bdf..cb23af3779d64c1f60a0b6dfd504cc7132e4980b 100644 (file)
@@ -24,7 +24,7 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-// @optional=STREAMS_API
+// @conditional=ENABLE(STREAMS_API)
 // @internals
 
 function invokeOrNoop(object, key, args)
index ee121322375c05779bd652d70cdd3837e6bf65ca..29970590ce747faa0e967fbf66b82142b71416b4 100644 (file)
@@ -24,7 +24,7 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-// @optional=STREAMS_API
+// @conditional=ENABLE(STREAMS_API)
 
 function initializeWritableStream(underlyingSink, strategy)
 {
index a9aee34460f0d96b7483145618c108cd06d94d71..b0ae0ccada7bb7feed7c05e5201f5b47f59bc7bf 100644 (file)
@@ -24,7 +24,7 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-// @optional=STREAMS_API
+// @conditional=ENABLE(STREAMS_API)
 // @internals
 
 function isWritableStream(stream)