OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 2534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2545 v8::Local<v8::String> source = | 2545 v8::Local<v8::String> source = |
2546 v8::String::NewFromTwoByte(isolate, two_byte_source); | 2546 v8::String::NewFromTwoByte(isolate, two_byte_source); |
2547 v8::Local<v8::Value> result = CompileRun(source); | 2547 v8::Local<v8::Value> result = CompileRun(source); |
2548 CHECK(result->IsString()); | 2548 CHECK(result->IsString()); |
2549 v8::Local<v8::String> expected_name = | 2549 v8::Local<v8::String> expected_name = |
2550 v8::String::NewFromTwoByte(isolate, two_byte_name); | 2550 v8::String::NewFromTwoByte(isolate, two_byte_name); |
2551 CHECK(result->Equals(expected_name)); | 2551 CHECK(result->Equals(expected_name)); |
2552 i::DeleteArray(two_byte_source); | 2552 i::DeleteArray(two_byte_source); |
2553 i::DeleteArray(two_byte_name); | 2553 i::DeleteArray(two_byte_name); |
2554 } | 2554 } |
| 2555 |
| 2556 |
| 2557 TEST(RegressionLazyFunctionWithErrorWithArg) { |
| 2558 // The bug occurred when a lazy function had an error which requires a |
| 2559 // parameter (such as "unknown label" here). The error message was processed |
| 2560 // before the AstValueFactory containing the error message string was |
| 2561 // internalized. |
| 2562 v8::Isolate* isolate = CcTest::isolate(); |
| 2563 v8::HandleScope scope(isolate); |
| 2564 LocalContext env; |
| 2565 i::FLAG_lazy = true; |
| 2566 i::FLAG_min_preparse_length = 0; |
| 2567 CompileRun("function this_is_lazy() {\n" |
| 2568 " break p;\n" |
| 2569 "}\n" |
| 2570 "this_is_lazy();\n"); |
| 2571 } |
OLD | NEW |