Skip to content

Commit

Permalink
load QCObjects once
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanmachuca committed Apr 28, 2023
1 parent f8b968a commit 092dbdc
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions src/QCObjects.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,24 @@
/*eslint no-mixed-operators: "off"*/
(function __qcobjects__ (_top) {
"use strict";
if (typeof __qcobjects__.__loaded__ === "undefined"){

if (typeof Object.defineProperty !== "undefined" && typeof _top !== "undefined"){
try {
Object.defineProperty(_top,"__qcobjects__", {
enumerable: true,
configurable: false,
writable: false,
value: __qcobjects__,
});
} catch (e){
if (typeof _top.__qcobjects__ !== "undefined"){
_top.__qcobjects__.loaded = true;
}
}
}
if (typeof _top.__qcobjects__.loaded === "undefined"){
_top.__qcobjects__.loaded = true;

var global = _top;
_top.global = global;

Expand All @@ -48,7 +65,9 @@
});
if (typeof _.prototype !== "undefined") {
_.prototype.toString = function () {
var _protected_symbols = ["ComplexStorageCache",
var _protected_symbols = [
"__qcobjects__",
"ComplexStorageCache",
"css",
"append",
"attachIn",
Expand Down Expand Up @@ -5147,7 +5166,6 @@
__freeze__();
}
})(isBrowser);
__qcobjects__.__loaded__ = true;
}
}).call(null, (typeof module === "object" && typeof module.exports === "object") ? (
module.exports = (typeof globalThis !== "undefined"
Expand Down

0 comments on commit 092dbdc

Please sign in to comment.