Skip to content

Commit

Permalink
[patch] remove GetKeysIterator and its callable check
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Jul 18, 2023
1 parent 932548f commit 9e0f82f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 37 deletions.
3 changes: 1 addition & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"capIsNewExceptions": [
"RequireObjectCoercible",
"GetIntrinsic",
"GetKeysIterator",
"GetIteratorFromMethod",
"GetSetRecord",
"IteratorClose",
"IteratorStep",
Expand All @@ -22,7 +22,6 @@
"Get",
"ToNumber",
"Type",
// GetKeysIterator
"Type",
"Call",
"Get",
Expand Down
31 changes: 0 additions & 31 deletions aos/GetKeysIterator.js

This file was deleted.

8 changes: 4 additions & 4 deletions implementation.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var $TypeError = GetIntrinsic('%TypeError%');

var $Set = require('es-set/polyfill')();

var GetKeysIterator = require('./aos/GetKeysIterator');
var GetIteratorFromMethod = require('es-abstract/2023/GetIteratorFromMethod');
var GetSetRecord = require('./aos/GetSetRecord');
var IteratorClose = require('es-abstract/2023/IteratorClose');
var IteratorStep = require('es-abstract/2023/IteratorStep');
Expand Down Expand Up @@ -35,15 +35,15 @@ module.exports = function isSupersetOf(other) {
return false; // step 5
}

var keysIter = GetKeysIterator(otherRec); // step 6
var keysIter = GetIteratorFromMethod(otherRec['[[Set]]'], otherRec['[[Keys]]']); // step 6
var next = true; // step 7
while (next) { // step 8
next = IteratorStep(keysIter['[[Iterator]]']); // step 8.a
next = IteratorStep(keysIter); // step 8.a
if (next) { // step 8.b
var nextValue = IteratorValue(next); // step 8.b.i
// if (!SetDataHas(O.[[SetData]], nextValue)) { // step 8.b.ii
if (!$setHas(O, nextValue)) {
IteratorClose(keysIter['[[Iterator]]'], NormalCompletion());
IteratorClose(keysIter, NormalCompletion());
return false;
}
}
Expand Down

0 comments on commit 9e0f82f

Please sign in to comment.