Skip to content

TypeError: clazz is not a constructor on ≥ v11.6.0 #25451

@nakhodkin

Description

@nakhodkin

I'm experiencing an issue with a following piece of code

screen shot 2019-01-11 at 10 27 41 pm

'use strict';

const people = [
  ['John', 19, 'm'],
  ['Valentine', 28, 'f'],
  ['Christina', 25, 'f']
];

class Person {
  get name() {
    return this[0];
  }
  
  get age() {
    return this[1];
  }
  
  get sex() {
    return this[2];
  }
}

people.forEach(person => Object.setPrototypeOf(person, Person.prototype));

const query = person => person.age > 25;

people.filter(query);

You can see a more detailed information about the stacktrace right below
screen shot 2019-01-11 at 10 49 55 pm

  • Node: v11.6.0:
  • Platform: macOS Mojave Version 10.14.2:

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-bugIssues with confirmed bugs.utilIssues and PRs related to the built-in util module.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions