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

Unified Diff: test/cctest/asmjs/test-asm-typer.cc

Issue 2568773002: [wasm][asm.js] Forbid function declaration replacing variable declaration. (Closed)
Patch Set: git cl try Created 4 years 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/asmjs/asm-typer.cc ('k') | test/mjsunit/asm/asm-validation.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/asmjs/test-asm-typer.cc
diff --git a/test/cctest/asmjs/test-asm-typer.cc b/test/cctest/asmjs/test-asm-typer.cc
index 0455e7d3c9ea8c816145f38b98d188487852404d..3f6eeafa5ad615c4e03ae6783467c547a2838a2f 100644
--- a/test/cctest/asmjs/test-asm-typer.cc
+++ b/test/cctest/asmjs/test-asm-typer.cc
@@ -672,11 +672,16 @@ TEST(ErrorsInModuleExport) {
{"return {'a': f()}", "must be an asm.js function name"},
{"return {'a': f}", "Undefined identifier in asm.js module export"},
{"function v() { a(); } return {b: d2s}", "Missing definition for forw"},
- {"return {b: d2s, 'a': d2s_tbl}", "cannot export function tables"},
- {"return {b: d2s, 'a': min}", "cannot export standard library"},
- {"return {b: d2s, 'a': ffi}", "cannot export foreign functions"},
- {"return {b: d2s, 'a': f()}", "must be an asm.js function name"},
- {"return {b: d2s, 'a': f}", "Undefined identifier in asm.js module"},
+ {"function v() {} return {b: v, 'a': d2s_tbl}",
+ "cannot export function tables"},
+ {"function v() {} return {b: v, 'a': min}",
+ "cannot export standard library"},
+ {"function v() {} return {b: v, 'a': ffi}",
+ "cannot export foreign functions"},
+ {"function v() {} return {b: v, 'a': f()}",
+ "must be an asm.js function name"},
+ {"function v() {} return {b: v, 'a': f}",
+ "Undefined identifier in asm.js module"},
};
auto d2s_tbl = [](Zone* zone) -> iw::AsmType* {
@@ -687,17 +692,10 @@ TEST(ErrorsInModuleExport) {
return ret;
};
- auto d2s = [](Zone* zone) -> iw::AsmType* {
- auto* ret = iw::AsmType::Function(zone, iw::AsmType::Signed());
- ret->AsFunctionType()->AddArgument(iw::AsmType::Double());
- return ret;
- };
-
for (size_t ii = 0; ii < arraysize(kTests); ++ii) {
const auto* test = kTests + ii;
if (!ValidationOf(Export(test->module_export))
->WithGlobal(DynamicGlobal("d2s_tbl"), d2s_tbl)
- ->WithGlobal(DynamicGlobal("d2s"), d2s)
->WithImport(DynamicGlobal("min"), iw::AsmTyper::kMathMin)
->WithImport(DynamicGlobal("ffi"), iw::AsmTyper::kFFI)
->WithGlobal(DynamicGlobal("I"), iw::AsmType::Int())
« no previous file with comments | « src/asmjs/asm-typer.cc ('k') | test/mjsunit/asm/asm-validation.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698