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 1740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1751 char* chars = ReadChars(isolate, name, &size); | 1751 char* chars = ReadChars(isolate, name, &size); |
1752 if (chars == NULL) return Handle<String>(); | 1752 if (chars == NULL) return Handle<String>(); |
1753 Handle<String> result = String::New(chars, size); | 1753 Handle<String> result = String::New(chars, size); |
1754 delete[] chars; | 1754 delete[] chars; |
1755 return result; | 1755 return result; |
1756 } | 1756 } |
1757 | 1757 |
1758 | 1758 |
1759 void Shell::RunShell(Isolate* isolate) { | 1759 void Shell::RunShell(Isolate* isolate) { |
1760 Locker locker(isolate); | 1760 Locker locker(isolate); |
| 1761 HandleScope outer_scope(isolate); |
1761 Context::Scope context_scope(isolate, evaluation_context_); | 1762 Context::Scope context_scope(isolate, evaluation_context_); |
1762 PerIsolateData::RealmScope realm_scope(PerIsolateData::Get(isolate)); | 1763 PerIsolateData::RealmScope realm_scope(PerIsolateData::Get(isolate)); |
1763 HandleScope outer_scope(isolate); | |
1764 Handle<String> name = String::New("(d8)"); | 1764 Handle<String> name = String::New("(d8)"); |
1765 LineEditor* console = LineEditor::Get(); | 1765 LineEditor* console = LineEditor::Get(); |
1766 printf("V8 version %s [console: %s]\n", V8::GetVersion(), console->name()); | 1766 printf("V8 version %s [console: %s]\n", V8::GetVersion(), console->name()); |
1767 console->Open(isolate); | 1767 console->Open(isolate); |
1768 while (true) { | 1768 while (true) { |
1769 HandleScope inner_scope(isolate); | 1769 HandleScope inner_scope(isolate); |
1770 Handle<String> input = console->Prompt(Shell::kPrompt); | 1770 Handle<String> input = console->Prompt(Shell::kPrompt); |
1771 if (input.IsEmpty()) break; | 1771 if (input.IsEmpty()) break; |
1772 ExecuteString(isolate, input, name, true, true); | 1772 ExecuteString(isolate, input, name, true, true); |
1773 } | 1773 } |
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2235 } | 2235 } |
2236 | 2236 |
2237 } // namespace v8 | 2237 } // namespace v8 |
2238 | 2238 |
2239 | 2239 |
2240 #ifndef GOOGLE3 | 2240 #ifndef GOOGLE3 |
2241 int main(int argc, char* argv[]) { | 2241 int main(int argc, char* argv[]) { |
2242 return v8::Shell::Main(argc, argv); | 2242 return v8::Shell::Main(argc, argv); |
2243 } | 2243 } |
2244 #endif | 2244 #endif |
OLD | NEW |