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

Side by Side Diff: test/cctest/test-parsing.cc

Issue 335373002: Fix: AstValueFactory must be internalized before ThrowPendingError. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: added test Created 6 years, 6 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/parser.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « src/parser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698