Re: [heycam/webidl] Async constructors? (`new Foo()` returning Promise<Foo>) (#563)

I don't think this is a good idea. Even though JavaScript is flexible enough to do otherwise, a constructor should return an instance of the class being constructed. ie, `new Foo() instanceof Foo` should always be true. Static factory methods are a fine way to asynchronously create instances.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/heycam/webidl/issues/563#issuecomment-411897681

Received on Thursday, 9 August 2018 21:08:46 UTC