Skip to content

Commit

Permalink
fix(decorator): using @foo.bar decorator
Browse files Browse the repository at this point in the history
  • Loading branch information
h13i32maru committed Sep 20, 2017
1 parent 50f73b6 commit 46b4c29
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 1.0.3 (2017-09-20)
- **Fix**
- Broken if using `@foo.bar` decorator. ([#439](https://github.com/esdoc/esdoc/issues/439))

## 1.0.2 (2017-09-03)
- **Fix**
- Broken if code block has `@`. ([#436](https://github.com/esdoc/esdoc/pull/436)) Thanks [@pzuraq](https://github.com/pzuraq)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "esdoc",
"version": "1.0.2",
"version": "1.0.3",
"description": "Good Documentation Generator For JavaScript",
"author": {
"name": "h13i32maru",
Expand Down
6 changes: 5 additions & 1 deletion src/Doc/AbstractDoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -547,9 +547,13 @@ export default class AbstractDoc {
value.arguments = null;
break;
case 'CallExpression':
value.name = decorator.expression.callee.name;
value.name = babelGenerator(decorator.expression).code.replace(/[(].*/, '');
value.arguments = babelGenerator(decorator.expression).code.replace(/^[^(]+/, '');
break;
case 'MemberExpression':
value.name = babelGenerator(decorator.expression).code.replace(/[(].*/, '');
value.arguments = null;
break;
default:
throw new Error(`unknown decorator expression type: ${decorator.expression.type}`);
}
Expand Down

0 comments on commit 46b4c29

Please sign in to comment.