main
Last change
on this file since d565449 was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
517 bytes
|
Rev | Line | |
---|
[d565449] | 1 | 'use strict';
|
---|
| 2 |
|
---|
| 3 | var $TypeError = require('es-errors/type');
|
---|
| 4 |
|
---|
| 5 | var isRegExpRecord = require('../helpers/records/regexp-record');
|
---|
| 6 |
|
---|
| 7 | // https://262.ecma-international.org/15.0/#sec-runtime-semantics-haseitherunicodeflag-abstract-operation
|
---|
| 8 |
|
---|
| 9 | module.exports = function HasEitherUnicodeFlag(rer) {
|
---|
| 10 | if (!isRegExpRecord(rer)) {
|
---|
| 11 | throw new $TypeError('Assertion failed: `rer` must be a RegExp Record');
|
---|
| 12 | }
|
---|
| 13 |
|
---|
| 14 | if (rer['[[Unicode]]'] || rer['[[UnicodeSets]]']) { // step 1
|
---|
| 15 | return true; // step 1.a
|
---|
| 16 | }
|
---|
| 17 | return false; // step 2
|
---|
| 18 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.