Created
March 15, 2013 12:56
-
-
Save koichik/5169720 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var s = ''; | |
for (var i = 0; i < 1E5; ++i) s += 'あ'; | |
process.send(s); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var assert = require('assert'); | |
var child = require('child_process').fork(__dirname + '/child.js'); | |
child.on('message', function(s) { | |
for (var i = 0, len = s.length; i < len; ++i) | |
assert.equal(s[i], 'あ'); | |
child.kill(); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ node -v | |
v0.8.22 | |
$ node parent.js | |
assert.js:102 | |
throw new assert.AssertionError({ | |
^ | |
AssertionError: "�" == "あ" | |
at ChildProcess.<anonymous> (/tmp/parent.js:5:12) | |
at ChildProcess.EventEmitter.emit (events.js:99:17) | |
at handleMessage (child_process.js:273:12) | |
at Pipe.channel.onread (child_process.js:293:9) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment