summaryrefslogtreecommitdiff
path: root/test/binaryen.js
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2021-04-08 18:06:15 -0700
committerGitHub <noreply@github.com>2021-04-08 18:06:15 -0700
commit8498027da4e078e6babe72f66829b479dd163510 (patch)
tree882048ce758b06d32c3875eb4d72d6574dfe1071 /test/binaryen.js
parent8e20e49a858f207e689589dfe9c056098c58eca2 (diff)
downloadbinaryen-8498027da4e078e6babe72f66829b479dd163510.tar.gz
binaryen-8498027da4e078e6babe72f66829b479dd163510.tar.bz2
binaryen-8498027da4e078e6babe72f66829b479dd163510.zip
RefFunc: Validate that the type is non-nullable, and avoid possible bugs in the builder (#3790)
The builder can receive a HeapType so that callers don't need to set non-nullability themselves. Not NFC as some of the callers were in fact still making it nullable.
Diffstat (limited to 'test/binaryen.js')
-rw-r--r--test/binaryen.js/expressions.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/binaryen.js/expressions.js b/test/binaryen.js/expressions.js
index 68f5c8cee..b458355cd 100644
--- a/test/binaryen.js/expressions.js
+++ b/test/binaryen.js/expressions.js
@@ -1448,7 +1448,9 @@ console.log("# RefFunc");
assert(theRefFunc instanceof binaryen.RefFunc);
assert(theRefFunc instanceof binaryen.Expression);
assert(theRefFunc.func === func);
- assert(theRefFunc.type === binaryen.funcref);
+ // TODO: check the type. the type is (ref func), that is, a non-nullable func,
+ // which differs from funcref. we don't have the ability to create such
+ // a type in the C/JS APIs yet.
theRefFunc.func = func = "b";
assert(theRefFunc.func === func);