| OLD | NEW |
| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 bool run_shell = (argc == 1); | 65 bool run_shell = (argc == 1); |
| 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.\nTry --help for options\n", str); |
| 76 } else if (strcmp(str, "-e") == 0 && i + 1 < argc) { | 76 } else if (strcmp(str, "-e") == 0 && i + 1 < argc) { |
| 77 // Execute argument given to -e option directly | 77 // Execute argument given to -e option directly |
| 78 v8::HandleScope handle_scope; | 78 v8::HandleScope handle_scope; |
| 79 v8::Handle<v8::String> file_name = v8::String::New("unnamed"); | 79 v8::Handle<v8::String> file_name = v8::String::New("unnamed"); |
| 80 v8::Handle<v8::String> source = v8::String::New(argv[i + 1]); | 80 v8::Handle<v8::String> source = v8::String::New(argv[i + 1]); |
| 81 if (!ExecuteString(source, file_name, false, true)) | 81 if (!ExecuteString(source, file_name, false, true)) |
| 82 return 1; | 82 return 1; |
| 83 i++; | 83 i++; |
| 84 } else { | 84 } else { |
| 85 // 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. |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 for (int i = 0; i < start; i++) { | 249 for (int i = 0; i < start; i++) { |
| 250 printf(" "); | 250 printf(" "); |
| 251 } | 251 } |
| 252 int end = message->GetEndColumn(); | 252 int end = message->GetEndColumn(); |
| 253 for (int i = start; i < end; i++) { | 253 for (int i = start; i < end; i++) { |
| 254 printf("^"); | 254 printf("^"); |
| 255 } | 255 } |
| 256 printf("\n"); | 256 printf("\n"); |
| 257 } | 257 } |
| 258 } | 258 } |
| OLD | NEW |