source: imaps-frontend/node_modules/es-abstract/2022/RegExpCreate.js

main
Last change on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 643 bytes
Line 
1'use strict';
2
3var GetIntrinsic = require('get-intrinsic');
4
5var $RegExp = GetIntrinsic('%RegExp%');
6
7// var RegExpAlloc = require('./RegExpAlloc');
8// var RegExpInitialize = require('./RegExpInitialize');
9var ToString = require('./ToString');
10
11// https://262.ecma-international.org/6.0/#sec-regexpcreate
12
13module.exports = function RegExpCreate(P, F) {
14 // var obj = RegExpAlloc($RegExp);
15 // return RegExpInitialize(obj, P, F);
16
17 // covers spec mechanics; bypass regex brand checking
18 var pattern = typeof P === 'undefined' ? '' : ToString(P);
19 var flags = typeof F === 'undefined' ? '' : ToString(F);
20 return new $RegExp(pattern, flags);
21};
Note: See TracBrowser for help on using the repository browser.