Reviewers: Jakob,

Message:
PTAL.

Description:
Fix lineprocessor sample and include it in the gyp build.

Based on a patch by Peter Rybin <[email protected]>
https://chromiumcodereview.appspot.com/10081030/

BUG=
TEST=


Please review this at http://codereview.chromium.org/9972006/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
  M samples/lineprocessor.cc
  M samples/samples.gyp


Index: samples/lineprocessor.cc
diff --git a/samples/lineprocessor.cc b/samples/lineprocessor.cc
index 1606a8f99c71b72ae52a8b47d847795e9f4c00eb..7a84a2a0ffd2f29a785eafe36d071d9f7e9fcfd0 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<v8::String> ReadLine() {
   }
   if (res == NULL) {
     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++) {
     if (*pos == '\n') {
       *pos = '\0';
Index: samples/samples.gyp
diff --git a/samples/samples.gyp b/samples/samples.gyp
index 55b2a98acd38ed699d52e07443dca5574eed2f50..3c720a748a19a146fcbae8d05bccdd27bb752b28 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',
+      ],
     }
   ],
 }


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to