[parser] Add convenient Print function for debugging.

R=rossberg@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2127833002
Cr-Commit-Position: refs/heads/master@{#37554}
This commit is contained in:
neis 2016-07-06 07:11:54 -07:00 committed by Commit bot
parent e0348dc783
commit 2da571d268
2 changed files with 10 additions and 0 deletions

View File

@ -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

View File

@ -1117,6 +1117,10 @@ class Parser : public ParserBase<ParserTraits> {
HistogramTimer* pre_parse_timer_;
bool parsing_on_main_thread_;
#ifdef DEBUG
void Print(AstNode* node);
#endif // DEBUG
};