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

Unified Diff: test/mjsunit/wasm/test-import-export-wrapper.js

Issue 2486943005: [wasm] Imported WebAssembly function are never wrapped. (Closed)
Patch Set: typo Created 4 years, 1 month 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
« no previous file with comments | « src/wasm/wasm-module.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/test-import-export-wrapper.js
diff --git a/test/mjsunit/wasm/test-import-export-wrapper.js b/test/mjsunit/wasm/test-import-export-wrapper.js
index 558b983c3f58fe11ee92c2726a83516e65784d60..e84881667d240e1a256352250bc82219df40d707 100644
--- a/test/mjsunit/wasm/test-import-export-wrapper.js
+++ b/test/mjsunit/wasm/test-import-export-wrapper.js
@@ -128,9 +128,9 @@ var expect_no_elison = 1;
// function calls stack: first_export -> first_func -> first_import ->
// second_export -> second_import
-// In this case, second_export has less params than first_import,
-// So that wrappers will not be removed
-(function TestWasmWrapperNoElisionLessParams() {
+// In this case, second_export has fewer params than first_import,
+// so instantiation should fail.
+assertThrows(function TestWasmWrapperNoElisionLessParams() {
var imported = function (a) {
return a;
};
@@ -181,13 +181,13 @@ var expect_no_elison = 1;
assertEquals(the_export(0, 2), 0);
assertEquals(the_export(9.9, 4.3), 9);
assertEquals(%CheckWasmWrapperElision(the_export, expect_no_elison), true);
-})();
+});
// function calls stack: first_export -> first_func -> first_import ->
// second_export -> second_import
// In this case, second_export has more params than first_import,
-// So that wrappers will not be removed
-(function TestWasmWrapperNoElisionMoreParams() {
+// so instantiation should fail.
+assertThrows(function TestWasmWrapperNoElisionMoreParams() {
var imported = function (a, b, c) {
return a+b+c;
};
@@ -240,13 +240,13 @@ var expect_no_elison = 1;
assertEquals(the_export(0, 0), 0);
assertEquals(the_export(1.1, 2.7), 3);
assertEquals(%CheckWasmWrapperElision(the_export, expect_no_elison), true);
-})();
+});
// function calls stack: first_export -> first_func -> first_import ->
// second_export -> second_import
// In this case, second_export has different params type with first_import,
-// So that wrappers will not be removed
-(function TestWasmWrapperNoElisionTypeMismatch() {
+// so instantiation should fail.
+assertThrows(function TestWasmWrapperNoElisionTypeMismatch() {
var imported = function (a, b) {
return a+b;
};
@@ -298,4 +298,4 @@ var expect_no_elison = 1;
assertEquals(the_export(0.0, 0.0), 0);
assertEquals(the_export(2, -2), 0);
assertEquals(%CheckWasmWrapperElision(the_export, expect_no_elison), true);
-})();
+});
« no previous file with comments | « src/wasm/wasm-module.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698