Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 82 LineEditor* best = current; | 82 LineEditor* best = current; |
| 83 while (current != NULL) { | 83 while (current != NULL) { |
| 84 if (current->type_ > best->type_) | 84 if (current->type_ > best->type_) |
| 85 best = current; | 85 best = current; |
| 86 current = current->next_; | 86 current = current->next_; |
| 87 } | 87 } |
| 88 return best; | 88 return best; |
| 89 } | 89 } |
| 90 | 90 |
| 91 | 91 |
| 92 class DumbLineEditor: public LineEditor { | |
| 93 public: | |
| 94 DumbLineEditor() : LineEditor(LineEditor::DUMB, "dumb") { } | |
|
Philippe
2012/02/29 10:24:45
I didn't notice the side effect in LineEditor's co
| |
| 95 virtual Handle<String> Prompt(const char* prompt); | |
| 96 }; | |
| 97 | |
| 98 | |
| 99 static DumbLineEditor dumb_line_editor; | |
| 100 | |
| 101 | |
| 102 Handle<String> DumbLineEditor::Prompt(const char* prompt) { | |
| 103 printf("%s", prompt); | |
| 104 return Shell::ReadFromStdin(); | |
| 105 } | |
| 106 | |
| 107 | |
| 108 #ifndef V8_SHARED | 92 #ifndef V8_SHARED |
| 109 CounterMap* Shell::counter_map_; | 93 CounterMap* Shell::counter_map_; |
| 110 i::OS::MemoryMappedFile* Shell::counters_file_ = NULL; | 94 i::OS::MemoryMappedFile* Shell::counters_file_ = NULL; |
| 111 CounterCollection Shell::local_counters_; | 95 CounterCollection Shell::local_counters_; |
| 112 CounterCollection* Shell::counters_ = &local_counters_; | 96 CounterCollection* Shell::counters_ = &local_counters_; |
| 113 i::Mutex* Shell::context_mutex_(i::OS::CreateMutex()); | 97 i::Mutex* Shell::context_mutex_(i::OS::CreateMutex()); |
| 114 Persistent<Context> Shell::utility_context_; | 98 Persistent<Context> Shell::utility_context_; |
| 115 #endif // V8_SHARED | 99 #endif // V8_SHARED |
| 116 | 100 |
| 117 LineEditor* Shell::console = NULL; | 101 LineEditor* Shell::console = NULL; |
| (...skipping 1413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1531 } | 1515 } |
| 1532 | 1516 |
| 1533 } // namespace v8 | 1517 } // namespace v8 |
| 1534 | 1518 |
| 1535 | 1519 |
| 1536 #ifndef GOOGLE3 | 1520 #ifndef GOOGLE3 |
| 1537 int main(int argc, char* argv[]) { | 1521 int main(int argc, char* argv[]) { |
| 1538 return v8::Shell::Main(argc, argv); | 1522 return v8::Shell::Main(argc, argv); |
| 1539 } | 1523 } |
| 1540 #endif | 1524 #endif |
| OLD | NEW |