Update checked-in dependencies
This commit is contained in:
parent
1afca056e3
commit
6989ba7bd2
3942 changed files with 55190 additions and 132206 deletions
13
node_modules/es-abstract/2022/GetMatchString.js
generated
vendored
13
node_modules/es-abstract/2022/GetMatchString.js
generated
vendored
|
|
@ -1,21 +1,20 @@
|
|||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('get-intrinsic');
|
||||
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
var $TypeError = require('es-errors/type');
|
||||
|
||||
var substring = require('./substring');
|
||||
var Type = require('./Type');
|
||||
|
||||
var assertRecord = require('../helpers/assertRecord');
|
||||
var isMatchRecord = require('../helpers/records/match-record');
|
||||
|
||||
// https://262.ecma-international.org/13.0/#sec-getmatchstring
|
||||
|
||||
module.exports = function GetMatchString(S, match) {
|
||||
if (Type(S) !== 'String') {
|
||||
if (typeof S !== 'string') {
|
||||
throw new $TypeError('Assertion failed: `S` must be a String');
|
||||
}
|
||||
assertRecord(Type, 'Match Record', 'match', match);
|
||||
if (!isMatchRecord(match)) {
|
||||
throw new $TypeError('Assertion failed: `match` must be a Match Record');
|
||||
}
|
||||
|
||||
if (!(match['[[StartIndex]]'] <= S.length)) {
|
||||
throw new $TypeError('`match` [[StartIndex]] must be a non-negative integer <= the length of S');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue