Bug 1290636. Fix some bugs in the way single-type (value) iterators are hooked up in the Web IDL bindings. r=qdot
authorBoris Zbarsky <bzbarsky@mit.edu>
Sat, 30 Jul 2016 01:00:12 -0400
changeset 347417 6b62785dbfe3b989a089ca7192e224725cc2d61f
parent 347416 ded96a1a5aae33b7700f839e2ff63d364f21142f
child 347418 49efb446f5b0977be697e0277cb27a2d5502fb76
push id6389
push userraliiev@mozilla.com
push dateMon, 19 Sep 2016 13:38:22 +0000
treeherdermozilla-beta@01d67bfe6c81 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersqdot
bugs1290636
milestone50.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 1290636. Fix some bugs in the way single-type (value) iterators are hooked up in the Web IDL bindings. r=qdot There were two issues: 1) The keys/entries/values/forEach properties were being added no matater what the value of the 'unforgeable' boolean was. So we ended up spitting out unforgeable versions of those, and this confused some Xray cases. 2) The number of args listed for forEach was wrong, which hit assertions in the JS engine because the same self-hosted function was being instantiated with different numbers of args from different places.
dom/bindings/Codegen.py
--- a/dom/bindings/Codegen.py
+++ b/dom/bindings/Codegen.py
@@ -2242,16 +2242,17 @@ class MethodDefiner(PropertyDefiner):
                 "length": 0,
                 "flags": "JSPROP_ENUMERATE",
                 "condition": MemberCondition()
             })
 
         # Generate the keys/values/entries aliases for value iterables.
         maplikeOrSetlikeOrIterable = descriptor.interface.maplikeOrSetlikeOrIterable
         if (not static and
+            not unforgeable and
             maplikeOrSetlikeOrIterable and
             maplikeOrSetlikeOrIterable.isIterable() and
             maplikeOrSetlikeOrIterable.isValueIterator()):
             # Add our keys/values/entries/forEach
             self.regular.append({
                 "name": "keys",
                 "methodInfo": False,
                 "selfHostedName": "ArrayKeys",
@@ -2277,17 +2278,17 @@ class MethodDefiner(PropertyDefiner):
                 "flags": "JSPROP_ENUMERATE",
                 "condition": PropertyDefiner.getControllingCondition(m,
                                                                      descriptor)
             })
             self.regular.append({
                 "name": "forEach",
                 "methodInfo": False,
                 "selfHostedName": "ArrayForEach",
-                "length": 0,
+                "length": 1,
                 "flags": "JSPROP_ENUMERATE",
                 "condition": PropertyDefiner.getControllingCondition(m,
                                                                      descriptor)
             })
 
         if not static:
             stringifier = descriptor.operations['Stringifier']
             if (stringifier and