class X { constructor() { return 1; } foo() { } } var x = new X();