diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2021-01-07 21:36:20 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-07 21:36:20 -0500 |
commit | b20622b2c84ce3ca1781c7bf8e10fed0af1e5001 (patch) | |
tree | 938cdc95f289cdfd482aff77a6ebe44aff80e889 /ext/mixed/js/yomichan.js | |
parent | 7d706df66b4cd68d6ac430c2e3e8b9f3a7f4b6ae (diff) |
Core refactor (#1207)
* Copy set intersection functions
* Remove unused functions
* Simplify url check
* Remove parseUrl
* Simplify stringReverse
* Remove hasOwn due to infrequent use
* Rename errorToJson/jsonToError to de/serializeError
For clarity on intended use.
* Fix time argument on timeout
* Add missing return value
* Throw an error for unexpected argument values
* Add documentation comments
Diffstat (limited to 'ext/mixed/js/yomichan.js')
-rw-r--r-- | ext/mixed/js/yomichan.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/mixed/js/yomichan.js b/ext/mixed/js/yomichan.js index 32408413..61301e30 100644 --- a/ext/mixed/js/yomichan.js +++ b/ext/mixed/js/yomichan.js @@ -219,7 +219,7 @@ const yomichan = (() => { } error = response.error; if (error) { - throw jsonToError(error); + throw deserializeError(error); } return response.result; } @@ -233,7 +233,7 @@ const yomichan = (() => { if (async) { promiseOrResult.then( (result) => { callback({result}); }, - (error) => { callback({error: errorToJson(error)}); } + (error) => { callback({error: serializeError(error)}); } ); return true; } else { @@ -241,7 +241,7 @@ const yomichan = (() => { return false; } } catch (error) { - callback({error: errorToJson(error)}); + callback({error: serializeError(error)}); return false; } } |