Commit 605c8738 authored by yangguo@chromium.org's avatar yangguo@chromium.org

Fix lineprocessor sample and include it in the gyp build.

Based on a patch by Peter Rybin <peter.rybin@gmail.com> https://chromiumcodereview.appspot.com/10081030/

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/9972006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11326 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 267879e9
// Copyright 2009 the V8 project authors. All rights reserved. // Copyright 2012 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without // Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are // modification, are permitted provided that the following conditions are
// met: // met:
...@@ -434,9 +434,9 @@ v8::Handle<v8::String> ReadLine() { ...@@ -434,9 +434,9 @@ v8::Handle<v8::String> ReadLine() {
} }
if (res == NULL) { if (res == NULL) {
v8::Handle<v8::Primitive> t = v8::Undefined(); v8::Handle<v8::Primitive> t = v8::Undefined();
return reinterpret_cast<v8::Handle<v8::String>&>(t); return v8::Handle<v8::String>(v8::String::Cast(*t));
} }
// remove newline char // Remove newline char
for (char* pos = buffer; *pos != '\0'; pos++) { for (char* pos = buffer; *pos != '\0'; pos++) {
if (*pos == '\n') { if (*pos == '\n') {
*pos = '\0'; *pos = '\0';
......
# Copyright 2011 the V8 project authors. All rights reserved. # Copyright 2012 the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are # modification, are permitted provided that the following conditions are
# met: # met:
...@@ -48,6 +48,12 @@ ...@@ -48,6 +48,12 @@
'sources': [ 'sources': [
'process.cc', 'process.cc',
], ],
},
{
'target_name': 'lineprocessor',
'sources': [
'lineprocessor.cc',
],
} }
], ],
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment