This happens only on node 0.9.x, 0.8.11 works just fine.
To check: npm install aligned-buffer
+ require
it in node.js repl.
(function() { | |
var http = require("http"), | |
child = require("child_process"), | |
url = require("url"), | |
stream = require("stream"); | |
http.createServer(function(req, res) { | |
var params = url.parse(req.url, true), | |
args = params.query.args ? JSON.parse(params.query.args) : [], | |
cmd = params.pathname.substr(1), |
we're good! | |
we're good! | |
we failed | |
/Users/bobrik/projects/backpack-coordinator/test6.js:8 | |
throw error; | |
^ | |
Error: three | |
at /Users/bobrik/pew/test.js:23:9 | |
at Object.<anonymous> (/Users/bobrik/pew/test.js:24:3) |
% node | |
> url = require("url") | |
> url.format({protocol: "http:", host: "google.com", port: 123}) | |
'http://google.com' |
(function() { | |
var func, started; | |
function sync(fn) { | |
var running = false, | |
requested = []; | |
return function me(callback) { | |
if (running) { | |
requested.push(callback); |
<?php | |
// observable user | |
class User { | |
const EVENT_TYPE_AFTER_LOAD_FOR_UPDATE = 'afterLoadForUpdate'; | |
const EVENT_TYPE_AFTER_SAVE = 'afterSave'; | |
private $Foo; |
This happens only on node 0.9.x, 0.8.11 works just fine.
To check: npm install aligned-buffer
+ require
it in node.js repl.
web372 backpack # npm install --verbose aligned-buffer | |
npm info it worked if it ends with ok | |
npm verb cli [ 'node', | |
npm verb cli '/usr/bin/npm', | |
npm verb cli 'install', | |
npm verb cli '--verbose', | |
npm verb cli 'aligned-buffer' ] | |
npm info using [email protected] | |
npm info using [email protected] | |
npm verb read json /opt/backpack/package.json |
web # id; npm config ls -l; npm config get user | |
uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel),11(floppy),26(tape),27(video) | |
; cli configs | |
long = true | |
registry = "https://registry.npmjs.org/" | |
; default values | |
always-auth = false | |
browser = "google-chrome" | |
cache = "/root/.npm" |
// writing 3 buffers starting from offset 0 | |
// 3 bytes | 5 bytes | 10 bytes | |
// second | first | third | |
// last byte of the last buffer should be at offset 18 | |
// file should be 18 bytes long | |
// this is WRONG on linux, file grows up for 18 bytes after each run | |
// and every single written buffer can't be read properly | |
// | |
// holy fuck, the whole day lost. |
// rm aa; node buggy3.js | fgrep WTF | wc -l | |
// different results for each run | |
// writes are sequential | |
function FileWriterQueue(file) { | |
this.file = file; | |
this.queue = []; | |
} | |
FileWriterQueue.prototype.write = function(buffer, offset, callback) { |