We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3b7eadf commit e1b9757Copy full SHA for e1b9757
src/utils.ts
@@ -2,7 +2,13 @@ import Vue from 'vue';
2
3
const toString = (x: any) => Object.prototype.toString.call(x);
4
5
-export const hasSymbol = typeof Symbol === 'function' && Symbol.for;
+export function isNative (Ctor: any): boolean {
6
+ return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
7
+}
8
+
9
+export const hasSymbol =
10
+ typeof Symbol !== 'undefined' && isNative(Symbol) &&
11
+ typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys)
12
13
export const noopFn: any = (_: any) => _;
14
0 commit comments