Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9341606
es.regexp.test.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
es.regexp.test.js
View Options
'use strict'
;
// TODO: Remove from `core-js@4` since it's moved to entry points
require
(
'../modules/es.regexp.exec'
);
var
$
=
require
(
'../internals/export'
);
var
call
=
require
(
'../internals/function-call'
);
var
uncurryThis
=
require
(
'../internals/function-uncurry-this'
);
var
isCallable
=
require
(
'../internals/is-callable'
);
var
isObject
=
require
(
'../internals/is-object'
);
var
DELEGATES_TO_EXEC
=
function
()
{
var
execCalled
=
false
;
var
re
=
/[ac]/
;
re
.
exec
=
function
()
{
execCalled
=
true
;
return
/./
.
exec
.
apply
(
this
,
arguments
);
};
return
re
.
test
(
'abc'
)
===
true
&&
execCalled
;
}();
var
$TypeError
=
TypeError
;
var
un$Test
=
uncurryThis
(
/./
.
test
);
// `RegExp.prototype.test` method
// https://tc39.es/ecma262/#sec-regexp.prototype.test
$
({
target
:
'RegExp'
,
proto
:
true
,
forced
:
!
DELEGATES_TO_EXEC
},
{
test
:
function
(
str
)
{
var
exec
=
this
.
exec
;
if
(
!
isCallable
(
exec
))
return
un$Test
(
this
,
str
);
var
result
=
call
(
exec
,
this
,
str
);
if
(
result
!==
null
&&
!
isObject
(
result
))
{
throw
new
$TypeError
(
'RegExp exec method returned something other than an Object or null'
);
}
return
!!
result
;
}
});
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jul 4, 12:10 PM (2 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3356644
Attached To
rDWAPPS Web applications
Event Timeline
Log In to Comment