W3C home > Mailing lists > Public > public-script-coord@w3.org > July to September 2014

RE: [webidl] Defining constructors on non-global objects?

From: Domenic Denicola <domenic@domenicdenicola.com>
Date: Fri, 5 Sep 2014 17:56:07 +0000
To: Rick Waldron <waldron.rick@gmail.com>
CC: Boris Zbarsky <bzbarsky@mit.edu>, "public-script-coord@w3.org" <public-script-coord@w3.org>
Message-ID: <f1e7b2d63da84dc484311c321ef01d87@BN1PR05MB325.namprd05.prod.outlook.com>
From: Rick Waldron [mailto:waldron.rick@gmail.com] 

> Currently: nothing.

Upon reviewing https://github.com/rwaldron/sensors, this doesn't seem as bad as I feared. It turns out it's being used as an abstract base class, not as a non-constructible class. (That is, unlike many non-constructible classes in the platform, instances of Sensor do not exist; only instances of it subclasses.) Abstract base classes are pretty rare in JS (in my experience, at least) but are a fine pattern.

That said, I filed https://github.com/rwaldron/sensors/issues/1 to track whether the abstract base class should be the same as the namespace object. I don't quite understand why they should be the same.
Received on Friday, 5 September 2014 17:56:38 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:22 UTC