Skip to content

addAspectToMatches in ECMAScript 2015 classes #35

@mgechev

Description

@mgechev

Hello guys,

meld looks great! Congratulations for the job you did here.

I'm working on AOP library which takes advantage of ECMAScript 2016 decorators and as its foundation, currently, I'm using meld. However, I noticed that when applying aspect over a class defined with the ECMAScript 2015 class syntax the addAspectToMatches method doesn't work. This is caused by the fact that the methods added to the prototypes of the ES2015 classes are not enumerable but addAspectToMatches is using for..in in order to get them.

What I did is to use Object.getOwnPropertyNames instead, which works pretty well. Do you think it makes sense to do this change the algorithm used for iteration over the prototype's methods in meld?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions