Commit 2de04c43 authored by Romain Courteaud's avatar Romain Courteaud

erp5_xhtml_style/erp5_web_renderjs_ui: renderjs 0.29.0

parent babc4ce6
Pipeline #31555 failed with stage
in 0 seconds
......@@ -300,24 +300,28 @@
postMessage({ id: id, callback: cbName, params: v});
},
error: function(error, message) {
completed = true;
// verify in table
if (!inTbl[id]) throw "error called for nonexistent message: " + id;
// remove transaction from table
delete inTbl[id];
// send error
postMessage({ id: id, error: error, message: message });
completed = true;
// remove transaction from table
delete inTbl[id];
},
complete: function(v) {
completed = true;
// verify in table
if (!inTbl[id]) throw "complete called for nonexistent message: " + id;
// remove transaction from table
delete inTbl[id];
// send complete
postMessage({ id: id, result: v });
completed = true;
// remove transaction from table
delete inTbl[id];
},
delayReturn: function(delay) {
if (typeof delay === 'boolean') {
......@@ -2785,10 +2789,11 @@ if (typeof document.contains !== 'function') {
local_transaction_dict[transaction_id] =
root_gadget[v[0]].apply(root_gadget, v[1])
.push(function handleMethodCallSuccess() {
trans.complete.apply(trans, arguments);
// drop the promise reference, to allow garbage collection
delete local_transaction_dict[transaction_id];
trans.complete.apply(trans, arguments);
}, function handleMethodCallError(e) {
})
.push(undefined, function handleMethodCallError(e) {
var error_type = convertObjectToErrorType(e),
message;
if (e instanceof Error) {
......@@ -2800,12 +2805,19 @@ if (typeof document.contains !== 'function') {
} else {
message = e;
}
// drop the promise reference, to allow garbage collection
delete local_transaction_dict[transaction_id];
try {
trans.error({
type: error_type,
msg: message
});
} catch (new_error) {
trans.error({
type: convertObjectToErrorType(new_error),
msg: new_error.toString()
});
}
// drop the promise reference, to allow garbage collection
delete local_transaction_dict[transaction_id];
});
trans.delayReturn(true);
});
......
......@@ -236,7 +236,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>1004.26548.30757.41045</string> </value>
<value> <string>1005.39922.11123.57429</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -256,7 +256,7 @@
</tuple>
<state>
<tuple>
<float>1673362285.2</float>
<float>1701788447.11</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -300,24 +300,28 @@
postMessage({ id: id, callback: cbName, params: v});
},
error: function(error, message) {
completed = true;
// verify in table
if (!inTbl[id]) throw "error called for nonexistent message: " + id;
// remove transaction from table
delete inTbl[id];
// send error
postMessage({ id: id, error: error, message: message });
completed = true;
// remove transaction from table
delete inTbl[id];
},
complete: function(v) {
completed = true;
// verify in table
if (!inTbl[id]) throw "complete called for nonexistent message: " + id;
// remove transaction from table
delete inTbl[id];
// send complete
postMessage({ id: id, result: v });
completed = true;
// remove transaction from table
delete inTbl[id];
},
delayReturn: function(delay) {
if (typeof delay === 'boolean') {
......@@ -2785,10 +2789,11 @@ if (typeof document.contains !== 'function') {
local_transaction_dict[transaction_id] =
root_gadget[v[0]].apply(root_gadget, v[1])
.push(function handleMethodCallSuccess() {
trans.complete.apply(trans, arguments);
// drop the promise reference, to allow garbage collection
delete local_transaction_dict[transaction_id];
trans.complete.apply(trans, arguments);
}, function handleMethodCallError(e) {
})
.push(undefined, function handleMethodCallError(e) {
var error_type = convertObjectToErrorType(e),
message;
if (e instanceof Error) {
......@@ -2800,12 +2805,19 @@ if (typeof document.contains !== 'function') {
} else {
message = e;
}
// drop the promise reference, to allow garbage collection
delete local_transaction_dict[transaction_id];
try {
trans.error({
type: error_type,
msg: message
});
} catch (new_error) {
trans.error({
type: convertObjectToErrorType(new_error),
msg: new_error.toString()
});
}
// drop the promise reference, to allow garbage collection
delete local_transaction_dict[transaction_id];
});
trans.delayReturn(true);
});
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment