| OLD | NEW |
| 1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 continue; | 145 continue; |
| 146 } else if (strcmp(str, "--callback") == 0) { | 146 } else if (strcmp(str, "--callback") == 0) { |
| 147 support_callback = true; | 147 support_callback = true; |
| 148 } else if (strcmp(str, "--wait-for-connection") == 0) { | 148 } else if (strcmp(str, "--wait-for-connection") == 0) { |
| 149 wait_for_connection = true; | 149 wait_for_connection = true; |
| 150 } else if (strcmp(str, "--main-cycle-in-cpp") == 0) { | 150 } else if (strcmp(str, "--main-cycle-in-cpp") == 0) { |
| 151 cycle_type = CycleInCpp; | 151 cycle_type = CycleInCpp; |
| 152 } else if (strcmp(str, "--main-cycle-in-js") == 0) { | 152 } else if (strcmp(str, "--main-cycle-in-js") == 0) { |
| 153 cycle_type = CycleInJs; | 153 cycle_type = CycleInJs; |
| 154 } else if (strcmp(str, "-p") == 0 && i + 1 < argc) { | 154 } else if (strcmp(str, "-p") == 0 && i + 1 < argc) { |
| 155 port_number = atoi(argv[i + 1]); | 155 port_number = atoi(argv[i + 1]); // NOLINT |
| 156 i++; | 156 i++; |
| 157 } else if (strncmp(str, "--", 2) == 0) { | 157 } else if (strncmp(str, "--", 2) == 0) { |
| 158 printf("Warning: unknown flag %s.\nTry --help for options\n", str); | 158 printf("Warning: unknown flag %s.\nTry --help for options\n", str); |
| 159 } else if (strcmp(str, "-e") == 0 && i + 1 < argc) { | 159 } else if (strcmp(str, "-e") == 0 && i + 1 < argc) { |
| 160 script_source = v8::String::New(argv[i + 1]); | 160 script_source = v8::String::New(argv[i + 1]); |
| 161 script_name = v8::String::New("unnamed"); | 161 script_name = v8::String::New("unnamed"); |
| 162 i++; | 162 i++; |
| 163 script_param_counter++; | 163 script_param_counter++; |
| 164 } else { | 164 } else { |
| 165 // Use argument as a name of file to load. | 165 // Use argument as a name of file to load. |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 } | 416 } |
| 417 // remove newline char | 417 // remove newline char |
| 418 for (char* pos = buffer; *pos != '\0'; pos++) { | 418 for (char* pos = buffer; *pos != '\0'; pos++) { |
| 419 if (*pos == '\n') { | 419 if (*pos == '\n') { |
| 420 *pos = '\0'; | 420 *pos = '\0'; |
| 421 break; | 421 break; |
| 422 } | 422 } |
| 423 } | 423 } |
| 424 return v8::String::New(buffer); | 424 return v8::String::New(buffer); |
| 425 } | 425 } |
| OLD | NEW |