Skip to content

Method class enumerable #15038

@sant123

Description

@sant123

TypeScript Version: 2.2.2

Code

class Person {
    greet() { }
    bye() { }
}

function checkProperties(obj) {
    console.log("Keys found in (for-in):");
    for (let key in obj) {
        console.log(`Found key: ${key}`);
    }
}

let p = new Person();

checkProperties(p);

Expected behavior:
ES5 or ES6 target, the methods should be non-enumerable.

Actual behavior:
In ES5 the methods are enumerable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptES6Relates to the ES6 SpecWon't FixThe severity and priority of this issue do not warrant the time or complexity needed to fix it

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions