-
-
Save twada/af515224d858426ff480 to your computer and use it in GitHub Desktop.
BlockStatement:exit
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
onCodePathStart: s1 | |
onCodePathSegmentStart: s1_1 | |
onCodePathStart: s2 | |
onCodePathSegmentStart: s2_1 | |
BlockStatement:enter currentCodePath.currentSegments.length: 1 currentCodePath.currentSegments[0].id: s2_1 | |
BlockStatement:enter currentSegment.id: s2_1 | |
onCodePathSegmentEnd: s2_1 | |
onCodePathSegmentStart: s2_2 | |
BlockStatement:enter currentCodePath.currentSegments.length: 1 currentCodePath.currentSegments[0].id: s2_2 | |
BlockStatement:enter currentSegment.id: s2_2 | |
onCodePathSegmentEnd: s2_2 | |
BlockStatement:exit currentCodePath.currentSegments.length: 1 currentCodePath.currentSegments[0].id: s2_3 <= !? | |
BlockStatement:exit currentSegment.id: null <= !? | |
onCodePathSegmentStart: s2_4 | |
BlockStatement:exit currentCodePath.currentSegments.length: 1 currentCodePath.currentSegments[0].id: s2_4 | |
BlockStatement:exit currentSegment.id: s2_4 | |
onCodePathSegmentEnd: s2_4 | |
onCodePathEnd: s2 | |
onCodePathSegmentEnd: s1_1 | |
onCodePathEnd: s1 |
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
module.exports = function(context) { | |
var currentCodePath = null; | |
var currentSegment = null; | |
return { | |
onCodePathStart: function(codePath, node) { | |
console.log('onCodePathStart: ' + codePath.id); | |
currentCodePath = codePath; | |
}, | |
onCodePathEnd: function(codePath, node) { | |
console.log('onCodePathEnd: ' + codePath.id); | |
currentCodePath = currentCodePath.upper; | |
}, | |
onCodePathSegmentStart: function(segment, node) { | |
console.log('onCodePathSegmentStart: ' + segment.id); | |
currentSegment = segment; | |
}, | |
onCodePathSegmentEnd: function(segment, node) { | |
console.log('onCodePathSegmentEnd: ' + segment.id); | |
currentSegment = null; | |
}, | |
BlockStatement: function () { | |
console.log('BlockStatement:enter currentCodePath.currentSegments.length: ' + currentCodePath.currentSegments.length + ' currentCodePath.currentSegments[0].id: ' + currentCodePath.currentSegments[0].id); | |
console.log('BlockStatement:enter currentSegment.id: ' + (currentSegment && currentSegment.id)); | |
}, | |
'BlockStatement:exit': function () { | |
console.log('BlockStatement:exit currentCodePath.currentSegments.length: ' + currentCodePath.currentSegments.length + ' currentCodePath.currentSegments[0].id: ' + currentCodePath.currentSegments[0].id); | |
console.log('BlockStatement:exit currentSegment.id: ' + (currentSegment && currentSegment.id)); | |
} | |
}; | |
}; |
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
foo((done) => { | |
if (bar()) { | |
return done(); | |
} | |
baz(); | |
done(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment