зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1782212 - Part 20: Add curly brackets to js/src/builtin/Weak{Map,Set}.js. r=tcampbell
Depends on D153190 Differential Revision: https://phabricator.services.mozilla.com/D153191
This commit is contained in:
Родитель
355e747ac2
Коммит
bcea6ca1f5
|
@ -11,14 +11,16 @@ function WeakMapConstructorInit(iterable) {
|
|||
var adder = map.set;
|
||||
|
||||
// Step 6.b.
|
||||
if (!IsCallable(adder))
|
||||
if (!IsCallable(adder)) {
|
||||
ThrowTypeError(JSMSG_NOT_FUNCTION, typeof adder);
|
||||
}
|
||||
|
||||
// Steps 6.c-8.
|
||||
for (var nextItem of allowContentIter(iterable)) {
|
||||
// Step 8.d.
|
||||
if (!IsObject(nextItem))
|
||||
if (!IsObject(nextItem)) {
|
||||
ThrowTypeError(JSMSG_INVALID_MAP_ITERABLE, "WeakMap");
|
||||
}
|
||||
|
||||
// Steps 8.e-j.
|
||||
callContentFunction(adder, map, nextItem[0], nextItem[1]);
|
||||
|
|
|
@ -11,10 +11,12 @@ function WeakSetConstructorInit(iterable) {
|
|||
var adder = set.add;
|
||||
|
||||
// Step 6.b.
|
||||
if (!IsCallable(adder))
|
||||
if (!IsCallable(adder)) {
|
||||
ThrowTypeError(JSMSG_NOT_FUNCTION, typeof adder);
|
||||
}
|
||||
|
||||
// Steps 6.c-8.
|
||||
for (var nextValue of allowContentIter(iterable))
|
||||
for (var nextValue of allowContentIter(iterable)) {
|
||||
callContentFunction(adder, set, nextValue);
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче