Bug 1535647. Disallow nullable types for WebIDL constants. r=qdot
authorBoris Zbarsky <bzbarsky@mit.edu>
Sat, 16 Mar 2019 00:37:53 +0000
changeset 522361 2f4bd03bfc3568c8fb27667efb9a63dbaebf9d0f
parent 522360 fbfeb6efec16dc63340328ac30946c25d35aead8
child 522362 536a6957d254ec3f91e2c80c5b9ef8eb592da14c
push id10871
push usercbrindusan@mozilla.com
push dateMon, 18 Mar 2019 15:49:32 +0000
treeherdermozilla-beta@018abdd16060 [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):