bublejs / bublejs/buble

Properties for class methods are not set properly

Open
#197 4 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
874
Forks
62
PR merge metrics
No merged PRs in 30d

Description

ES6 classes methods should not be enumerable, but code transpiled with buble got these methods enumerable.

Things like
```javascript
class aaa {
bbb() {}
}
```
should be transpiled into:
```javascript
var aaa = function aaa () {};

aaa.prototype.bbb = function bbb () {};
Object.defineProperty(aaa.prototype, 'bbb', {enumerable: false})
```
But the last line doesn't exist. So when trying to traversing the instance of `class aaa` will get `bbb` included, but it shouldn't appear. Hope this could be fixed soon.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the class-method transpilation entry point and reproducing the issue with the JavaScript example in the report. Verify that the generated prototype method is non-enumerable, matching the expected Object.defineProperty behavior, and add or update coverage for traversing an instance.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.