|
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
|
| Rev | Line | |
|---|
| [9af201e] | 1 | 'use strict';
|
|---|
| 2 |
|
|---|
| 3 | var $TypeError = require('es-errors/type');
|
|---|
| 4 |
|
|---|
| 5 | var CanonicalizeKeyedCollectionKey = require('./CanonicalizeKeyedCollectionKey');
|
|---|
| 6 | var IsArray = require('./IsArray');
|
|---|
| 7 | var SameValue = require('./SameValue');
|
|---|
| 8 |
|
|---|
| 9 | var some = require('../helpers/some');
|
|---|
| 10 |
|
|---|
| 11 | // https://262.ecma-international.org/16.0/#sec-setdatahas
|
|---|
| 12 |
|
|---|
| 13 | module.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.