@cpaassdk/cpaas-sdk
Version:
271 lines (270 loc) • 8.55 kB
JavaScript
(function (root, factory) {
if (typeof define === 'function' && define.amd)
define(['exports', './kotlin-kotlin-stdlib-js-ir.js'], factory);
else if (typeof exports === 'object')
factory(module.exports, require('./kotlin-kotlin-stdlib-js-ir.js'));
else {
if (typeof this['kotlin-kotlin-stdlib-js-ir'] === 'undefined') {
throw new Error("Error loading module '88b0986a7186d029-atomicfu-js-ir'. Its dependency 'kotlin-kotlin-stdlib-js-ir' was not found. Please, check whether 'kotlin-kotlin-stdlib-js-ir' is loaded prior to '88b0986a7186d029-atomicfu-js-ir'.");
}
root['88b0986a7186d029-atomicfu-js-ir'] = factory(typeof this['88b0986a7186d029-atomicfu-js-ir'] === 'undefined' ? {} : this['88b0986a7186d029-atomicfu-js-ir'], this['kotlin-kotlin-stdlib-js-ir']);
}
}(this, function (_, kotlin_kotlin) {
'use strict';
//region block: imports
var fillArrayVal = kotlin_kotlin.$_$.b9;
var Unit_getInstance = kotlin_kotlin.$_$.h4;
var classMeta = kotlin_kotlin.$_$.x8;
var objectMeta = kotlin_kotlin.$_$.da;
var toString = kotlin_kotlin.$_$.od;
//endregion
//region block: pre-declaration
None.prototype = Object.create(atomicfu$TraceBase.prototype);
None.prototype.constructor = None;
//endregion
function loop(_this__u8e3s4, action) {
while (true) {
action(_this__u8e3s4.tj_1);
}
}
function loop_0(_this__u8e3s4, action) {
while (true) {
action(_this__u8e3s4.uj_1);
}
}
function atomicfu$AtomicRefArray$ref(size) {
var tmp = this;
var tmp_0 = 0;
var tmp_1 = size;
var tmp$ret$0;
{
tmp$ret$0 = fillArrayVal(Array(tmp_1), null);
}
var tmp_2 = tmp$ret$0;
while (tmp_0 < tmp_1) {
var tmp_3 = tmp_0;
var tmp$ret$1;
{
tmp$ret$1 = atomic$ref$1(null);
}
tmp_2[tmp_3] = tmp$ret$1;
tmp_0 = tmp_0 + 1 | 0;
}
tmp.vj_1 = tmp_2;
}
atomicfu$AtomicRefArray$ref.prototype.wj = function () {
return this.vj_1.length;
};
atomicfu$AtomicRefArray$ref.prototype.atomicfu$get = function (index) {
return this.vj_1[index];
};
atomicfu$AtomicRefArray$ref.$metadata$ = classMeta('AtomicArray');
Object.defineProperty(atomicfu$AtomicRefArray$ref.prototype, 'atomicfu$size', {
configurable: true,
get: atomicfu$AtomicRefArray$ref.prototype.wj
});
function atomicfu$AtomicRefArray$ofNulls(size) {
return new atomicfu$AtomicRefArray$ref(size);
}
function update(_this__u8e3s4, function_0) {
while (true) {
var cur = _this__u8e3s4.uj_1;
var upd = function_0(cur);
if (_this__u8e3s4.atomicfu$compareAndSet(cur, upd))
return Unit_getInstance();
}
}
function updateAndGet(_this__u8e3s4, function_0) {
while (true) {
var cur = _this__u8e3s4.uj_1;
var upd = function_0(cur);
if (_this__u8e3s4.atomicfu$compareAndSet(cur, upd))
return upd;
}
}
function None() {
None_instance = this;
atomicfu$TraceBase.call(this);
}
None.$metadata$ = objectMeta('None', undefined, undefined, undefined, undefined, atomicfu$TraceBase.prototype);
var None_instance;
function None_getInstance() {
if (None_instance == null)
new None();
return None_instance;
}
function atomicfu$TraceBase() {
}
atomicfu$TraceBase.prototype.atomicfu$Trace$append$1 = function (event) {
};
atomicfu$TraceBase.prototype.atomicfu$Trace$append$2 = function (event1, event2) {
};
atomicfu$TraceBase.prototype.atomicfu$Trace$append$3 = function (event1, event2, event3) {
};
atomicfu$TraceBase.prototype.atomicfu$Trace$append$4 = function (event1, event2, event3, event4) {
};
atomicfu$TraceBase.$metadata$ = classMeta('TraceBase');
function AtomicRef(value) {
this.tj_1 = value;
}
AtomicRef.prototype.xj = function (_set____db54di) {
this.tj_1 = _set____db54di;
};
AtomicRef.prototype.yj = function () {
return this.tj_1;
};
AtomicRef.prototype.atomicfu$compareAndSet = function (expect, update) {
if (!(this.tj_1 === expect))
return false;
this.tj_1 = update;
return true;
};
AtomicRef.prototype.atomicfu$getAndSet = function (value) {
var oldValue = this.tj_1;
this.tj_1 = value;
return oldValue;
};
AtomicRef.prototype.toString = function () {
return toString(this.tj_1);
};
AtomicRef.$metadata$ = classMeta('AtomicRef');
Object.defineProperty(AtomicRef.prototype, 'kotlinx$atomicfu$value', {
configurable: true,
get: AtomicRef.prototype.yj,
set: AtomicRef.prototype.xj
});
function atomic$ref$1(initial) {
return atomic(initial, None_getInstance());
}
function AtomicBoolean(value) {
this.zj_1 = value;
}
AtomicBoolean.prototype.ak = function (_set____db54di) {
this.zj_1 = _set____db54di;
};
AtomicBoolean.prototype.yj = function () {
return this.zj_1;
};
AtomicBoolean.prototype.atomicfu$compareAndSet = function (expect, update) {
if (!(this.zj_1 === expect))
return false;
this.zj_1 = update;
return true;
};
AtomicBoolean.prototype.atomicfu$getAndSet = function (value) {
var oldValue = this.zj_1;
this.zj_1 = value;
return oldValue;
};
AtomicBoolean.prototype.toString = function () {
return this.zj_1.toString();
};
AtomicBoolean.$metadata$ = classMeta('AtomicBoolean');
Object.defineProperty(AtomicBoolean.prototype, 'kotlinx$atomicfu$value', {
configurable: true,
get: AtomicBoolean.prototype.yj,
set: AtomicBoolean.prototype.ak
});
function atomic$boolean$1(initial) {
return atomic_0(initial, None_getInstance());
}
function AtomicInt(value) {
this.uj_1 = value;
}
AtomicInt.prototype.bk = function (_set____db54di) {
this.uj_1 = _set____db54di;
};
AtomicInt.prototype.yj = function () {
return this.uj_1;
};
AtomicInt.prototype.atomicfu$compareAndSet = function (expect, update) {
if (!(this.uj_1 === expect))
return false;
this.uj_1 = update;
return true;
};
AtomicInt.prototype.atomicfu$getAndSet = function (value) {
var oldValue = this.uj_1;
this.uj_1 = value;
return oldValue;
};
AtomicInt.prototype.atomicfu$getAndIncrement = function () {
var tmp0_this = this;
var tmp1 = tmp0_this.uj_1;
tmp0_this.uj_1 = tmp1 + 1 | 0;
return tmp1;
};
AtomicInt.prototype.atomicfu$getAndDecrement = function () {
var tmp0_this = this;
var tmp1 = tmp0_this.uj_1;
tmp0_this.uj_1 = tmp1 - 1 | 0;
return tmp1;
};
AtomicInt.prototype.atomicfu$getAndAdd = function (delta) {
var oldValue = this.uj_1;
var tmp0_this = this;
tmp0_this.uj_1 = tmp0_this.uj_1 + delta | 0;
return oldValue;
};
AtomicInt.prototype.atomicfu$addAndGet = function (delta) {
var tmp0_this = this;
tmp0_this.uj_1 = tmp0_this.uj_1 + delta | 0;
return this.uj_1;
};
AtomicInt.prototype.atomicfu$incrementAndGet = function () {
var tmp0_this = this;
tmp0_this.uj_1 = tmp0_this.uj_1 + 1 | 0;
return tmp0_this.uj_1;
};
AtomicInt.prototype.atomicfu$decrementAndGet = function () {
var tmp0_this = this;
tmp0_this.uj_1 = tmp0_this.uj_1 - 1 | 0;
return tmp0_this.uj_1;
};
AtomicInt.prototype.toString = function () {
return this.uj_1.toString();
};
AtomicInt.$metadata$ = classMeta('AtomicInt');
Object.defineProperty(AtomicInt.prototype, 'kotlinx$atomicfu$value', {
configurable: true,
get: AtomicInt.prototype.yj,
set: AtomicInt.prototype.bk
});
function atomic$int$1(initial) {
return atomic_1(initial, None_getInstance());
}
function atomic(initial, trace) {
return new AtomicRef(initial);
}
function atomic_0(initial, trace) {
return new AtomicBoolean(initial);
}
function atomic_1(initial, trace) {
return new AtomicInt(initial);
}
var Lock;
function ReentrantLock() {
}
ReentrantLock.$metadata$ = classMeta('ReentrantLock');
function synchronized(lock, block) {
init_properties_Synchronized_kt_vep4ze();
return block();
}
var properties_initialized_Synchronized_kt_8bwsba;
function init_properties_Synchronized_kt_vep4ze() {
if (properties_initialized_Synchronized_kt_8bwsba) {
} else {
properties_initialized_Synchronized_kt_8bwsba = true;
Lock = new ReentrantLock();
}
}
//region block: exports
_.$_$ = _.$_$ || {};
_.$_$.a = atomicfu$AtomicRefArray$ofNulls;
_.$_$.b = atomic$boolean$1;
_.$_$.c = atomic$ref$1;
_.$_$.d = atomic$int$1;
//endregion
return _;
}));
//# sourceMappingURL=88b0986a7186d029-atomicfu-js-ir.js.map