Remove asciiSlice from docs
authorRyan Dahl <ry@tinyclouds.org>
Wed, 23 Mar 2011 22:01:49 +0000 (15:01 -0700)
committerRyan Dahl <ry@tinyclouds.org>
Wed, 23 Mar 2011 22:02:11 +0000 (15:02 -0700)
doc/api/child_processes.markdown

index 804056b..b30de4b 100644 (file)
@@ -130,8 +130,9 @@ Example of checking for failed exec:
     var spawn = require('child_process').spawn,
         child = spawn('bad_command');
 
+    child.stderr.setEncoding('utf8');
     child.stderr.on('data', function (data) {
-      if (/^execvp\(\)/.test(data.asciiSlice(0,data.length))) {
+      if (/^execvp\(\)/.test(data)) {
         console.log('Failed to start child process.');
       }
     });