Skip to content

Commit

Permalink
test: remove constructor keyword usage in applyAspect feat
Browse files Browse the repository at this point in the history
  • Loading branch information
k1r0s committed Dec 13, 2017
1 parent a561a3d commit e0801d6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/apply-aspect.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
export function applyAspect ({ constructor = [], ...methodAdvices }: any) {
export function applyAspect ({ instance = [], ...methodAdvices }: any) {
return function (target) {
for (let key in methodAdvices) {
methodAdvices[key].forEach(advice =>
Object.defineProperty(target.prototype, key,
advice(target, key, Object.getOwnPropertyDescriptor(target.prototype, key))))
}

constructor.forEach(advice => target = advice(target))
instance.forEach(advice => target = advice(target))
return target
}
}

0 comments on commit e0801d6

Please sign in to comment.