Last active
January 8, 2016 19:55
-
-
Save jkrems/16deb968b7a66c34a3f2 to your computer and use it in GitHub Desktop.
CLS failure on iojs >= 1.8.4 (possibly earlier)
This file contains hidden or 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
#!/usr/bin/env bash | |
./configure | |
make -j4 | |
./iojs cls-failure.js |
This file contains hidden or 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
'use strict'; | |
var http = require('http'); | |
var assert = require('assert'); | |
var cls = require('continuation-local-storage'); | |
var ns = cls.createNamespace('minimal-cls-failure'); | |
ns.run(function() { | |
ns.set('y', 63); | |
http.get('http://api.reddit.com/r/javascript/about.json', function(res) { | |
// ns.bindEmitter(res); | |
console.log('"response"'); | |
assert.strictEqual(ns.get('y'), 63, | |
'Has the right context in "response" event'); | |
res.on('data', function() { | |
console.log('"data"'); | |
// This fails: | |
assert.strictEqual(ns.get('y'), 63, | |
'Has the right context in "data" event'); | |
}); | |
res.on('end', function() { | |
console.log('"end"'); | |
// This fails: | |
assert.strictEqual(ns.get('y'), 63, | |
'Has the right context in "end" event'); | |
console.log('ok'); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Results from
git bisect
: