From 30fb9d7bd3b552f26fe31b91afb0aad0506412d2 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Sat, 30 Jul 2016 01:00:12 -0400 Subject: [PATCH] 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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dom/bindings/Codegen.py b/dom/bindings/Codegen.py index c7c13bdd242d..748df3bd4830 100644 --- a/dom/bindings/Codegen.py +++ b/dom/bindings/Codegen.py @@ -2247,6 +2247,7 @@ class MethodDefiner(PropertyDefiner): # 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()): @@ -2282,7 +2283,7 @@ class MethodDefiner(PropertyDefiner): "name": "forEach", "methodInfo": False, "selfHostedName": "ArrayForEach", - "length": 0, + "length": 1, "flags": "JSPROP_ENUMERATE", "condition": PropertyDefiner.getControllingCondition(m, descriptor)