Commit 68668834 authored by Sathya Gunasekaran's avatar Sathya Gunasekaran Committed by Commit Bot

[ast] Print class fields initializers in AstPrinter

Bug: v8:5367
Change-Id: I0c86d7204301665412ef0ef370eb1f0c61123031
Reviewed-on: https://chromium-review.googlesource.com/774264Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49407}
parent 3cf32599
......@@ -738,6 +738,10 @@ const char* AstPrinter::PrintProgram(FunctionLiteral* program) {
if (program->raw_inferred_name()) {
PrintLiteralIndented("INFERRED NAME", program->raw_inferred_name(), true);
}
if (program->instance_class_fields_initializer() != nullptr) {
PrintIndentedVisit("INSTANCE FIELDS INITIALIZER",
program->instance_class_fields_initializer());
}
PrintParameters(program->scope());
PrintDeclarations(program->scope()->declarations());
PrintStatements(program->body());
......@@ -991,6 +995,18 @@ void AstPrinter::VisitClassLiteral(ClassLiteral* node) {
if (node->extends() != nullptr) {
PrintIndentedVisit("EXTENDS", node->extends());
}
if (node->static_fields_initializer() != nullptr) {
PrintIndentedVisit("STATIC FIELDS INITIALIZER",
node->static_fields_initializer());
}
if (node->instance_fields_initializer_function() != nullptr) {
PrintIndentedVisit("INSTANCE FIELDS INITIALIZER",
node->instance_fields_initializer_function());
}
if (node->instance_fields_initializer_proxy() != nullptr) {
PrintIndentedVisit("INSTANCE FIELDS INITIALIZER VAR",
node->instance_fields_initializer_proxy());
}
PrintClassProperties(node->properties());
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment