| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 | 509 |
| 510 | 510 |
| 511 // static | 511 // static |
| 512 void FlagList::PrintHelp() { | 512 void FlagList::PrintHelp() { |
| 513 printf("Usage:\n"); | 513 printf("Usage:\n"); |
| 514 printf(" shell [options] -e string\n"); | 514 printf(" shell [options] -e string\n"); |
| 515 printf(" execute string in V8\n"); | 515 printf(" execute string in V8\n"); |
| 516 printf(" shell [options] file1 file2 ... filek\n"); | 516 printf(" shell [options] file1 file2 ... filek\n"); |
| 517 printf(" run JavaScript scripts in file1, file2, ..., filek\n"); | 517 printf(" run JavaScript scripts in file1, file2, ..., filek\n"); |
| 518 printf(" shell [options]\n"); | 518 printf(" shell [options]\n"); |
| 519 printf(" shell [options] --shell\n"); | 519 printf(" shell [options] --shell [file1 file2 ... filek]\n"); |
| 520 printf(" run an interactive JavaScript shell"); | 520 printf(" run an interactive JavaScript shell\n"); |
| 521 printf(" d8 [options] file\n"); | 521 printf(" d8 [options] file1 file2 ... filek\n"); |
| 522 printf(" d8 [options]\n"); | 522 printf(" d8 [options]\n"); |
| 523 printf(" d8 [options] --shell [file1 file2 ... filek]\n"); |
| 523 printf(" run the new debugging shell\n\n"); | 524 printf(" run the new debugging shell\n\n"); |
| 524 printf("Options:\n"); | 525 printf("Options:\n"); |
| 525 for (size_t i = 0; i < num_flags; ++i) { | 526 for (size_t i = 0; i < num_flags; ++i) { |
| 526 Flag* f = &flags[i]; | 527 Flag* f = &flags[i]; |
| 527 SmartPointer<const char> value = ToString(f); | 528 SmartPointer<const char> value = ToString(f); |
| 528 printf(" --%s (%s)\n type: %s default: %s\n", | 529 printf(" --%s (%s)\n type: %s default: %s\n", |
| 529 f->name(), f->comment(), Type2String(f->type()), *value); | 530 f->name(), f->comment(), Type2String(f->type()), *value); |
| 530 } | 531 } |
| 531 } | 532 } |
| 532 | 533 |
| 533 JSArguments::JSArguments() | 534 JSArguments::JSArguments() |
| 534 : argc_(0), argv_(NULL) {} | 535 : argc_(0), argv_(NULL) {} |
| 535 JSArguments::JSArguments(int argc, const char** argv) | 536 JSArguments::JSArguments(int argc, const char** argv) |
| 536 : argc_(argc), argv_(argv) {} | 537 : argc_(argc), argv_(argv) {} |
| 537 int JSArguments::argc() const { return argc_; } | 538 int JSArguments::argc() const { return argc_; } |
| 538 const char** JSArguments::argv() { return argv_; } | 539 const char** JSArguments::argv() { return argv_; } |
| 539 const char*& JSArguments::operator[](int idx) { return argv_[idx]; } | 540 const char*& JSArguments::operator[](int idx) { return argv_[idx]; } |
| 540 JSArguments& JSArguments::operator=(JSArguments args) { | 541 JSArguments& JSArguments::operator=(JSArguments args) { |
| 541 argc_ = args.argc_; | 542 argc_ = args.argc_; |
| 542 argv_ = args.argv_; | 543 argv_ = args.argv_; |
| 543 return *this; | 544 return *this; |
| 544 } | 545 } |
| 545 | 546 |
| 546 | 547 |
| 547 } } // namespace v8::internal | 548 } } // namespace v8::internal |
| OLD | NEW |