4 ms·
Without a more specific example to go on, it’s difficult to speculate. The only case where you’d get an error asynchronously should be in the case of transition
by mbostock 10y ago
Without a more specific example to go on, it’s difficult to speculate. The only case where you’d get an error asynchronously should be in the case of transition.tween or an event listener—cases where the code is necessarily asynchronous—and not something like selection.attr or transition.attr, where the code can be evaluated synchronously.
It’s true that D3 uses closures and anonymous functions internally. But assuming you are using a debugger and the non-minified code, you can use that debugger to see exactly what the code is doing. To continue with the example of selection.attr, the implementation is here:
https://github.com/d3/d3-selection/blob/master/src/selection/attr.js https://github.com/d3/d3-selection/blob/master/src/selection...
So a typical call stack would be three deep: selection.attr > selection.each > attrFunction’s closure.