Bug 1535647. Disallow nullable types for WebIDL constants. r=qdot
authorBoris Zbarsky <bzbarsky@mit.edu>
Sat, 16 Mar 2019 00:37:53 +0000
changeset 464471 2f4bd03bfc35
parent 464470 fbfeb6efec16
child 464472 536a6957d254
push id35716
push useraciure@mozilla.com
push dateSun, 17 Mar 2019 09:42:17 +0000
treeherdermozilla-central@8ee97c045359 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersqdot
bugs1535647
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1535647. Disallow nullable types for WebIDL constants. r=qdot These got removed from the spec. Differential Revision: https://phabricator.services.mozilla.com/D23681
dom/bindings/parser/WebIDL.py
--- a/dom/bindings/parser/WebIDL.py
+++ b/dom/bindings/parser/WebIDL.py
@@ -5908,16 +5908,22 @@ class Parser(Tokenizer):
                          | LBRACKET RBRACKET
         """
         if len(p) == 2:
             p[0] = p[1]
         else:
             assert len(p) == 3  # Must be []
             p[0] = IDLEmptySequenceValue(self.getLocation(p, 1))
 
+    def p_DefaultValueNull(self, p):
+        """
+            DefaultValue : NULL
+        """
+        p[0] = IDLNullValue(self.getLocation(p, 1))
+
     def p_Exception(self, p):
         """
             Exception : EXCEPTION IDENTIFIER Inheritance LBRACE ExceptionMembers RBRACE SEMICOLON
         """
         pass
 
     def p_Enum(self, p):
         """
@@ -6037,22 +6043,16 @@ class Parser(Tokenizer):
     def p_ConstValueString(self, p):
         """
             ConstValue : STRING
         """
         location = self.getLocation(p, 1)
         stringType = BuiltinTypes[IDLBuiltinType.Types.domstring]
         p[0] = IDLValue(location, stringType, p[1])
 
-    def p_ConstValueNull(self, p):
-        """
-            ConstValue : NULL
-        """
-        p[0] = IDLNullValue(self.getLocation(p, 1))
-
     def p_BooleanLiteralTrue(self, p):
         """
             BooleanLiteral : TRUE
         """
         p[0] = True
 
     def p_BooleanLiteralFalse(self, p):
         """
@@ -6753,29 +6753,27 @@ class Parser(Tokenizer):
         """
             NonAnyType : DATE Null
         """
         p[0] = self.handleNullable(BuiltinTypes[IDLBuiltinType.Types.date],
                                    p[2])
 
     def p_ConstType(self, p):
         """
-            ConstType : PrimitiveType Null
-        """
-        type = BuiltinTypes[p[1]]
-        p[0] = self.handleNullable(type, p[2])
+            ConstType : PrimitiveType
+        """
+        p[0] = BuiltinTypes[p[1]]
 
     def p_ConstTypeIdentifier(self, p):
         """
-            ConstType : IDENTIFIER Null
+            ConstType : IDENTIFIER
         """
         identifier = IDLUnresolvedIdentifier(self.getLocation(p, 1), p[1])
 
-        type = IDLUnresolvedType(self.getLocation(p, 1), identifier)
-        p[0] = self.handleNullable(type, p[2])
+        p[0] = IDLUnresolvedType(self.getLocation(p, 1), identifier)
 
     def p_PrimitiveTypeUint(self, p):
         """
             PrimitiveType : UnsignedIntegerType
         """
         p[0] = p[1]
 
     def p_PrimitiveTypeBoolean(self, p):