Chromium Code Reviews| Index: test/cctest/test-parsing.cc |
| diff --git a/test/cctest/test-parsing.cc b/test/cctest/test-parsing.cc |
| index 550ac17a060eccc728c6f92cc5c151475e55b4bc..564b8d7b6cb649016de35e4c8c7f3e4f40b818d5 100644 |
| --- a/test/cctest/test-parsing.cc |
| +++ b/test/cctest/test-parsing.cc |
| @@ -31,6 +31,7 @@ |
| #include "src/v8.h" |
| +#include "src/ast-value-factory.h" |
| #include "src/compiler.h" |
| #include "src/execution.h" |
| #include "src/isolate.h" |
| @@ -796,8 +797,11 @@ void TestScanRegExp(const char* re_source, const char* expected) { |
| CHECK(start == i::Token::DIV || start == i::Token::ASSIGN_DIV); |
| CHECK(scanner.ScanRegExpPattern(start == i::Token::ASSIGN_DIV)); |
| scanner.Next(); // Current token is now the regexp literal. |
| + i::Zone zone(CcTest::i_isolate()); |
| + i::AstValueFactory ast_value_factory(&zone, 0); |
|
rossberg
2014/06/23 09:44:27
Why is a hash seed of 0 okay here? Maybe add a com
marja
2014/06/23 11:46:45
Why wouldn't it be? Afaics, it's usually 0, except
marja
2014/06/23 12:16:18
I changed this to get the hash seed from the isola
|
| + ast_value_factory.Internalize(CcTest::i_isolate()); |
| i::Handle<i::String> val = |
| - scanner.AllocateInternalizedString(CcTest::i_isolate()); |
| + scanner.CurrentSymbol(&ast_value_factory)->string(); |
| i::DisallowHeapAllocation no_alloc; |
| i::String::FlatContent content = val->GetFlatContent(); |
| CHECK(content.IsAscii()); |
| @@ -2549,3 +2553,20 @@ TEST(FuncNameInferrerEscaped) { |
| i::DeleteArray(two_byte_source); |
| i::DeleteArray(two_byte_name); |
| } |
| + |
| + |
| +TEST(RegressionLazyFunctionWithErrorWithArg) { |
| + // The bug occurred when a lazy function had an error which requires a |
| + // parameter (such as "unknown label" here). The error message was processed |
| + // before the AstValueFactory containing the error message string was |
| + // internalized. |
| + v8::Isolate* isolate = CcTest::isolate(); |
| + v8::HandleScope scope(isolate); |
| + LocalContext env; |
| + i::FLAG_lazy = true; |
| + i::FLAG_min_preparse_length = 0; |
| + CompileRun("function this_is_lazy() {\n" |
| + " break p;\n" |
| + "}\n" |
| + "this_is_lazy();\n"); |
| +} |