const AstString* GetString(Handle<String> literal);
void Internalize(Isolate* isolate);
+ bool IsInternalized() {
+ return isolate_ != NULL;
+ }
#define F(name, str) \
const AstString* name##_string() const { return name##_string_; }
}
}
+ ast_value_factory_->Internalize(isolate());
if (ok) {
result = factory()->NewFunctionLiteral(
ast_value_factory_->empty_string(),
// Make sure the target stack is empty.
ASSERT(target_stack_ == NULL);
+ ast_value_factory_->Internalize(isolate());
if (result == NULL) {
if (stack_overflow()) {
isolate()->StackOverflow();
void Parser::ThrowPendingError() {
+ ASSERT(ast_value_factory_->IsInternalized());
if (has_pending_error_) {
MessageLocation location(script_,
pending_error_location_.beg_pos,
}
}
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_);
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");
+}