@cloudbase/js-sdk
Version:
cloudbase javascript sdk
56 lines (55 loc) • 1.99 kB
JavaScript
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var _symbols = [];
var __internalMark__ = {};
var HiddenSymbol = (function () {
function HiddenSymbol(target) {
Object.defineProperties(this, {
target: {
enumerable: false,
writable: false,
configurable: false,
value: target,
},
});
}
return HiddenSymbol;
}());
var InternalSymbol = (function (_super) {
__extends(InternalSymbol, _super);
function InternalSymbol(target, __mark__) {
if (__mark__ !== __internalMark__) {
throw new TypeError('InternalSymbol cannot be constructed with new operator');
}
return _super.call(this, target) || this;
}
InternalSymbol.for = function (target) {
for (var i = 0, len = _symbols.length; i < len; i++) {
if (_symbols[i].target === target) {
return _symbols[i].instance;
}
}
var symbol = new InternalSymbol(target, __internalMark__);
_symbols.push({
target: target,
instance: symbol,
});
return symbol;
};
return InternalSymbol;
}(HiddenSymbol));
export { InternalSymbol };
export default InternalSymbol;