Bug 1596025 - Fix non-determinism with WebIDL aliases. r=bzbarsky
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 13 Nov 2019 22:11:20 +0000
changeset 501851 a01e42ada2cdf66cae108e9ef16f3ed2890142e9
parent 501850 4cf8f3f89042f4622a349e2fd75a849155ffa75b
child 501852 597cb65dad667703d23017c879e5b7628015bbb0
push id114172
push userdluca@mozilla.com
push dateTue, 19 Nov 2019 11:31:10 +0000
treeherdermozilla-inbound@b5c5ba07d3db [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbzbarsky
bugs1596025
milestone72.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 1596025 - Fix non-determinism with WebIDL aliases. r=bzbarsky `sorted(aliasedMembers)` looks like it is sorting by `__repr__`, which contains the address of the object, like `<WebIDL.IDLMethod object at 0x7f83be5d8b50>`. Differential Revision: https://phabricator.services.mozilla.com/D52821
dom/bindings/Codegen.py
--- a/dom/bindings/Codegen.py
+++ b/dom/bindings/Codegen.py
@@ -3221,17 +3221,18 @@ class CGCreateInterfaceObjectsMethod(CGA
                     JS::Handle<JSObject*> proto = GetProtoObjectHandle(aCx);
                     if (!proto) {
                       $*{failureCode}
                     }
 
                     """,
                     failureCode=failureCode)),
                 CGGeneric("JS::Rooted<JS::Value> aliasedVal(aCx);\n\n")
-            ] + [defineAliasesFor(m) for m in sorted(aliasedMembers)])
+            ] + [defineAliasesFor(m)
+                 for m in sorted(aliasedMembers, key=lambda m: m.identifier.name)])
         else:
             defineAliases = None
 
         # Globals handle unforgeables directly in Wrap() instead of
         # via a holder.
         if self.descriptor.hasUnforgeableMembers and not self.descriptor.isGlobal():
             assert needInterfacePrototypeObject