0
0
mirror of https://github.com/Doodle3D/Doodle3D-API synced 2024-12-23 14:13:47 +01:00
Doodle3D-API/jspm_packages/npm/core-js@0.9.18/modules/es6.function.has-instance.js
2015-07-15 15:06:18 +02:00

16 lines
488 B
JavaScript

/* */
var $ = require("./$"),
HAS_INSTANCE = require("./$.wks")('hasInstance'),
FunctionProto = Function.prototype;
if (!(HAS_INSTANCE in FunctionProto))
$.setDesc(FunctionProto, HAS_INSTANCE, {value: function(O) {
if (!$.isFunction(this) || !$.isObject(O))
return false;
if (!$.isObject(this.prototype))
return O instanceof this;
while (O = $.getProto(O))
if (this.prototype === O)
return true;
return false;
}});