massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / core-js / features / instance / at.js
index 736ff4d34bc60b41351f19b2fa312190d1af041e..86ae5cf909188873c368c38c91324af906033d8b 100644 (file)
@@ -1,13 +1,14 @@
-var arrayAt = require('../array/virtual/at');
-var stringAt = require('../string/virtual/at');
+var isPrototypeOf = require('../../internals/object-is-prototype-of');
+var arrayMethod = require('../array/virtual/at');
+var stringMethod = require('../string/virtual/at');
 
 var ArrayPrototype = Array.prototype;
 var StringPrototype = String.prototype;
 
 module.exports = function (it) {
   var own = it.at;
-  if (it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.at)) return arrayAt;
-  if (typeof it === 'string' || it === StringPrototype || (it instanceof String && own === StringPrototype.at)) {
-    return stringAt;
+  if (it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.at)) return arrayMethod;
+  if (typeof it == 'string' || it === StringPrototype || (isPrototypeOf(StringPrototype, it) && own === StringPrototype.at)) {
+    return stringMethod;
   } return own;
 };