Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

addded name to call enter/exit hook

  • Loading branch information...
commit eea518a14af036c6b3cc2ecb288810e1adb2441a 1 parent 82cb3df
@jdeal authored
Showing with 10 additions and 3 deletions.
  1. +1 −1  package.json
  2. +9 −2 transform/enter-exit.js
View
2  package.json
@@ -2,7 +2,7 @@
"author": "Justin Deal",
"name": "doctor",
"description": "Create documentation from a JavaScript AST.",
- "version": "0.1.24",
+ "version": "0.1.25",
"homepage": "https://github.com/jdeal/doctor",
"repository": {
"type": "git",
View
11 transform/enter-exit.js
@@ -11,8 +11,15 @@ function hookInfoString(options, node) {
if (node.type === 'file') {
info.type = 'module';
info.name = 'module';
- } else if (node.nodes[0].type === 'name') {
- info.name = node.nodes[0].value;
+ }
+ if (node.nodes[0]) {
+ if (node.nodes[0].type === 'name') {
+ info.name = node.nodes[0].value;
+ } else if (node.nodes[0].type === 'dot') {
+ if (node.nodes[0].nodes[1].type === 'name') {
+ info.name = node.nodes[0].nodes[1].value;
+ }
+ }
}
if (node.type === 'call') {
info.type = 'call';
Please sign in to comment.
Something went wrong with that request. Please try again.