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

Unified Diff: src/parser.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ast-value-factory.h ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parser.cc
diff --git a/src/parser.cc b/src/parser.cc
index aa686a2d18eece60b815cf80ffe646cff68160a0..42d094938657541fa00a4ae2d14fe31a43e9e456 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -911,6 +911,7 @@ FunctionLiteral* Parser::DoParseProgram(CompilationInfo* info,
}
}
+ ast_value_factory_->Internalize(isolate());
if (ok) {
result = factory()->NewFunctionLiteral(
ast_value_factory_->empty_string(),
@@ -1031,6 +1032,7 @@ FunctionLiteral* Parser::ParseLazy(Utf16CharacterStream* source) {
// Make sure the target stack is empty.
ASSERT(target_stack_ == NULL);
+ ast_value_factory_->Internalize(isolate());
if (result == NULL) {
if (stack_overflow()) {
isolate()->StackOverflow();
@@ -3884,6 +3886,7 @@ void Parser::RegisterTargetUse(Label* target, Target* stop) {
void Parser::ThrowPendingError() {
+ ASSERT(ast_value_factory_->IsInternalized());
if (has_pending_error_) {
MessageLocation location(script_,
pending_error_location_.beg_pos,
@@ -4844,7 +4847,7 @@ bool Parser::Parse() {
}
}
info()->SetFunction(result);
- ast_value_factory_->Internalize(isolate());
+ ASSERT(ast_value_factory_->IsInternalized());
// info takes ownership of ast_value_factory_.
if (info()->ast_value_factory() == NULL) {
info()->SetAstValueFactory(ast_value_factory_);
« no previous file with comments | « src/ast-value-factory.h ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698