Bug 1474369 - Part 8: Rename from Sequence to Array in xpidl, r=mccr8
☠☠ backed out by 113e9ca0b5bc ☠ ☠
authorNika Layzell <nika@thelayzells.com>
Tue, 24 Jul 2018 16:31:09 -0400
changeset 428374 79dbf5b9d8db577bba582a0853eb293d80eed0ba
parent 428373 7e2e13953e19169da602f50c51c7edc9b7706200
child 428375 113e9ca0b5bccaf3eaee398e789f9b7b8c226009
push id105679
push usernika@thelayzells.com
push dateWed, 25 Jul 2018 19:38:47 +0000
treeherdermozilla-inbound@79dbf5b9d8db [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmccr8
bugs1474369
milestone63.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 1474369 - Part 8: Rename from Sequence to Array in xpidl, r=mccr8 Summary: This more closely matches the C++ names, and reflects the fact that the reflected type is not WebIDL's mozilla::dom::Sequence. The reasoning behind this type difference is for ergonomics, due to xpidl only being exposed to internal JS code. Depends On D2335 Reviewers: mccr8! Tags: #secure-revision Bug #: 1474369 Differential Revision: https://phabricator.services.mozilla.com/D2337
js/xpconnect/src/XPCConvert.cpp
js/xpconnect/src/XPCWrappedNative.cpp
js/xpconnect/tests/idl/xpctest_params.idl
xpcom/idl-parser/xpidl/jsonxpt.py
xpcom/idl-parser/xpidl/xpidl.py
xpcom/reflect/xptcall/xptcall.h
xpcom/reflect/xptinfo/xptcodegen.py
xpcom/reflect/xptinfo/xptinfo.h
--- a/js/xpconnect/src/XPCConvert.cpp
+++ b/js/xpconnect/src/XPCConvert.cpp
@@ -384,21 +384,21 @@ XPCConvert::NativeData2JS(MutableHandleV
         d.setObject(*jsobj);
         return true;
     }
 
     case nsXPTType::T_LEGACY_ARRAY:
         return NativeArray2JS(d, *static_cast<const void* const*>(s),
                               type.ArrayElementType(), iid, arrlen, pErr);
 
-    case nsXPTType::T_SEQUENCE:
+    case nsXPTType::T_ARRAY:
     {
-        auto* sequence = static_cast<const xpt::detail::UntypedSequence*>(s);
-        return NativeArray2JS(d, sequence->Elements(), type.ArrayElementType(),
-                              iid, sequence->Length(), pErr);
+        auto* array = static_cast<const xpt::detail::UntypedTArray*>(s);
+        return NativeArray2JS(d, array->Elements(), type.ArrayElementType(),
+                              iid, array->Length(), pErr);
     }
 
     default:
         NS_ERROR("bad type");
         return false;
     }
     return true;
 }
@@ -880,19 +880,19 @@ XPCConvert::JSData2Native(void* d, Handl
         if (!ok && *dest) {
             // An error occurred, free any allocated backing buffer.
             free(*dest);
             *dest = nullptr;
         }
         return ok;
     }
 
-    case nsXPTType::T_SEQUENCE:
+    case nsXPTType::T_ARRAY:
     {
-        auto* dest = (xpt::detail::UntypedSequence*)d;
+        auto* dest = (xpt::detail::UntypedTArray*)d;
         const nsXPTType& elty = type.ArrayElementType();
 
         bool ok = JSArray2Native(s, elty, iid, pErr, [&] (uint32_t* aLength) -> void* {
             if (!dest->SetLength(elty, *aLength)) {
                 if (pErr)
                     *pErr = NS_ERROR_OUT_OF_MEMORY;
                 return nullptr;
             }
@@ -1593,39 +1593,39 @@ xpc::InnerCleanupValue(const nsXPTType& 
         case nsXPTType::T_IID:
         case nsXPTType::T_CHAR_STR:
         case nsXPTType::T_WCHAR_STR:
         case nsXPTType::T_PSTRING_SIZE_IS:
         case nsXPTType::T_PWSTRING_SIZE_IS:
             free(*(void**)aValue);
             break;
 
-        // Array Types
+        // Legacy Array Type
         case nsXPTType::T_LEGACY_ARRAY:
         {
             const nsXPTType& elty = aType.ArrayElementType();
             void* elements = *(void**)aValue;
 
             for (uint32_t i = 0; i < aArrayLen; ++i) {
                 CleanupValue(elty, elty.ElementPtr(elements, i));
             }
             free(elements);
             break;
         }
 
-        // Sequence Type
-        case nsXPTType::T_SEQUENCE:
+        // Array Type
+        case nsXPTType::T_ARRAY:
         {
             const nsXPTType& elty = aType.ArrayElementType();
-            auto* sequence = (xpt::detail::UntypedSequence*)aValue;
+            auto* array = (xpt::detail::UntypedTArray*)aValue;
 
-            for (uint32_t i = 0; i < sequence->Length(); ++i) {
-                CleanupValue(elty, elty.ElementPtr(sequence->Elements(), i));
+            for (uint32_t i = 0; i < array->Length(); ++i) {
+                CleanupValue(elty, elty.ElementPtr(array->Elements(), i));
             }
-            sequence->Clear();
+            array->Clear();
             break;
         }
 
         // Clear the JS::Value to `undefined`
         case nsXPTType::T_JSVAL:
             ((JS::Value*)aValue)->setUndefined();
             break;
 
@@ -1661,18 +1661,18 @@ xpc::InitializeValue(const nsXPTType& aT
         case nsXPTType::T_DOMSTRING:
             new (aValue) nsString();
             break;
         case nsXPTType::T_CSTRING:
         case nsXPTType::T_UTF8STRING:
             new (aValue) nsCString();
             break;
 
-        case nsXPTType::T_SEQUENCE:
-            new (aValue) xpt::detail::UntypedSequence();
+        case nsXPTType::T_ARRAY:
+            new (aValue) xpt::detail::UntypedTArray();
             break;
 
         // The remaining types all have valid states where all bytes are '0'.
         default:
             aType.ZeroValue(aValue);
             break;
     }
 }
--- a/js/xpconnect/src/XPCWrappedNative.cpp
+++ b/js/xpconnect/src/XPCWrappedNative.cpp
@@ -1675,22 +1675,22 @@ CallMethodHelper::Invoke()
 
 static void
 TraceParam(JSTracer* aTrc, void* aVal, const nsXPTType& aType,
            uint32_t aArrayLen = 0)
 {
     if (aType.Tag() == nsXPTType::T_JSVAL) {
         JS::UnsafeTraceRoot(aTrc, (JS::Value*)aVal,
                             "XPCWrappedNative::CallMethod param");
-    } else if (aType.Tag() == nsXPTType::T_SEQUENCE) {
-        auto* sequence = (xpt::detail::UntypedSequence*)aVal;
+    } else if (aType.Tag() == nsXPTType::T_ARRAY) {
+        auto* array = (xpt::detail::UntypedTArray*)aVal;
         const nsXPTType& elty = aType.ArrayElementType();
 
-        for (uint32_t i = 0; i < sequence->Length(); ++i) {
-            TraceParam(aTrc, elty.ElementPtr(sequence->Elements(), i), elty);
+        for (uint32_t i = 0; i < array->Length(); ++i) {
+            TraceParam(aTrc, elty.ElementPtr(array->Elements(), i), elty);
         }
     } else if (aType.Tag() == nsXPTType::T_LEGACY_ARRAY && *(void**)aVal) {
         const nsXPTType& elty = aType.ArrayElementType();
 
         for (uint32_t i = 0; i < aArrayLen; ++i) {
             TraceParam(aTrc, elty.ElementPtr(*(void**)aVal, i), elty);
         }
     }
--- a/js/xpconnect/tests/idl/xpctest_params.idl
+++ b/js/xpconnect/tests/idl/xpctest_params.idl
@@ -34,28 +34,28 @@ interface nsIXPCTestParams : nsISupports
   wchar                 testWchar(in wchar a, inout wchar b);
   wstring               testWstring(in wstring a, inout wstring b);
   DOMString             testDOMString(in DOMString a, inout DOMString b);
   AString               testAString(in AString a, inout AString b);
   AUTF8String           testAUTF8String(in AUTF8String a, inout AUTF8String b);
   ACString              testACString(in ACString a, inout ACString b);
   jsval                 testJsval(in jsval a, inout jsval b);
 
-  // Test various forms of the Sequence<T> type.
-  Sequence<short>       testShortSequence(in Sequence<short> a, inout Sequence<short> b);
-  Sequence<double>      testDoubleSequence(in Sequence<double> a, inout Sequence<double> b);
-  Sequence<nsIXPCTestInterfaceA> testInterfaceSequence(in Sequence<nsIXPCTestInterfaceA> a, inout Sequence<nsIXPCTestInterfaceA> b);
-  Sequence<AString>     testAStringSequence(in Sequence<AString> a, inout Sequence<AString> b);
-  Sequence<ACString>    testACStringSequence(in Sequence<ACString> a, inout Sequence<ACString> b);
-  Sequence<jsval>       testJsvalSequence(in Sequence<jsval> a, inout Sequence<jsval> b);
-  Sequence<Sequence<short> > testSequenceSequence(in Sequence<Sequence<short> > a, inout Sequence<Sequence<short> > b);
+  // Test various forms of the Array<T> type.
+  Array<short>          testShortSequence(in Array<short> a, inout Array<short> b);
+  Array<double>         testDoubleSequence(in Array<double> a, inout Array<double> b);
+  Array<nsIXPCTestInterfaceA> testInterfaceSequence(in Array<nsIXPCTestInterfaceA> a, inout Array<nsIXPCTestInterfaceA> b);
+  Array<AString>        testAStringSequence(in Array<AString> a, inout Array<AString> b);
+  Array<ACString>       testACStringSequence(in Array<ACString> a, inout Array<ACString> b);
+  Array<jsval>          testJsvalSequence(in Array<jsval> a, inout Array<jsval> b);
+  Array<Array<short> >  testSequenceSequence(in Array<Array<short> > a, inout Array<Array<short> > b);
 
-  void                  testInterfaceIsSequence(in nsIIDPtr aIID, [iid_is(aIID)] in Sequence<nsQIResult> a,
-                                                inout nsIIDPtr bIID, [iid_is(bIID)] inout Sequence<nsQIResult> b,
-                                                out nsIIDPtr rvIID, [retval, iid_is(rvIID)] out Sequence<nsQIResult> rv);
+  void                  testInterfaceIsSequence(in nsIIDPtr aIID, [iid_is(aIID)] in Array<nsQIResult> a,
+                                                inout nsIIDPtr bIID, [iid_is(bIID)] inout Array<nsQIResult> b,
+                                                out nsIIDPtr rvIID, [retval, iid_is(rvIID)] out Array<nsQIResult> rv);
 
   //
   // Dependent parameters use the same types as above, but are handled much differently.
   //
 
   // Test arrays.
   void                  testShortArray(in unsigned long aLength, [array, size_is(aLength)] in short a,
                                        inout unsigned long bLength, [array, size_is(bLength)] inout short b,
--- a/xpcom/idl-parser/xpidl/jsonxpt.py
+++ b/xpcom/idl-parser/xpidl/jsonxpt.py
@@ -57,21 +57,21 @@ def get_type(type, calltype, iid_is=None
 
     if isinstance(type, xpidl.Builtin):
         ret = {'tag': TypeMap[type.name]}
         if type.name in ['string', 'wstring'] and size_is is not None:
             ret['tag'] += '_SIZE_IS'
             ret['size_is'] = size_is
         return ret
 
-    if isinstance(type, xpidl.Sequence):
-        # NB: For a Sequence<T> we pass down the iid_is to get the type of T.
+    if isinstance(type, xpidl.Array):
+        # NB: For a Array<T> we pass down the iid_is to get the type of T.
         #     This allows Arrays of InterfaceIs types to work.
         return {
-            'tag': 'TD_SEQUENCE',
+            'tag': 'TD_ARRAY',
             'element': get_type(type.type, calltype, iid_is),
         }
 
     if isinstance(type, xpidl.LegacyArray):
         # NB: For a Legacy [array] T we pass down iid_is to get the type of T.
         #     This allows [array] of InterfaceIs types to work.
         return {
             'tag': 'TD_LEGACY_ARRAY',
--- a/xpcom/idl-parser/xpidl/xpidl.py
+++ b/xpcom/idl-parser/xpidl/xpidl.py
@@ -128,17 +128,17 @@ class Builtin(object):
         return True
 
     def isPointer(self):
         """Check if this type is a pointer type - this will control how pointers act"""
         return self.nativename.endswith('*')
 
     def nativeType(self, calltype, shared=False, const=False):
         if self.name in ["string", "wstring"] and calltype == 'element':
-            raise IDLError("Use string class types for string Sequence elements", self.location)
+            raise IDLError("Use string class types for string Array elements", self.location)
 
         if const:
             print >>sys.stderr, IDLError(
                 "[const] doesn't make sense on builtin types.", self.location, warning=True)
             const = 'const '
         elif calltype == 'in' and self.isPointer():
             const = 'const '
         elif shared:
@@ -328,21 +328,21 @@ class IDL(object):
         self.hasSequence = False
         self.productions = productions
         self.deps = []
 
     def setName(self, object):
         self.namemap.set(object)
 
     def getName(self, id, location):
-        if id.name == 'Sequence':
+        if id.name == 'Array':
             if id.params is None or len(id.params) != 1:
-                raise IDLError("Sequence takes exactly 1 parameter", location)
+                raise IDLError("Array takes exactly 1 parameter", location)
             self.hasSequence = True
-            return Sequence(self.getName(id.params[0], location), location)
+            return Array(self.getName(id.params[0], location), location)
 
         if id.params is not None:
             raise IDLError("Generic type '%s' unrecognized" % id.name, location)
 
         try:
             return self.namemap[id.name]
         except KeyError:
             raise IDLError("type '%s' not found" % id.name, location)
@@ -554,27 +554,27 @@ class Native(object):
                 return self.nativename[2] + ' '
 
         # 'in' nsid parameters should be made 'const'
         if self.specialtype == 'nsid' and calltype == 'in':
             const = True
 
         if calltype == 'element':
             if self.isRef(calltype):
-                raise IDLError("[ref] qualified type unsupported in Sequence<T>", self.location)
+                raise IDLError("[ref] qualified type unsupported in Array<T>", self.location)
 
-            # Promises should be held in RefPtr<T> in Sequence<T>s
+            # Promises should be held in RefPtr<T> in Array<T>s
             if self.specialtype == 'promise':
                 return 'RefPtr<mozilla::dom::Promise>'
 
-            # We don't support nsIDPtr, in Sequence<T> currently, although
-            # this or support for Sequence<nsID> will be needed to replace
+            # We don't support nsIDPtr, in Array<T> currently, although
+            # this or support for Array<nsID> will be needed to replace
             # [array] completely.
             if self.specialtype == 'nsid':
-                raise IDLError("Sequence<nsIDPtr> not yet supported. "
+                raise IDLError("Array<nsIDPtr> not yet supported. "
                                "File an XPConnect bug if you need it.", self.location)
 
         if self.isRef(calltype):
             m = '& '  # [ref] is always passed with a single indirection
         else:
             m = '* ' if 'out' in calltype else ''
             if self.isPtr(calltype):
                 m += '* '
@@ -1273,49 +1273,49 @@ class LegacyArray(object):
                             '*' if 'out' in calltype else '')
 
     def rustType(self, calltype, const=False):
         return "%s%s%s" % ('*mut ' if 'out' in calltype else '',
                            '*const ' if const else '*mut ',
                            self.type.rustType('legacyelement'))
 
 
-class Sequence(object):
-    kind = 'sequence'
+class Array(object):
+    kind = 'array'
 
     def __init__(self, type, location):
         self.type = type
         self.location = location
 
     @property
     def name(self):
-        return "Sequence<%s>" % self.type.name
+        return "Array<%s>" % self.type.name
 
     def resolve(self, idl):
         idl.getName(self.type, self.location)
 
     def isScriptable(self):
         return self.type.isScriptable()
 
     def nativeType(self, calltype):
         if calltype == 'legacyelement':
-            raise IDLError("[array] Sequence<T> is unsupported", self.location)
+            raise IDLError("[array] Array<T> is unsupported", self.location)
 
         base = 'nsTArray<%s>' % self.type.nativeType('element')
         if 'out' in calltype:
             return '%s& ' % base
         elif 'in' == calltype:
             return 'const %s& ' % base
         else:
             return base
 
     def rustType(self, calltype):
         # NOTE: To add Rust support, ensure 'element' is handled correctly in
         # all rustType callees.
-        raise RustNoncompat("Sequence<...> types")
+        raise RustNoncompat("Array<...> types")
 
 
 TypeId = namedtuple('TypeId', 'name params')
 
 
 # Make str(TypeId) produce a nicer value
 TypeId.__str__ = lambda self: \
     "%s<%s>" % (self.name, ', '.join(str(p) for p in self.params)) \
--- a/xpcom/reflect/xptcall/xptcall.h
+++ b/xpcom/reflect/xptcall/xptcall.h
@@ -53,17 +53,17 @@ struct nsXPTCVariant
     //
     // nsXPTCVariant contains enough space to store ExtendedVal inline, which
     // can be used to store these types when IsIndirect() is true.
         nsXPTCMiniVariant mini;
 
         nsCString  nscstr;
         nsString   nsstr;
         JS::Value  jsval;
-        xpt::detail::UntypedSequence sequence;
+        xpt::detail::UntypedTArray array;
 
         // This type contains non-standard-layout types, so needs an explicit
         // Ctor/Dtor - we'll just delete them.
         ExtendedVal() = delete;
         ~ExtendedVal() = delete;
     };
 
     union
--- a/xpcom/reflect/xptinfo/xptcodegen.py
+++ b/xpcom/reflect/xptinfo/xptcodegen.py
@@ -260,17 +260,17 @@ def link_to_cpp(interfaces, fd):
         idx = type_cache.get(key)
         if idx is None:
             idx = type_cache[key] = len(types)
             types.append(lower_type(type))
         return idx
 
     def describe_type(type):  # Create the type's documentation comment.
         tag = type['tag'][3:].lower()
-        if tag == 'array':
+        if tag == 'legacy_array':
             return '%s[size_is=%d]' % (
                 describe_type(type['element']), type['size_is'])
         elif tag == 'interface_type' or tag == 'domobject':
             return type['name']
         elif tag == 'interface_is_type':
             return 'iid_is(%d)' % type['iid_is']
         elif tag.endswith('_size_is'):
             return '%s(size_is=%d)' % (tag, type['size_is'])
@@ -279,18 +279,18 @@ def link_to_cpp(interfaces, fd):
     def lower_type(type, in_=False, out=False, optional=False):
         tag = type['tag']
         d1 = d2 = 0
 
         if tag == 'TD_LEGACY_ARRAY':
             d1 = type['size_is']
             d2 = lower_extra_type(type['element'])
 
-        elif tag == 'TD_SEQUENCE':
-            # NOTE: TD_SEQUENCE can hold 16 bits of type index, while
+        elif tag == 'TD_ARRAY':
+            # NOTE: TD_ARRAY can hold 16 bits of type index, while
             # TD_LEGACY_ARRAY can only hold 8.
             d1, d2 = splitint(lower_extra_type(type['element']))
 
         elif tag == 'TD_INTERFACE_TYPE':
             d1, d2 = splitint(interface_idx(type['name']))
 
         elif tag == 'TD_INTERFACE_IS_TYPE':
             d1 = type['iid_is']
--- a/xpcom/reflect/xptinfo/xptinfo.h
+++ b/xpcom/reflect/xptinfo/xptinfo.h
@@ -199,18 +199,18 @@ enum nsXPTTypeTag : uint8_t
   //  - Always passed indirectly,
   //  - Outparams must be initialized by caller,
   //  - Supported in xptcall due to indirection.
   TD_DOMSTRING         = 24,
   TD_UTF8STRING        = 25,
   TD_CSTRING           = 26,
   TD_ASTRING           = 27,
   TD_JSVAL             = 28,
-  TD_SEQUENCE          = 29,
-  _TD_LAST_COMPLEX     = TD_SEQUENCE
+  TD_ARRAY             = 29,
+  _TD_LAST_COMPLEX     = TD_ARRAY
 };
 
 static_assert(_TD_LAST_COMPLEX < 32, "nsXPTTypeTag must fit in 5 bits");
 
 
 /*
  * A nsXPTType is a union used to identify the type of a method argument or
  * return value. The internal data is stored as an 5-bit tag, and two 8-bit
@@ -239,17 +239,17 @@ private:
 public:
   // Get the type of the element in the current array or sequence. Arrays only
   // fit 8 bits of type data, while sequences support up to 16 bits of type data
   // due to not needing to store an ArgNum.
   const nsXPTType& ArrayElementType() const {
     if (Tag() == TD_LEGACY_ARRAY) {
       return xpt::detail::GetType(mData2);
     }
-    MOZ_ASSERT(Tag() == TD_SEQUENCE);
+    MOZ_ASSERT(Tag() == TD_ARRAY);
     return xpt::detail::GetType(Data16());
   }
 
   // We store the 16-bit iface value as two 8-bit values in order to
   // avoid 16-bit alignment requirements for XPTTypeDescriptor, which
   // reduces its size and also the size of XPTParamDescriptor.
   const nsXPTInterfaceInfo* GetInterface() const {
     MOZ_ASSERT(Tag() == TD_INTERFACE_TYPE);
@@ -267,24 +267,24 @@ public:
   bool IsPointer() const { return !IsArithmetic() && Tag() <= _TD_LAST_POINTER; }
   bool IsComplex() const { return Tag() > _TD_LAST_POINTER; }
 
   bool IsInterfacePointer() const {
     return Tag() == TD_INTERFACE_TYPE || Tag() == TD_INTERFACE_IS_TYPE;
   }
 
   bool IsDependent() const {
-    return (Tag() == TD_SEQUENCE && InnermostType().IsDependent()) ||
+    return (Tag() == TD_ARRAY && InnermostType().IsDependent()) ||
            Tag() == TD_INTERFACE_IS_TYPE || Tag() == TD_LEGACY_ARRAY ||
            Tag() == TD_PSTRING_SIZE_IS || Tag() == TD_PWSTRING_SIZE_IS;
   }
 
   // Unwrap a nested type to its innermost value (e.g. through arrays).
   const nsXPTType& InnermostType() const {
-    if (Tag() == TD_LEGACY_ARRAY || Tag() == TD_SEQUENCE) {
+    if (Tag() == TD_LEGACY_ARRAY || Tag() == TD_ARRAY) {
       return ArrayElementType().InnermostType();
     }
     return *this;
   }
 
   // In-memory size of native type in bytes.
   inline size_t Stride() const;
 
@@ -363,17 +363,17 @@ public:
   TD_ALIAS_(T_PSTRING_SIZE_IS   , TD_PSTRING_SIZE_IS  );
   TD_ALIAS_(T_PWSTRING_SIZE_IS  , TD_PWSTRING_SIZE_IS );
   TD_ALIAS_(T_UTF8STRING        , TD_UTF8STRING       );
   TD_ALIAS_(T_CSTRING           , TD_CSTRING          );
   TD_ALIAS_(T_ASTRING           , TD_ASTRING          );
   TD_ALIAS_(T_JSVAL             , TD_JSVAL            );
   TD_ALIAS_(T_DOMOBJECT         , TD_DOMOBJECT        );
   TD_ALIAS_(T_PROMISE           , TD_PROMISE          );
-  TD_ALIAS_(T_SEQUENCE          , TD_SEQUENCE         );
+  TD_ALIAS_(T_ARRAY             , TD_ARRAY            );
 #undef TD_ALIAS_
 
   ////////////////////////////////////////////////////////////////
   // Ensure these fields are in the same order as xptcodegen.py //
   ////////////////////////////////////////////////////////////////
 
   uint8_t mTag : 5;
 
@@ -526,19 +526,19 @@ struct nsXPTDOMObjectInfo
   bool (*mWrap) (JSContext* aCx, void* aObj, JS::MutableHandleValue aHandle);
   void (*mCleanup) (void* aObj);
 };
 
 
 namespace xpt {
 namespace detail {
 
-// The UntypedSequence type allows low-level access from XPConnect to nsTArray
+// The UntypedTArray type allows low-level access from XPConnect to nsTArray
 // internals without static knowledge of the array element type in question.
-class UntypedSequence
+class UntypedTArray
   : public nsTArray_base<nsTArrayFallibleAllocator, nsTArray_CopyWithMemutils>
 {
 public:
   void* Elements() const {
     return static_cast<void*>(Hdr() + 1);
   }
 
   // Changes the length and capacity to be at least large enough for aTo elements.
@@ -681,15 +681,15 @@ nsXPTType::Stride() const
     case TD_PWSTRING_SIZE_IS:  return sizeof(char16_t*);
     case TD_DOMOBJECT:         return sizeof(void*);
     case TD_PROMISE:           return sizeof(void*);
 
     case TD_UTF8STRING:        return sizeof(nsCString);
     case TD_CSTRING:           return sizeof(nsCString);
     case TD_ASTRING:           return sizeof(nsString);
     case TD_JSVAL:             return sizeof(JS::Value);
-    case TD_SEQUENCE:          return sizeof(xpt::detail::UntypedSequence);
+    case TD_ARRAY:             return sizeof(xpt::detail::UntypedTArray);
   }
 
   MOZ_CRASH("Unknown type");
 }
 
 #endif /* xptinfo_h */