Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9696173
object-get-prototype-of.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
922 B
Subscribers
None
object-get-prototype-of.js
View Options
var
hasOwn
=
require
(
'../internals/has-own-property'
);
var
isCallable
=
require
(
'../internals/is-callable'
);
var
toObject
=
require
(
'../internals/to-object'
);
var
sharedKey
=
require
(
'../internals/shared-key'
);
var
CORRECT_PROTOTYPE_GETTER
=
require
(
'../internals/correct-prototype-getter'
);
var
IE_PROTO
=
sharedKey
(
'IE_PROTO'
);
var
$Object
=
Object
;
var
ObjectPrototype
=
$Object
.
prototype
;
// `Object.getPrototypeOf` method
// https://tc39.es/ecma262/#sec-object.getprototypeof
// eslint-disable-next-line es/no-object-getprototypeof -- safe
module
.
exports
=
CORRECT_PROTOTYPE_GETTER
?
$Object
.
getPrototypeOf
:
function
(
O
)
{
var
object
=
toObject
(
O
);
if
(
hasOwn
(
object
,
IE_PROTO
))
return
object
[
IE_PROTO
];
var
constructor
=
object
.
constructor
;
if
(
isCallable
(
constructor
)
&&
object
instanceof
constructor
)
{
return
constructor
.
prototype
;
}
return
object
instanceof
$Object
?
ObjectPrototype
:
null
;
};
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Aug 18, 7:13 PM (2 w, 20 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3426462
Attached To
rDWAPPS Web applications
Event Timeline
Log In to Comment