Last active
December 25, 2015 00:39
-
-
Save spollack/6889181 to your computer and use it in GitHub Desktop.
example that demonstrates how streamline 0.8.1 in fibers mode is not preserving line numbers when invoking non-streamline functions, if the call spans multiple lines
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
/*** Generated by streamline 0.8.1 (fibers) - DO NOT EDIT ***/var fstreamline__ = require("streamline/lib/fibers/runtime"); (fstreamline__.create(function(_) {var test_ = fstreamline__.create(test, 0), foo_ = fstreamline__.create(foo, 0); function test(_) { | |
foo(_); | |
fstreamline__.invoke(null, bar, [_], 0); | |
}; | |
function foo(_) { | |
// set a breakpoint on the next line | |
console.log('should not print before breakpoint hit'); | |
console.log('should print after breakpoint hit'); | |
} | |
var wrap = function(fn) { return fn; }; | |
var bar = wrap(fstreamline__.create(function(_) {}, 0)); | |
test(_); | |
}, 0).call(this, function(err) { | |
if (err) throw err; | |
})); |
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
require('streamline').register({ | |
fibers: true, | |
cache: true, | |
verbose: true | |
}); | |
require('./streamline_line_nums_test._js'); |
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
function test(_) { | |
foo(_); | |
bar( | |
_); | |
}; | |
function foo(_) { | |
// set a breakpoint on the next line | |
console.log('should not print before breakpoint hit'); | |
console.log('should print after breakpoint hit'); | |
} | |
var wrap = function(fn) { return fn; } | |
var bar = wrap(function(_) {}); | |
test(_); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment