Update checked-in dependencies
This commit is contained in:
parent
1afca056e3
commit
6989ba7bd2
3942 changed files with 55190 additions and 132206 deletions
10
node_modules/es-abstract/2015/AdvanceStringIndex.js
generated
vendored
10
node_modules/es-abstract/2015/AdvanceStringIndex.js
generated
vendored
|
|
@ -1,28 +1,24 @@
|
|||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('get-intrinsic');
|
||||
|
||||
var Type = require('./Type');
|
||||
|
||||
var isInteger = require('../helpers/isInteger');
|
||||
var isLeadingSurrogate = require('../helpers/isLeadingSurrogate');
|
||||
var isTrailingSurrogate = require('../helpers/isTrailingSurrogate');
|
||||
var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger');
|
||||
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
var $TypeError = require('es-errors/type');
|
||||
|
||||
var $charCodeAt = require('call-bind/callBound')('String.prototype.charCodeAt');
|
||||
|
||||
// https://262.ecma-international.org/6.0/#sec-advancestringindex
|
||||
|
||||
module.exports = function AdvanceStringIndex(S, index, unicode) {
|
||||
if (Type(S) !== 'String') {
|
||||
if (typeof S !== 'string') {
|
||||
throw new $TypeError('Assertion failed: `S` must be a String');
|
||||
}
|
||||
if (!isInteger(index) || index < 0 || index > MAX_SAFE_INTEGER) {
|
||||
throw new $TypeError('Assertion failed: `length` must be an integer >= 0 and <= 2**53');
|
||||
}
|
||||
if (Type(unicode) !== 'Boolean') {
|
||||
if (typeof unicode !== 'boolean') {
|
||||
throw new $TypeError('Assertion failed: `unicode` must be a Boolean');
|
||||
}
|
||||
if (!unicode) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue