Skip to content

Commit

Permalink
[Refactor] add SetDataSize
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Feb 6, 2024
1 parent 7397b7a commit 61639c8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"capIsNewExceptions": [
"RequireObjectCoercible",
"GetSetRecord",
"SetDataSize",
"ToBoolean",

// GetSetRecord
Expand Down
8 changes: 8 additions & 0 deletions aos/SetDataSize.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
'use strict';

var tools = require('es-set/tools');
var $setSize = tools.size;

module.exports = function SetDataSize(setData) {
return $setSize(setData);
};
3 changes: 2 additions & 1 deletion implementation.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ var $Set = require('es-set/polyfill')();

var Call = require('es-abstract/2023/Call');
var GetSetRecord = require('./aos/GetSetRecord');
var SetDataSize = require('./aos/SetDataSize');
var ToBoolean = require('es-abstract/2023/ToBoolean');

var isSet = require('is-set');
Expand All @@ -24,7 +25,7 @@ module.exports = function isSubsetOf(other) {

var otherRec = GetSetRecord(other); // step 3

var thisSize = $setSize(O); // step 4
var thisSize = SetDataSize(O); // step 4

if (thisSize > otherRec['[[Size]]']) {
return false; // step 5
Expand Down

0 comments on commit 61639c8

Please sign in to comment.