Bug 1375829 part 1. Rename isSerializable() to isJSONType(). r=qdot
authorBoris Zbarsky <bzbarsky@mit.edu>
Thu, 17 May 2018 23:39:52 -0400
changeset 418795 db208ef2f3cb
parent 418794 015c85f88d0f
child 418796 5a9cdc8de26a
push id34013
push userdluca@mozilla.com
push date2018-05-18 09:56 +0000
treeherdermozilla-central@11ee70f24ea5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersqdot
bugs1375829
milestone62.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 1375829 part 1. Rename isSerializable() to isJSONType(). r=qdot The spec calls these types "JSON types".
dom/bindings/Codegen.py
dom/bindings/parser/WebIDL.py
--- a/dom/bindings/Codegen.py
+++ b/dom/bindings/Codegen.py
@@ -2889,17 +2889,17 @@ class CGJsonifyAttributesMethod(CGAbstra
                 Argument('JS::Rooted<JSObject*>&', 'aResult')]
         CGAbstractMethod.__init__(self, descriptor, 'JsonifyAttributes',
                                   'bool', args, canRunScript=True)
 
     def definition_body(self):
         ret = ''
         interface = self.descriptor.interface
         for m in interface.members:
-            if m.isAttr() and not m.isStatic() and m.type.isSerializable():
+            if m.isAttr() and not m.isStatic() and m.type.isJSONType():
                 ret += fill(
                     """
                     { // scope for "temp"
                       JS::Rooted<JS::Value> temp(aCx);
                       if (!get_${name}(aCx, obj, self, JSJitGetterCallArgs(&temp))) {
                         return false;
                       }
                       if (!JS_DefineProperty(aCx, aResult, "${name}", temp, JSPROP_ENUMERATE)) {
--- a/dom/bindings/parser/WebIDL.py
+++ b/dom/bindings/parser/WebIDL.py
@@ -2144,17 +2144,17 @@ class IDLType(IDLObject):
 
     def isFloat(self):
         return False
 
     def isUnrestricted(self):
         # Should only call this on float types
         assert self.isFloat()
 
-    def isSerializable(self):
+    def isJSONType(self):
         return False
 
     def tag(self):
         assert False  # Override me!
 
     def treatNonCallableAsNull(self):
         assert self.tag() == IDLType.Tags.callback
         return self.nullable() and self.inner.callback._treatNonCallableAsNull
@@ -2342,18 +2342,18 @@ class IDLNullableType(IDLParametrizedTyp
         return self.inner.isNonCallbackInterface()
 
     def isEnum(self):
         return self.inner.isEnum()
 
     def isUnion(self):
         return self.inner.isUnion()
 
-    def isSerializable(self):
-        return self.inner.isSerializable()
+    def isJSONType(self):
+        return self.inner.isJSONType()
 
     def tag(self):
         return self.inner.tag()
 
     def complete(self, scope):
         self.inner = self.inner.complete(scope)
         if self.inner.nullable():
             raise WebIDLError("The inner type of a nullable type must not be "
@@ -2422,18 +2422,18 @@ class IDLSequenceType(IDLParametrizedTyp
         return False
 
     def isInterface(self):
         return False
 
     def isEnum(self):
         return False
 
-    def isSerializable(self):
-        return self.inner.isSerializable()
+    def isJSONType(self):
+        return self.inner.isJSONType()
 
     def tag(self):
         return IDLType.Tags.sequence
 
     def complete(self, scope):
         self.inner = self.inner.complete(scope)
         self.name = self.inner.name + "Sequence"
         return self
@@ -2517,18 +2517,18 @@ class IDLUnionType(IDLType):
         return self.name.__hash__()
 
     def isVoid(self):
         return False
 
     def isUnion(self):
         return True
 
-    def isSerializable(self):
-        return all(m.isSerializable() for m in self.memberTypes)
+    def isJSONType(self):
+        return all(m.isJSONType() for m in self.memberTypes)
 
     def includesRestrictedFloat(self):
         return any(t.includesRestrictedFloat() for t in self.memberTypes)
 
     def tag(self):
         return IDLType.Tags.union
 
     def resolveType(self, parentScope):
@@ -2801,25 +2801,25 @@ class IDLWrapperType(IDLType):
         return self.isInterface() and self.inner.isCallback()
 
     def isNonCallbackInterface(self):
         return self.isInterface() and not self.inner.isCallback()
 
     def isEnum(self):
         return isinstance(self.inner, IDLEnum)
 
-    def isSerializable(self):
+    def isJSONType(self):
         if self.isInterface():
             if self.inner.isExternal():
                 return False
             return any(m.isMethod() and m.isJsonifier() for m in self.inner.members)
         elif self.isEnum():
             return True
         elif self.isDictionary():
-            return all(m.type.isSerializable() for m in self.inner.members)
+            return all(m.type.isJSONType() for m in self.inner.members)
         else:
             raise WebIDLError("IDLWrapperType wraps type %s that we don't know if "
                               "is serializable" % type(self.inner), [self.location])
 
     def resolveType(self, parentScope):
         assert isinstance(parentScope, IDLScope)
         self.inner.resolve(parentScope)
 
@@ -3095,17 +3095,17 @@ class IDLBuiltinType(IDLType):
                 self._typeTag == IDLBuiltinType.Types.unrestricted_float or
                 self._typeTag == IDLBuiltinType.Types.unrestricted_double)
 
     def isUnrestricted(self):
         assert self.isFloat()
         return (self._typeTag == IDLBuiltinType.Types.unrestricted_float or
                 self._typeTag == IDLBuiltinType.Types.unrestricted_double)
 
-    def isSerializable(self):
+    def isJSONType(self):
         return self.isPrimitive() or self.isString() or self.isDate()
 
     def includesRestrictedFloat(self):
         return self.isFloat() and not self.isUnrestricted()
 
     def tag(self):
         return IDLBuiltinType.TagLookup[self._typeTag]