Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9696544
inherit-if-required.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
736 B
Subscribers
None
inherit-if-required.js
View Options
var
isCallable
=
require
(
'../internals/is-callable'
);
var
isObject
=
require
(
'../internals/is-object'
);
var
setPrototypeOf
=
require
(
'../internals/object-set-prototype-of'
);
// makes subclassing work correct for wrapped built-ins
module
.
exports
=
function
(
$this
,
dummy
,
Wrapper
)
{
var
NewTarget
,
NewTargetPrototype
;
if
(
// it can work only with native `setPrototypeOf`
setPrototypeOf
&&
// we haven't completely correct pre-ES6 way for getting `new.target`, so use this
isCallable
(
NewTarget
=
dummy
.
constructor
)
&&
NewTarget
!==
Wrapper
&&
isObject
(
NewTargetPrototype
=
NewTarget
.
prototype
)
&&
NewTargetPrototype
!==
Wrapper
.
prototype
)
setPrototypeOf
(
$this
,
NewTargetPrototype
);
return
$this
;
};
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Aug 18, 8:32 PM (21 h, 26 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3351374
Attached To
rDWAPPS Web applications
Event Timeline
Log In to Comment