diff options
author | Alon Zakai <azakai@google.com> | 2021-01-26 23:36:56 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-26 15:36:56 -0800 |
commit | f82e94363a231bf570fbe3d7dc49259c8668206f (patch) | |
tree | 1c4dd05735dfe61e8cc5d87a1c98479b788b89bd /src/js | |
parent | 5e57a13614c56f959faab675d6bcabbd629ec562 (diff) | |
download | binaryen-f82e94363a231bf570fbe3d7dc49259c8668206f.tar.gz binaryen-f82e94363a231bf570fbe3d7dc49259c8668206f.tar.bz2 binaryen-f82e94363a231bf570fbe3d7dc49259c8668206f.zip |
[GC] ref.is_func/data/i31 (#3519)
Diffstat (limited to 'src/js')
-rw-r--r-- | src/js/binaryen.js-post.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/js/binaryen.js-post.js b/src/js/binaryen.js-post.js index c6d1fe31d..9c9c4e036 100644 --- a/src/js/binaryen.js-post.js +++ b/src/js/binaryen.js-post.js @@ -487,6 +487,9 @@ function initializeConstants() { 'WidenHighUVecI16x8ToVecI32x4', 'SwizzleVec8x16', 'RefIsNull', + 'RefIsFunc', + 'RefIsData', + 'RefIsI31', ].forEach(name => { Module['Operations'][name] = Module[name] = Module['_Binaryen' + name](); }); @@ -2105,6 +2108,15 @@ function wrapModule(module, self = {}) { 'is_null'(value) { return Module['_BinaryenRefIs'](module, Module['RefIsNull'], value); }, + 'is_func'(value) { + return Module['_BinaryenRefIs'](module, Module['RefIsFunc'], value); + }, + 'is_data'(value) { + return Module['_BinaryenRefIs'](module, Module['RefIsData'], value); + }, + 'is_i31'(value) { + return Module['_BinaryenRefIs'](module, Module['RefIsI31'], value); + }, 'func'(func, type) { return preserveStack(() => Module['_BinaryenRefFunc'](module, strToStack(func), type)); }, |