source: frontend/node_modules/es-abstract/2024/AllCharacters.js

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

Fix frontend appearance

  • Property mode set to 100644
File size: 1.1 KB
Line 
1'use strict';
2
3var $TypeError = require('es-errors/type');
4
5var HasEitherUnicodeFlag = require('./HasEitherUnicodeFlag');
6
7var isRegExpRecord = require('../helpers/records/regexp-record');
8
9var CharSet = require('../helpers/CharSet');
10
11// https://262.ecma-international.org/15.0/#sec-allcharacters
12
13module.exports = function AllCharacters(rer) {
14 if (!isRegExpRecord(rer)) {
15 throw new $TypeError('Assertion failed: `rer` must be a RegExp Record');
16 }
17
18 if (rer['[[UnicodeSets]]'] && rer['[[IgnoreCase]]']) { // step 1
19 // 1. Return the CharSet containing all Unicode code points _c_ that do not have a <a href="https://www.unicode.org/reports/tr44/#Simple_Case_Folding">Simple Case Folding</a> mapping (that is, scf(_c_)=_c_).
20 return CharSet.getNonSimpleCaseFoldingCodePoints(); // step 1.a
21 } else if (HasEitherUnicodeFlag(rer)) { // step 2
22 // 1. Return the CharSet containing all code point values.
23 return CharSet.getCodePoints(); // step 3.a
24 // eslint-disable-next-line no-else-return
25 } else { // step 3
26 // 1. Return the CharSet containing all code unit values.
27 return CharSet.getCodeUnits(); // step 3.a
28 }
29};
Note: See TracBrowser for help on using the repository browser.