Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1758)

Side by Side Diff: src/d8.cc

Issue 12224118: Don't use local variable after its scoped has been left. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1479 matching lines...) Expand 10 before | Expand all | Expand 10 after
1490 delete[] chars; 1490 delete[] chars;
1491 return result; 1491 return result;
1492 } 1492 }
1493 1493
1494 1494
1495 void Shell::RunShell(Isolate* isolate) { 1495 void Shell::RunShell(Isolate* isolate) {
1496 Locker locker(isolate); 1496 Locker locker(isolate);
1497 Context::Scope context_scope(evaluation_context_); 1497 Context::Scope context_scope(evaluation_context_);
1498 HandleScope outer_scope; 1498 HandleScope outer_scope;
1499 Handle<String> name = String::New("(d8)"); 1499 Handle<String> name = String::New("(d8)");
1500 DumbLineEditor dumb_line_editor(isolate);
1501 LineEditor* console = LineEditor::Get(); 1500 LineEditor* console = LineEditor::Get();
1502 printf("V8 version %s [console: %s]\n", V8::GetVersion(), console->name()); 1501 printf("V8 version %s [console: %s]\n", V8::GetVersion(), console->name());
1503 console->Open(); 1502 console->Open();
1504 while (true) { 1503 while (true) {
1505 HandleScope inner_scope; 1504 HandleScope inner_scope;
1506 Handle<String> input = console->Prompt(Shell::kPrompt); 1505 Handle<String> input = console->Prompt(Shell::kPrompt);
1507 if (input.IsEmpty()) break; 1506 if (input.IsEmpty()) break;
1508 ExecuteString(input, name, true, true); 1507 ExecuteString(input, name, true, true);
1509 } 1508 }
1510 printf("\n"); 1509 printf("\n");
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
1895 } 1894 }
1896 #endif // V8_SHARED 1895 #endif // V8_SHARED
1897 return 0; 1896 return 0;
1898 } 1897 }
1899 1898
1900 1899
1901 int Shell::Main(int argc, char* argv[]) { 1900 int Shell::Main(int argc, char* argv[]) {
1902 if (!SetOptions(argc, argv)) return 1; 1901 if (!SetOptions(argc, argv)) return 1;
1903 int result = 0; 1902 int result = 0;
1904 Isolate* isolate = Isolate::GetCurrent(); 1903 Isolate* isolate = Isolate::GetCurrent();
1904 DumbLineEditor dumb_line_editor(isolate);
1905 { 1905 {
1906 Initialize(isolate); 1906 Initialize(isolate);
1907 Symbols symbols(isolate); 1907 Symbols symbols(isolate);
1908 InitializeDebugger(isolate); 1908 InitializeDebugger(isolate);
1909 1909
1910 if (options.stress_opt || options.stress_deopt) { 1910 if (options.stress_opt || options.stress_deopt) {
1911 Testing::SetStressRunType(options.stress_opt 1911 Testing::SetStressRunType(options.stress_opt
1912 ? Testing::kStressTypeOpt 1912 ? Testing::kStressTypeOpt
1913 : Testing::kStressTypeDeopt); 1913 : Testing::kStressTypeDeopt);
1914 int stress_runs = Testing::GetStressRuns(); 1914 int stress_runs = Testing::GetStressRuns();
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
1964 } 1964 }
1965 1965
1966 } // namespace v8 1966 } // namespace v8
1967 1967
1968 1968
1969 #ifndef GOOGLE3 1969 #ifndef GOOGLE3
1970 int main(int argc, char* argv[]) { 1970 int main(int argc, char* argv[]) {
1971 return v8::Shell::Main(argc, argv); 1971 return v8::Shell::Main(argc, argv);
1972 } 1972 }
1973 #endif 1973 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698