| Index: test/cctest/interpreter/generate-bytecode-expectations.cc
|
| diff --git a/test/cctest/interpreter/generate-bytecode-expectations.cc b/test/cctest/interpreter/generate-bytecode-expectations.cc
|
| index e5dca853a530073903298d1d3ae148194f3e8764..172a3e9b8fea86b07c25c1d8b2651096391876e4 100644
|
| --- a/test/cctest/interpreter/generate-bytecode-expectations.cc
|
| +++ b/test/cctest/interpreter/generate-bytecode-expectations.cc
|
| @@ -43,6 +43,7 @@ class ProgramOptions final {
|
| module_(false),
|
| top_level_(false),
|
| do_expressions_(false),
|
| + async_iteration_(false),
|
| verbose_(false) {}
|
|
|
| bool Validate() const;
|
| @@ -61,6 +62,7 @@ class ProgramOptions final {
|
| bool module() const { return module_; }
|
| bool top_level() const { return top_level_; }
|
| bool do_expressions() const { return do_expressions_; }
|
| + bool async_iteration() const { return async_iteration_; }
|
| bool verbose() const { return verbose_; }
|
| bool suppress_runtime_errors() const { return rebaseline_ && !verbose_; }
|
| std::vector<std::string> input_filenames() const { return input_filenames_; }
|
| @@ -77,6 +79,7 @@ class ProgramOptions final {
|
| bool module_;
|
| bool top_level_;
|
| bool do_expressions_;
|
| + bool async_iteration_;
|
| bool verbose_;
|
| std::vector<std::string> input_filenames_;
|
| std::string output_filename_;
|
| @@ -165,6 +168,8 @@ ProgramOptions ProgramOptions::FromCommandLine(int argc, char** argv) {
|
| options.top_level_ = true;
|
| } else if (strcmp(argv[i], "--do-expressions") == 0) {
|
| options.do_expressions_ = true;
|
| + } else if (strcmp(argv[i], "--async-iteration") == 0) {
|
| + options.async_iteration_ = true;
|
| } else if (strcmp(argv[i], "--verbose") == 0) {
|
| options.verbose_ = true;
|
| } else if (strncmp(argv[i], "--output=", 9) == 0) {
|
| @@ -267,6 +272,8 @@ void ProgramOptions::UpdateFromHeader(std::istream& stream) {
|
| top_level_ = ParseBoolean(line.c_str() + 11);
|
| } else if (line.compare(0, 16, "do expressions: ") == 0) {
|
| do_expressions_ = ParseBoolean(line.c_str() + 16);
|
| + } else if (line.compare(0, 17, "async iteration: ") == 0) {
|
| + async_iteration_ = ParseBoolean(line.c_str() + 17);
|
| } else if (line == "---") {
|
| break;
|
| } else if (line.empty()) {
|
| @@ -289,6 +296,7 @@ void ProgramOptions::PrintHeader(std::ostream& stream) const { // NOLINT
|
| if (module_) stream << "\nmodule: yes";
|
| if (top_level_) stream << "\ntop level: yes";
|
| if (do_expressions_) stream << "\ndo expressions: yes";
|
| + if (async_iteration_) stream << "\nasync iteration: yes";
|
|
|
| stream << "\n\n";
|
| }
|
| @@ -393,6 +401,7 @@ void GenerateExpectationsFile(std::ostream& stream, // NOLINT
|
| }
|
|
|
| if (options.do_expressions()) i::FLAG_harmony_do_expressions = true;
|
| + if (options.async_iteration()) i::FLAG_harmony_async_iteration = true;
|
|
|
| stream << "#\n# Autogenerated by generate-bytecode-expectations.\n#\n\n";
|
| options.PrintHeader(stream);
|
| @@ -401,6 +410,7 @@ void GenerateExpectationsFile(std::ostream& stream, // NOLINT
|
| }
|
|
|
| i::FLAG_harmony_do_expressions = false;
|
| + i::FLAG_harmony_async_iteration = false;
|
| }
|
|
|
| bool WriteExpectationsFile(const std::vector<std::string>& snippet_list,
|
| @@ -445,6 +455,7 @@ void PrintUsage(const char* exec_path) {
|
| "Specify the name of the test function.\n"
|
| " --top-level Process top level code, not the top-level function.\n"
|
| " --do-expressions Enable harmony_do_expressions flag.\n"
|
| + " --async-iteration Enable harmony_async_iteration flag.\n"
|
| " --output=file.name\n"
|
| " Specify the output file. If not specified, output goes to "
|
| "stdout.\n"
|
|
|