source: frontend/node_modules/es-abstract/2025/SetDataHas.js

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 13 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 756 bytes
RevLine 
[9af201e]1'use strict';
2
3var $TypeError = require('es-errors/type');
4
5var CanonicalizeKeyedCollectionKey = require('./CanonicalizeKeyedCollectionKey');
6var IsArray = require('./IsArray');
7var SameValue = require('./SameValue');
8
9var some = require('../helpers/some');
10
11// https://262.ecma-international.org/16.0/#sec-setdatahas
12
13module.exports = function SetDataHas(setData, value) {
14 if (!IsArray(setData) && setData !== 'EMPTY') {
15 throw new $TypeError('Assertion failed: `setData` must be a List or ~EMPTY~');
16 }
17
18 // if (SetDataIndex(setData, value) === 'NOT-FOUND') { return false; } // step 1
19 // return true; // step 2
20
21 var canonValue = CanonicalizeKeyedCollectionKey(value);
22
23 return some(setData, function (e) {
24 return SameValue(e, canonValue);
25 });
26};
Note: See TracBrowser for help on using the repository browser.