From 605c8738061bc301b338707ffa5cb9bedd7b62d5 Mon Sep 17 00:00:00 2001 From: "yangguo@chromium.org" Date: Mon, 16 Apr 2012 09:23:56 +0000 Subject: [PATCH] Fix lineprocessor sample and include it in the gyp build. Based on a patch by Peter Rybin 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 --- samples/lineprocessor.cc | 6 +++--- samples/samples.gyp | 8 +++++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/samples/lineprocessor.cc b/samples/lineprocessor.cc index 1606a8f..7a84a2a 100644 --- a/samples/lineprocessor.cc +++ b/samples/lineprocessor.cc @@ -1,4 +1,4 @@ -// 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 // modification, are permitted provided that the following conditions are // met: @@ -434,9 +434,9 @@ v8::Handle ReadLine() { } if (res == NULL) { v8::Handle t = v8::Undefined(); - return reinterpret_cast&>(t); + return v8::Handle(v8::String::Cast(*t)); } - // remove newline char + // Remove newline char for (char* pos = buffer; *pos != '\0'; pos++) { if (*pos == '\n') { *pos = '\0'; diff --git a/samples/samples.gyp b/samples/samples.gyp index 55b2a98..3c720a7 100644 --- a/samples/samples.gyp +++ b/samples/samples.gyp @@ -1,4 +1,4 @@ -# 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 # modification, are permitted provided that the following conditions are # met: @@ -48,6 +48,12 @@ 'sources': [ 'process.cc', ], + }, + { + 'target_name': 'lineprocessor', + 'sources': [ + 'lineprocessor.cc', + ], } ], } -- 2.7.4