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

Side by Side Diff: samples/shell.cc

Issue 4081: Various test-related changes. (Closed)
Patch Set: Created 12 years, 2 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
« no previous file with comments | « no previous file | test/mjsunit/bugs/bug-86.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2008 the V8 project authors. All rights reserved. 1 // Copyright 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 for (int i = 1; i < argc; i++) { 66 for (int i = 1; i < argc; i++) {
67 const char* str = argv[i]; 67 const char* str = argv[i];
68 if (strcmp(str, "--shell") == 0) { 68 if (strcmp(str, "--shell") == 0) {
69 run_shell = true; 69 run_shell = true;
70 } else if (strcmp(str, "-f") == 0) { 70 } else if (strcmp(str, "-f") == 0) {
71 // Ignore any -f flags for compatibility with the other stand- 71 // Ignore any -f flags for compatibility with the other stand-
72 // alone JavaScript engines. 72 // alone JavaScript engines.
73 continue; 73 continue;
74 } else if (strncmp(str, "--", 2) == 0) { 74 } else if (strncmp(str, "--", 2) == 0) {
75 printf("Warning: unknown flag %s.\n", str); 75 printf("Warning: unknown flag %s.\n", str);
76 } else if (strcmp(str, "-e") == 0 && i + 1 < argc) {
77 // Execute argument given to -e option directly
78 v8::HandleScope handle_scope;
79 v8::Handle<v8::String> file_name = v8::String::New("unnamed");
80 v8::Handle<v8::String> source = v8::String::New(argv[i + 1]);
81 if (!ExecuteString(source, file_name, false, true))
82 return 1;
83 i++;
76 } else { 84 } else {
77 // Use all other arguments as names of files to load and run. 85 // Use all other arguments as names of files to load and run.
78 v8::HandleScope handle_scope; 86 v8::HandleScope handle_scope;
79 v8::Handle<v8::String> file_name = v8::String::New(str); 87 v8::Handle<v8::String> file_name = v8::String::New(str);
80 v8::Handle<v8::String> source = ReadFile(str); 88 v8::Handle<v8::String> source = ReadFile(str);
81 if (source.IsEmpty()) { 89 if (source.IsEmpty()) {
82 printf("Error reading '%s'\n", str); 90 printf("Error reading '%s'\n", str);
83 return 1; 91 return 1;
84 } 92 }
85 if (!ExecuteString(source, file_name, false, true)) 93 if (!ExecuteString(source, file_name, false, true))
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 for (int i = 0; i < start; i++) { 249 for (int i = 0; i < start; i++) {
242 printf(" "); 250 printf(" ");
243 } 251 }
244 int end = message->GetEndColumn(); 252 int end = message->GetEndColumn();
245 for (int i = start; i < end; i++) { 253 for (int i = start; i < end; i++) {
246 printf("^"); 254 printf("^");
247 } 255 }
248 printf("\n"); 256 printf("\n");
249 } 257 }
250 } 258 }
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/bugs/bug-86.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698