Closed ExE-Boss closed 4 years ago
I went with: “'bar' called on an object that is not a valid instance of Foo.
”, because Object.create(Foo.prototype)
is an instance of Foo
, but the WebIDL brand checks will fail, so it’s not a valid instance.
Same applies to ESNext classes with private fields.
The improved error message format is based on the one used in Firefox.
Related to https://github.com/jsdom/webidl2js/issues/204 and https://github.com/jsdom/webidl2js/issues/217.