Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9341580
es.regexp.sticky.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
891 B
Subscribers
None
es.regexp.sticky.js
View Options
var
DESCRIPTORS
=
require
(
'../internals/descriptors'
);
var
UNSUPPORTED_Y
=
require
(
'../internals/regexp-sticky-helpers'
).
UNSUPPORTED_Y
;
var
defineProperty
=
require
(
'../internals/object-define-property'
).
f
;
var
getInternalState
=
require
(
'../internals/internal-state'
).
get
;
var
RegExpPrototype
=
RegExp
.
prototype
;
// `RegExp.prototype.sticky` getter
// https://tc39.es/ecma262/#sec-get-regexp.prototype.sticky
if
(
DESCRIPTORS
&&
UNSUPPORTED_Y
)
{
defineProperty
(
RegExp
.
prototype
,
'sticky'
,
{
configurable
:
true
,
get
:
function
()
{
if
(
this
===
RegExpPrototype
)
return
undefined
;
// We can't use InternalStateModule.getterFor because
// we don't add metadata for regexps created by a literal.
if
(
this
instanceof
RegExp
)
{
return
!!
getInternalState
(
this
).
sticky
;
}
throw
TypeError
(
'Incompatible receiver, RegExp required'
);
}
});
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jul 4, 12:09 PM (2 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3452555
Attached To
rDWAPPS Web applications
Event Timeline
Log In to Comment