@remote-ui/rpc
Advanced tools
Comparing version
@@ -168,3 +168,3 @@ 'use strict'; | ||
_context.t0 = data[0]; | ||
_context.next = _context.t0 === TERMINATE ? 6 : _context.t0 === CALL ? 8 : _context.t0 === RESULT ? 33 : _context.t0 === RELEASE ? 37 : _context.t0 === FUNCTION_RESULT ? 40 : _context.t0 === FUNCTION_APPLY ? 44 : 58; | ||
_context.next = _context.t0 === TERMINATE ? 6 : _context.t0 === CALL ? 8 : _context.t0 === RESULT ? 34 : _context.t0 === RELEASE ? 38 : _context.t0 === FUNCTION_RESULT ? 41 : _context.t0 === FUNCTION_APPLY ? 45 : 60; | ||
break; | ||
@@ -174,3 +174,3 @@ | ||
terminate(); | ||
return _context.abrupt("break", 58); | ||
return _context.abrupt("break", 60); | ||
@@ -202,3 +202,3 @@ case 8: | ||
send(RESULT, [id, undefined, encoded], transferables); | ||
_context.next = 29; | ||
_context.next = 30; | ||
break; | ||
@@ -215,44 +215,45 @@ | ||
}]); | ||
throw _context.t3; | ||
case 29: | ||
_context.prev = 29; | ||
case 30: | ||
_context.prev = 30; | ||
stackFrame.release(); | ||
return _context.finish(29); | ||
return _context.finish(30); | ||
case 32: | ||
return _context.abrupt("break", 58); | ||
case 33: | ||
return _context.abrupt("break", 60); | ||
case 33: | ||
case 34: | ||
_ref4 = data[1], _ref5 = _rollupPluginBabelHelpers.slicedToArray(_ref4, 1), callId = _ref5[0]; | ||
callIdsToResolver.get(callId).apply(void 0, _rollupPluginBabelHelpers.toConsumableArray(data[1])); | ||
callIdsToResolver.delete(callId); | ||
return _context.abrupt("break", 58); | ||
return _context.abrupt("break", 60); | ||
case 37: | ||
case 38: | ||
_ref6 = data[1], _ref7 = _rollupPluginBabelHelpers.slicedToArray(_ref6, 1), _id = _ref7[0]; | ||
encoder.release(_id); | ||
return _context.abrupt("break", 58); | ||
return _context.abrupt("break", 60); | ||
case 40: | ||
case 41: | ||
_ref8 = data[1], _ref9 = _rollupPluginBabelHelpers.slicedToArray(_ref8, 1), _callId = _ref9[0]; | ||
callIdsToResolver.get(_callId).apply(void 0, _rollupPluginBabelHelpers.toConsumableArray(data[1])); | ||
callIdsToResolver.delete(_callId); | ||
return _context.abrupt("break", 58); | ||
return _context.abrupt("break", 60); | ||
case 44: | ||
case 45: | ||
_ref10 = data[1], _ref11 = _rollupPluginBabelHelpers.slicedToArray(_ref10, 3), _callId2 = _ref11[0], funcId = _ref11[1], _args = _ref11[2]; | ||
_context.prev = 45; | ||
_context.next = 48; | ||
_context.prev = 46; | ||
_context.next = 49; | ||
return encoder.call(funcId, _args); | ||
case 48: | ||
case 49: | ||
result = _context.sent; | ||
_encoder$encode7 = encoder.encode(result), _encoder$encode8 = _rollupPluginBabelHelpers.slicedToArray(_encoder$encode7, 2), _encoded = _encoder$encode8[0], _transferables = _encoder$encode8[1]; | ||
send(FUNCTION_RESULT, [_callId2, undefined, _encoded], _transferables); | ||
_context.next = 57; | ||
_context.next = 59; | ||
break; | ||
case 53: | ||
_context.prev = 53; | ||
_context.t4 = _context["catch"](45); | ||
case 54: | ||
_context.prev = 54; | ||
_context.t4 = _context["catch"](46); | ||
_name = _context.t4.name, _message = _context.t4.message, _stack = _context.t4.stack; | ||
@@ -264,7 +265,8 @@ send(FUNCTION_RESULT, [_callId2, { | ||
}]); | ||
throw _context.t4; | ||
case 57: | ||
return _context.abrupt("break", 58); | ||
case 59: | ||
return _context.abrupt("break", 60); | ||
case 58: | ||
case 60: | ||
case "end": | ||
@@ -274,3 +276,3 @@ return _context.stop(); | ||
} | ||
}, _callee, null, [[11, 25, 29, 32], [45, 53]]); | ||
}, _callee, null, [[11, 25, 30, 33], [46, 54]]); | ||
})); | ||
@@ -277,0 +279,0 @@ return _listener.apply(this, arguments); |
@@ -125,2 +125,3 @@ "use strict"; | ||
send(RESULT, [id, { name, message, stack }]); | ||
throw error; | ||
} | ||
@@ -159,2 +160,3 @@ finally { | ||
send(FUNCTION_RESULT, [callId, { name, message, stack }]); | ||
throw error; | ||
} | ||
@@ -161,0 +163,0 @@ break; |
@@ -10,2 +10,6 @@ # Changelog | ||
## [1.2.2] - 2021-06-21 | ||
- Fixed error handling in RPC layer by rethrowing exceptions ([pull request](https://github.com/Shopify/remote-ui/pull/103)). | ||
## [1.2.1] - 2021-06-09 | ||
@@ -12,0 +16,0 @@ |
{ | ||
"name": "@remote-ui/rpc", | ||
"description": "An RPC library with strong support for simulating the transfer of functions via postMessage", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"publishConfig": { | ||
@@ -26,3 +26,3 @@ "access": "public" | ||
}, | ||
"gitHead": "5f1f48eaf483c03c443554d725543d4597848768" | ||
"gitHead": "3e5a420180a5dc2aca58b15e3ab7cffc1826f32d" | ||
} |
@@ -189,2 +189,3 @@ import {createBasicEncoder} from './encoding'; | ||
send(RESULT, [id, {name, message, stack}]); | ||
throw error; | ||
} finally { | ||
@@ -233,2 +234,3 @@ stackFrame.release(); | ||
send(FUNCTION_RESULT, [callId, {name, message, stack}]); | ||
throw error; | ||
} | ||
@@ -235,0 +237,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
296205
0.15%3618
0.22%