aspectify | driven aspect-oriented programming | Aspect Oriented library
kandi X-RAY | aspectify Summary
kandi X-RAY | aspectify Summary
DEPRECATION NOTE: Since the time this package was created, SciSpike has been acquired by Northscaler. There will be no further development on this module. Instead, development will continue at @northscaler/aspectify. You can see all of Northscaler's public Node.js modules at This package contains an implementation of exclusively decorator-driven aspect-oriented programming (AOP). It's similar in spirit to AspectJ's annotation-driven approach, whereby advised methods carry a visual indicator in the source that there is incoming behavior. In this way, there is no need for a special, AOP-aware editor for the developer to know when there is incoming advice. NOTE: This currently uses Babel 7's @babel/plugin-proposal-decorators in legacy: true mode, which is compliant with TC39's Stage 1 decorator proposal. It also uses @babel/plugin-proposal-class-properties with setting loose: true. As the decorator proposal matures, this library will have to be updated to support later proposals (stage 2 & later).
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of aspectify
aspectify Key Features
aspectify Examples and Code Snippets
Community Discussions
Trending Discussions on aspectify
QUESTION
I've created an exclusively decorator-driven AOP library that supports Before, AfterReturning, AfterThrowing, AfterFinally, and Around advice (a la AspectJ). It's called @scispike/aspectify.
It works great using all synchronous code. All synchronous tests pass just fine.
Problem occurs when I attempt to decorate an asynchronous method with asynchronous advice (that is, with a decorator that evaluates to an asynchronous function). I get a syntax error from Babel when issuing mocha --opts mocha.opts 'src/test/unit/**/*.spec.js' | npx bunyan
-- (via npm run u
-- see package.json and my mocha.opts
):
ANSWER
Answered 2019-Apr-04 at 12:54I try clone your repo, set retainLines: false
, and the syntax error goes away.
Looks like a bug in babel, retainLines
probably doesn't play well with async function syntax.
Full steps to reproduce my result:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install aspectify
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page