Skip to content

TAG issue: Subclassing / Node composition #251

Closed
@chrislo

Description

@chrislo

The following issue was raised by the W3C TAG as part of their review of the Web Audio API

ISSUE: Subclassing

Related to a lack of constructors, but worth calling out independently, it's not currently possible to meaningfully compose node types, either through mixins or through subclassing. In JS, this sort of "is a" relationship is usually set up through the subclassing pattern:

var SubNodeType = function() {
  SuperNodeType.call(this);
};
SubNodeType.prototype = Object.create(SuperNodeType.prototype);
SubNodeType.prototype.constructor = SubNodeType;
// ...

There doesn't seem to be any way in the current design to enable this sort of composition. This is deeply unfortunate.

Metadata

Metadata

Assignees

Labels

Needs EditsDecision has been made, the issue can be fixed. https://speced.github.io/spec-maintenance/about/tag-trackerGroup bringing to attention of the TAG, or tracked by the TAG but not needing response.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions