OLD | NEW |
1 // Copyright 2008 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 |
11 // with the distribution. | 11 // with the distribution. |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 if (first) { | 116 if (first) { |
117 first = false; | 117 first = false; |
118 } else { | 118 } else { |
119 printf(" "); | 119 printf(" "); |
120 } | 120 } |
121 v8::String::Utf8Value str(args[i]); | 121 v8::String::Utf8Value str(args[i]); |
122 const char* cstr = ToCString(str); | 122 const char* cstr = ToCString(str); |
123 printf("%s", cstr); | 123 printf("%s", cstr); |
124 } | 124 } |
125 printf("\n"); | 125 printf("\n"); |
| 126 fflush(stdout); |
126 return v8::Undefined(); | 127 return v8::Undefined(); |
127 } | 128 } |
128 | 129 |
129 | 130 |
130 // The callback that is invoked by v8 whenever the JavaScript 'load' | 131 // The callback that is invoked by v8 whenever the JavaScript 'load' |
131 // function is called. Loads, compiles and executes its argument | 132 // function is called. Loads, compiles and executes its argument |
132 // JavaScript file. | 133 // JavaScript file. |
133 v8::Handle<v8::Value> Load(const v8::Arguments& args) { | 134 v8::Handle<v8::Value> Load(const v8::Arguments& args) { |
134 for (int i = 0; i < args.Length(); i++) { | 135 for (int i = 0; i < args.Length(); i++) { |
135 v8::HandleScope handle_scope; | 136 v8::HandleScope handle_scope; |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 for (int i = 0; i < start; i++) { | 265 for (int i = 0; i < start; i++) { |
265 printf(" "); | 266 printf(" "); |
266 } | 267 } |
267 int end = message->GetEndColumn(); | 268 int end = message->GetEndColumn(); |
268 for (int i = start; i < end; i++) { | 269 for (int i = start; i < end; i++) { |
269 printf("^"); | 270 printf("^"); |
270 } | 271 } |
271 printf("\n"); | 272 printf("\n"); |
272 } | 273 } |
273 } | 274 } |
OLD | NEW |