Chromium Code Reviews| 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 bf8615e00790d41fc6064a186f7e844b3b70817c..9182d16f661c72841581017d9d599bcc2bf91ab6 100644 |
| --- a/test/cctest/asmjs/test-asm-typer.cc |
| +++ b/test/cctest/asmjs/test-asm-typer.cc |
| @@ -1941,4 +1941,62 @@ TEST(B63099) { |
| } |
| } |
| +// This issue was triggered because assignment to special symbosl (i.e., the |
|
titzer
2016/08/23 13:58:25
s/assignment to special symbosl/a special symbol/
John
2016/08/23 14:02:32
I rephrased slightly differently: intead of "speci
|
| +// module's name, or any of the asm.js' module parameters) was assigned to. |
| +TEST(B640194) { |
| + const char* kTests[] = { |
| + "function asm() {\n" |
| + " 'use asm';\n" |
| + " function f() {\n" |
| + " asm = 0;\n" |
| + " }\n" |
| + " return f;\n" |
| + "}", |
| + "function asm(stdlib) {\n" |
| + " 'use asm';\n" |
| + " function f() {\n" |
| + " stdlib = 0;\n" |
| + " }\n" |
| + " return f;\n" |
| + "}", |
| + "function asm(stdlib, foreign) {\n" |
| + " 'use asm';\n" |
| + " function f() {\n" |
| + " foreign = 0;\n" |
| + " }\n" |
| + " return f;\n" |
| + "}", |
| + "function asm(stdlib, foreign, heap) {\n" |
| + " 'use asm';\n" |
| + " function f() {\n" |
| + " heap = 0;\n" |
| + " }\n" |
| + " return f;\n" |
| + "}", |
| + "function asm(stdlib, foreign, heap) {\n" |
| + " 'use asm';\n" |
| + " var f = stdlib.Math.fround;\n" |
| + " function f() {\n" |
| + " f = 0;\n" |
| + " }\n" |
| + " return f;\n" |
| + "}", |
| + "function asm(stdlib, foreign, heap) {\n" |
| + " 'use asm';\n" |
| + " var E = stdlib.Math.E;\n" |
| + " function f() {\n" |
| + " E = 0;\n" |
| + " }\n" |
| + " return f;\n" |
| + "}", |
| + }; |
| + for (size_t ii = 0; ii < arraysize(kTests); ++ii) { |
| + if (!ValidationOf(Module(kTests[ii])) |
| + ->FailsWithMessage("Can't assign to immutable symbol")) { |
| + std::cerr << "Test:\n" << kTests[ii]; |
| + CHECK(false); |
| + } |
| + } |
| +} |
| + |
| } // namespace |