Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(107)

Side by Side Diff: samples/lineprocessor.cc

Issue 9972006: Fix lineprocessor sample and include it in the gyp build. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | samples/samples.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 427
428 char* res; 428 char* res;
429 { 429 {
430 #ifdef SUPPORT_DEBUGGING 430 #ifdef SUPPORT_DEBUGGING
431 v8::Unlocker unlocker; 431 v8::Unlocker unlocker;
432 #endif 432 #endif
433 res = fgets(buffer, kBufferSize, stdin); 433 res = fgets(buffer, kBufferSize, stdin);
434 } 434 }
435 if (res == NULL) { 435 if (res == NULL) {
436 v8::Handle<v8::Primitive> t = v8::Undefined(); 436 v8::Handle<v8::Primitive> t = v8::Undefined();
437 return reinterpret_cast<v8::Handle<v8::String>&>(t); 437 return v8::Handle<v8::String>(v8::String::Cast(*t));
438 } 438 }
439 // remove newline char 439 // Remove newline char
440 for (char* pos = buffer; *pos != '\0'; pos++) { 440 for (char* pos = buffer; *pos != '\0'; pos++) {
441 if (*pos == '\n') { 441 if (*pos == '\n') {
442 *pos = '\0'; 442 *pos = '\0';
443 break; 443 break;
444 } 444 }
445 } 445 }
446 return v8::String::New(buffer); 446 return v8::String::New(buffer);
447 } 447 }
OLDNEW
« no previous file with comments | « no previous file | samples/samples.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698