Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9338807
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
995 B
Subscribers
None
es.regexp.sticky.js
View Options
var
DESCRIPTORS
=
require
(
'../internals/descriptors'
);
var
MISSED_STICKY
=
require
(
'../internals/regexp-sticky-helpers'
).
MISSED_STICKY
;
var
classof
=
require
(
'../internals/classof-raw'
);
var
defineBuiltInAccessor
=
require
(
'../internals/define-built-in-accessor'
);
var
getInternalState
=
require
(
'../internals/internal-state'
).
get
;
var
RegExpPrototype
=
RegExp
.
prototype
;
var
$TypeError
=
TypeError
;
// `RegExp.prototype.sticky` getter
// https://tc39.es/ecma262/#sec-get-regexp.prototype.sticky
if
(
DESCRIPTORS
&&
MISSED_STICKY
)
{
defineBuiltInAccessor
(
RegExpPrototype
,
'sticky'
,
{
configurable
:
true
,
get
:
function
sticky
()
{
if
(
this
===
RegExpPrototype
)
return
undefined
;
// We can't use InternalStateModule.getterFor because
// we don't add metadata for regexps created by a literal.
if
(
classof
(
this
)
===
'RegExp'
)
{
return
!!
getInternalState
(
this
).
sticky
;
}
throw
$TypeError
(
'Incompatible receiver, RegExp required'
);
}
});
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Jul 4 2025, 9:08 AM (6 w, 3 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3350587
Attached To
rDWAPPS Web applications
Event Timeline
Log In to Comment