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.
This commit is contained in:
Boris Zbarsky 2016-07-30 01:00:12 -04:00
parent 61e3a83a14
commit 30fb9d7bd3

View File

@ -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)