OLD | NEW |
---|---|
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
171 // Print errors that happened during execution. | 171 // Print errors that happened during execution. |
172 if (report_exceptions && !FLAG_debugger) | 172 if (report_exceptions && !FLAG_debugger) |
173 ReportException(&try_catch); | 173 ReportException(&try_catch); |
174 return false; | 174 return false; |
175 } else { | 175 } else { |
176 ASSERT(!try_catch.HasCaught()); | 176 ASSERT(!try_catch.HasCaught()); |
177 if (print_result && !result->IsUndefined()) { | 177 if (print_result && !result->IsUndefined()) { |
178 // If all went well and the result wasn't undefined then print | 178 // If all went well and the result wasn't undefined then print |
179 // the returned value. | 179 // the returned value. |
180 v8::String::Utf8Value str(result); | 180 v8::String::Utf8Value str(result); |
181 fwrite(*str, sizeof(**str), str.length(), stdout); | 181 size_t count = fwrite(*str, sizeof(**str), str.length(), stdout); |
182 (void) count; // Silence GCC-4.5.x "unused result" warning. | |
Sven Panne
2011/10/18 09:25:38
FYI only: I've just checked that simply using "(vo
| |
182 printf("\n"); | 183 printf("\n"); |
183 } | 184 } |
184 return true; | 185 return true; |
185 } | 186 } |
186 } | 187 } |
187 } | 188 } |
188 | 189 |
189 | 190 |
190 Handle<Value> Shell::Print(const Arguments& args) { | 191 Handle<Value> Shell::Print(const Arguments& args) { |
191 Handle<Value> val = Write(args); | 192 Handle<Value> val = Write(args); |
(...skipping 1163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1355 } | 1356 } |
1356 | 1357 |
1357 } // namespace v8 | 1358 } // namespace v8 |
1358 | 1359 |
1359 | 1360 |
1360 #ifndef GOOGLE3 | 1361 #ifndef GOOGLE3 |
1361 int main(int argc, char* argv[]) { | 1362 int main(int argc, char* argv[]) { |
1362 return v8::Shell::Main(argc, argv); | 1363 return v8::Shell::Main(argc, argv); |
1363 } | 1364 } |
1364 #endif | 1365 #endif |
OLD | NEW |