diff options
Diffstat (limited to 'core/core.js')
-rw-r--r-- | core/core.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/core/core.js b/core/core.js index a11f281f1..fd9b2c3ea 100644 --- a/core/core.js +++ b/core/core.js @@ -60,12 +60,14 @@ } function ops() { - // op id 0 is a special value to retrieve the map of registered ops. - const newOpsCache = Object.fromEntries(opcall(0)); - opsCache = Object.freeze(newOpsCache); return opsCache; } + function syncOpsCache() { + // op id 0 is a special value to retrieve the map of registered ops. + opsCache = Object.freeze(Object.fromEntries(opcall(0))); + } + function handleAsyncMsgFromRust() { for (let i = 0; i < arguments.length; i += 2) { const promiseId = arguments[i]; @@ -130,5 +132,6 @@ resources, registerErrorClass, handleAsyncMsgFromRust, + syncOpsCache, }); })(this); |