summaryrefslogtreecommitdiff
path: root/src/js/binaryen.js-post.js
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2021-01-26 23:36:56 +0000
committerGitHub <noreply@github.com>2021-01-26 15:36:56 -0800
commitf82e94363a231bf570fbe3d7dc49259c8668206f (patch)
tree1c4dd05735dfe61e8cc5d87a1c98479b788b89bd /src/js/binaryen.js-post.js
parent5e57a13614c56f959faab675d6bcabbd629ec562 (diff)
downloadbinaryen-f82e94363a231bf570fbe3d7dc49259c8668206f.tar.gz
binaryen-f82e94363a231bf570fbe3d7dc49259c8668206f.tar.bz2
binaryen-f82e94363a231bf570fbe3d7dc49259c8668206f.zip
[GC] ref.is_func/data/i31 (#3519)
Diffstat (limited to 'src/js/binaryen.js-post.js')
-rw-r--r--src/js/binaryen.js-post.js12
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));
},