2
0
mirror of https://github.com/esiur/esiur-js.git synced 2026-04-04 05:58:22 +00:00
This commit is contained in:
2022-08-27 00:37:58 +03:00
parent 93aeaee315
commit 4fcb5355bc
9 changed files with 87 additions and 18 deletions

View File

@@ -170,14 +170,14 @@ export default class DistributedResource extends IResource
var makeSetter = function(index)
{
return function (value) {
return async function (value) {
if (self._p.destroyed)
throw new Error("Trying to access a destroyed object.");
if (self._p.suspended)
throw new Error("Trying to access a suspended object.");
self._set(index, value);
await self._set(index, value);
};
};
@@ -295,6 +295,10 @@ export default class DistributedResource extends IResource
if (index >= this._p.properties.length)
return null;
// Awaiting null is not a problem in JS
if (this._p.properties[index] == value)
return null;
var reply = new AsyncReply();
var parameters = Codec.compose(value, this._p.connection);