diff --git a/src/parsing/parser.cc b/src/parsing/parser.cc index 66241e1a11..95ec0992f5 100644 --- a/src/parsing/parser.cc +++ b/src/parsing/parser.cc @@ -7001,6 +7001,12 @@ Statement* ParserTraits::FinalizeForOfStatement(ForOfStatement* loop, int pos) { return final_loop; } +#ifdef DEBUG +void Parser::Print(AstNode* node) { + ast_value_factory()->Internalize(Isolate::Current()); + node->Print(Isolate::Current()); +} +#endif // DEBUG } // namespace internal } // namespace v8 diff --git a/src/parsing/parser.h b/src/parsing/parser.h index 3f2c488f09..268017bf30 100644 --- a/src/parsing/parser.h +++ b/src/parsing/parser.h @@ -1117,6 +1117,10 @@ class Parser : public ParserBase { HistogramTimer* pre_parse_timer_; bool parsing_on_main_thread_; + +#ifdef DEBUG + void Print(AstNode* node); +#endif // DEBUG };