Node-Red configuration
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

es.function.has-instance.js 905B

1234567891011121314151617181920
  1. 'use strict';
  2. var isCallable = require('../internals/is-callable');
  3. var isObject = require('../internals/is-object');
  4. var definePropertyModule = require('../internals/object-define-property');
  5. var isPrototypeOf = require('../internals/object-is-prototype-of');
  6. var wellKnownSymbol = require('../internals/well-known-symbol');
  7. var makeBuiltIn = require('../internals/make-built-in');
  8. var HAS_INSTANCE = wellKnownSymbol('hasInstance');
  9. var FunctionPrototype = Function.prototype;
  10. // `Function.prototype[@@hasInstance]` method
  11. // https://tc39.es/ecma262/#sec-function.prototype-@@hasinstance
  12. if (!(HAS_INSTANCE in FunctionPrototype)) {
  13. definePropertyModule.f(FunctionPrototype, HAS_INSTANCE, { value: makeBuiltIn(function (O) {
  14. if (!isCallable(this) || !isObject(O)) return false;
  15. var P = this.prototype;
  16. return isObject(P) ? isPrototypeOf(P, O) : O instanceof this;
  17. }, HAS_INSTANCE) });
  18. }