Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(466)

Unified Diff: test/mjsunit/wasm/instantiate-module-basic.js

Issue 2121593002: [wasm] Compile and Instantiation (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: test Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« src/wasm/wasm-js.cc ('K') | « src/wasm/wasm-js.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/wasm/instantiate-module-basic.js
diff --git a/test/mjsunit/wasm/instantiate-module-basic.js b/test/mjsunit/wasm/instantiate-module-basic.js
index 72a3425c906de342f569d108b40871c6fae6807b..d9712e66af5a0e531add7ed83a2cd30a9422e61b 100644
--- a/test/mjsunit/wasm/instantiate-module-basic.js
+++ b/test/mjsunit/wasm/instantiate-module-basic.js
@@ -58,3 +58,17 @@ CheckInstance(new WebAssembly.Instance(module));
let promise = WebAssembly.compile(buffer);
promise.then(module => CheckInstance(new WebAssembly.Instance(module)));
+
+// Negative tests.
rossberg 2016/07/04 10:04:00 We should probably have a few new positive tests,
Mircea Trofin 2016/07/05 06:02:43 True - actually, for that to work, we'll have to c
+(function InvalidModules() {
+ let invalid_cases = [undefined, 1, "", "a", {some:1, obj: "b"}];
+ let len = invalid_cases.length;
+ for (var i = 0; i < len; ++i) {
+ try {
+ let instance = new WebAssembly.Instance(1);
+ assertUnreachable("should not be able to instantiate invalid modules.");
+ } catch (e) {
+ assertContains("Argument 0", e.toString());
+ }
+ }
+})();
« src/wasm/wasm-js.cc ('K') | « src/wasm/wasm-js.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698