mirror of
https://github.com/Sevichecc/Urara-Blog.git
synced 2025-05-07 04:49:13 +08:00
21 lines
539 B
Text
21 lines
539 B
Text
'use strict';
|
|
|
|
var GetIntrinsic = require('get-intrinsic');
|
|
|
|
var $TypeError = GetIntrinsic('%TypeError%');
|
|
|
|
var $getProto = require('../helpers/getProto');
|
|
|
|
var Type = require('./Type');
|
|
|
|
// https://262.ecma-international.org/7.0/#sec-ordinarygetprototypeof
|
|
|
|
module.exports = function OrdinaryGetPrototypeOf(O) {
|
|
if (Type(O) !== 'Object') {
|
|
throw new $TypeError('Assertion failed: O must be an Object');
|
|
}
|
|
if (!$getProto) {
|
|
throw new $TypeError('This environment does not support fetching prototypes.');
|
|
}
|
|
return $getProto(O);
|
|
};
|