Last active
February 10, 2018 13:25
-
-
Save k1r0s/f5304bff7947e8fa8a64afd1c0c7f71b to your computer and use it in GitHub Desktop.
override advice implementation using kaop
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
const reflect = require("./reflect"); | |
const apply = reflect.advice(meta => | |
meta.target.super.prototype[meta.key].apply(meta.scope, meta.args)); | |
const implement = reflect.advice(meta => | |
meta.args.unshift(meta.target.super.prototype[meta.key].bind(meta.scope)); | |
module.exports = { | |
apply, | |
implement | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment