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 333 matching lines...) Loading... | |
344 } else { | 344 } else { |
345 break; | 345 break; |
346 } | 346 } |
347 } | 347 } |
348 if (bytes_read + fullness > 0) { | 348 if (bytes_read + fullness > 0) { |
349 int length = bytes_read == 0 ? | 349 int length = bytes_read == 0 ? |
350 bytes_read + fullness : | 350 bytes_read + fullness : |
351 LengthWithoutIncompleteUtf8(buffer, bytes_read + fullness); | 351 LengthWithoutIncompleteUtf8(buffer, bytes_read + fullness); |
352 Handle<String> addition = String::New(buffer, length); | 352 Handle<String> addition = String::New(buffer, length); |
353 cons_args[0] = accumulator; | 353 cons_args[0] = accumulator; |
354 cons_args[1] = addition; | 354 cons_args[1] = addition; |
Søren Thygesen Gjesse
2011/06/21 07:31:06
We have the function String::Concat in the API now
| |
355 accumulator = Handle<String>::Cast(cons_function->Call( | 355 accumulator = Handle<String>::Cast(cons_function->Call( |
356 Shell::utility_context()->Global(), | 356 Shell::evaluation_context()->Global(), |
Yang
2011/06/21 02:25:55
Since we don't always have an utility context now
| |
357 2, | 357 2, |
358 cons_args)); | 358 cons_args)); |
359 fullness = bytes_read + fullness - length; | 359 fullness = bytes_read + fullness - length; |
360 memcpy(buffer, buffer + length, fullness); | 360 memcpy(buffer, buffer + length, fullness); |
361 } | 361 } |
362 } while (bytes_read != 0); | 362 } while (bytes_read != 0); |
363 return accumulator; | 363 return accumulator; |
364 } | 364 } |
365 | 365 |
366 | 366 |
(...skipping 319 matching lines...) Loading... | |
686 os_templ->Set(String::New("chdir"), FunctionTemplate::New(ChangeDirectory)); | 686 os_templ->Set(String::New("chdir"), FunctionTemplate::New(ChangeDirectory)); |
687 os_templ->Set(String::New("setenv"), FunctionTemplate::New(SetEnvironment)); | 687 os_templ->Set(String::New("setenv"), FunctionTemplate::New(SetEnvironment)); |
688 os_templ->Set(String::New("unsetenv"), | 688 os_templ->Set(String::New("unsetenv"), |
689 FunctionTemplate::New(UnsetEnvironment)); | 689 FunctionTemplate::New(UnsetEnvironment)); |
690 os_templ->Set(String::New("umask"), FunctionTemplate::New(SetUMask)); | 690 os_templ->Set(String::New("umask"), FunctionTemplate::New(SetUMask)); |
691 os_templ->Set(String::New("mkdirp"), FunctionTemplate::New(MakeDirectory)); | 691 os_templ->Set(String::New("mkdirp"), FunctionTemplate::New(MakeDirectory)); |
692 os_templ->Set(String::New("rmdir"), FunctionTemplate::New(RemoveDirectory)); | 692 os_templ->Set(String::New("rmdir"), FunctionTemplate::New(RemoveDirectory)); |
693 } | 693 } |
694 | 694 |
695 } // namespace v8 | 695 } // namespace v8 |
OLD | NEW |