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
|
Rev | Line | |
---|
[d565449] | 1 | 'use strict';
|
---|
| 2 |
|
---|
| 3 | var GetIntrinsic = require('get-intrinsic');
|
---|
| 4 |
|
---|
| 5 | var $RegExp = GetIntrinsic('%RegExp%');
|
---|
| 6 |
|
---|
| 7 | // var RegExpAlloc = require('./RegExpAlloc');
|
---|
| 8 | // var RegExpInitialize = require('./RegExpInitialize');
|
---|
| 9 | var ToString = require('./ToString');
|
---|
| 10 |
|
---|
| 11 | // https://262.ecma-international.org/6.0/#sec-regexpcreate
|
---|
| 12 |
|
---|
| 13 | module.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.