Skip to content

Instantly share code, notes, and snippets.

@tiye
Created January 20, 2013 05:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tiye/4576784 to your computer and use it in GitHub Desktop.
Save tiye/4576784 to your computer and use it in GitHub Desktop.
Comfirm that when forking a process, object is copied not pointed
a =
a: 'new'
b: 'should change'
call = ->
process.send a
setTimeout call, 1000
log = console.log
do print = ->
log a
setTimeout print, 1000
fork = require 'child_process'
child = fork.fork 'callee.coffee'
log = console.log
child.on 'message', (data) ->
log 'data', data
data.c = 'chan'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment