MCPcopy Create free account
hub / github.com/SuperMap/iClient-JavaScript / enableClassCheck

Function enableClassCheck

libs/echarts/echarts.simple.js:12289–12300  ·  view source on GitHub ↗

* Can not use instanceof, consider different scope by * cross domain or es module import in ec extensions. * Mount a method "isInstance()" to Clz.

(Clz)

Source from the content-addressed store, hash-verified

12287 * Mount a method "isInstance()" to Clz.
12288 */
12289function enableClassCheck(Clz) {
12290 var classAttr = ['__\0is_clz', classBase++, Math.random().toFixed(3)].join('_');
12291 Clz.prototype[classAttr] = true;
12292
12293 if (__DEV__) {
12294 assert$1(!Clz.isInstance, 'The method "is" can not be defined.');
12295 }
12296
12297 Clz.isInstance = function (obj) {
12298 return !!(obj && obj[classAttr]);
12299 };
12300}
12301
12302// superCall should have class info, which can not be fetch from 'this'.
12303// Consider this case:

Callers 1

echarts.simple.jsFile · 0.70

Calls 2

assert$1Function · 0.70
randomMethod · 0.45

Tested by

no test coverage detected