|
'use strict'; |
|
|
|
var reflectGetProto = require('./Reflect.getPrototypeOf'); |
|
var originalGetProto = require('./Object.getPrototypeOf'); |
|
|
|
var getDunderProto = require('dunder-proto/get'); |
|
|
|
|
|
module.exports = reflectGetProto |
|
? function getProto(O) { |
|
|
|
return reflectGetProto(O); |
|
} |
|
: originalGetProto |
|
? function getProto(O) { |
|
if (!O || (typeof O !== 'object' && typeof O !== 'function')) { |
|
throw new TypeError('getProto: not an object'); |
|
} |
|
|
|
return originalGetProto(O); |
|
} |
|
: getDunderProto |
|
? function getProto(O) { |
|
|
|
return getDunderProto(O); |
|
} |
|
: null; |
|
|