summaryrefslogtreecommitdiff
path: root/src/js/binaryen.js-post.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/js/binaryen.js-post.js')
-rw-r--r--src/js/binaryen.js-post.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/js/binaryen.js-post.js b/src/js/binaryen.js-post.js
index a29a035c6..352da1c0a 100644
--- a/src/js/binaryen.js-post.js
+++ b/src/js/binaryen.js-post.js
@@ -1111,6 +1111,25 @@
return Module['_BinaryenExpressionGetType'](expr);
};
+ Module['getConstValueI32'] = function(expr) {
+ return Module['_BinaryenConstGetValueI32'](expr);
+ };
+
+ Module['getConstValueI64'] = function(expr) {
+ return {
+ 'low': Module['_BinaryenConstGetValueI64Low'](expr),
+ 'high': Module['_BinaryenConstGetValueI64High'](expr)
+ };
+ };
+
+ Module['getConstValueF32'] = function(expr) {
+ return Module['_BinaryenConstGetValueF32'](expr);
+ };
+
+ Module['getConstValueF64'] = function(expr) {
+ return Module['_BinaryenConstGetValueF64'](expr);
+ };
+
// emit text of an expression or a module
Module['emitText'] = function(expr) {
if (typeof expr === 'object') {