cjs-module-lexer icon indicating copy to clipboard operation
cjs-module-lexer copied to clipboard

feat: Support arrow getter in `Object.defineProperty`

Open magic-akari opened this issue 1 year ago • 2 comments

This pull request add support to arrow getter in Object.defineProperty.

Object.defineProperty(exports, 'a', {
    enumerable: true,
    get: function () {
        return q.p;
    }
});

Object.defineProperty(exports, 'b', {
    enumerable: true,
    get() {
        return q.p;
    }
});

Object.defineProperty(exports, 'c', {
    enumerable: true,
    get: () => {
        return q.p;
    }
});

Object.defineProperty(exports, 'd', {
    enumerable: true,
    get: () => q.p,
});

Before this pull request, only a and b are detected. After this pull request, c and d will also be detected.

magic-akari avatar Sep 12 '22 14:09 magic-akari

/cc @guybedford

himself65 avatar Sep 12 '22 16:09 himself65

@Himself65 sorry, but this package is only taking bug fixes, not feature additions at this point, due to backwards compatibility requirements.

guybedford avatar Sep 12 '22 16:09 guybedford