diff --git a/src/js/binaryen.js-post.js b/src/js/binaryen.js-post.js index 1743c97388e..c938f6c3bc4 100644 --- a/src/js/binaryen.js-post.js +++ b/src/js/binaryen.js-post.js @@ -39,6 +39,7 @@ function initializeConstants() { ['eqref', 'Eqref'], ['i31ref', 'I31ref'], ['structref', 'Structref'], + ['arrayref', 'Arrayref'], ['stringref', 'Stringref'], ['nullref', 'Nullref'], ['nullexternref', 'NullExternref'], @@ -2381,6 +2382,12 @@ function wrapModule(module, self = {}) { } }; + self['arrayref'] = { + 'pop'() { + return Module['_BinaryenPop'](module, Module['arrayref']); + } + }; + self['stringref'] = { 'pop'() { return Module['_BinaryenPop'](module, Module['stringref']); diff --git a/test/binaryen.js/kitchen-sink.js b/test/binaryen.js/kitchen-sink.js index 556749059b7..e2764e19abf 100644 --- a/test/binaryen.js/kitchen-sink.js +++ b/test/binaryen.js/kitchen-sink.js @@ -660,6 +660,7 @@ function test_core() { module.eqref.pop(), module.i31ref.pop(), module.structref.pop(), + module.arrayref.pop(), module.stringref.pop(), // Memory diff --git a/test/binaryen.js/kitchen-sink.js.txt b/test/binaryen.js/kitchen-sink.js.txt index 2802300c194..d28f6381f48 100644 --- a/test/binaryen.js/kitchen-sink.js.txt +++ b/test/binaryen.js/kitchen-sink.js.txt @@ -2184,6 +2184,9 @@ getExpressionInfo(tuple[3])={"id":14,"type":5,"value":3.7} (drop (pop structref) ) + (drop + (pop arrayref) + ) (drop (pop stringref) )