構築子

構築器 (JavaScript)

分類

[6]

名前の衝突

[2] MathMLDOM には constructor DOM属性があります。

関数としての呼び出し

[4] WinIEFirefox は関数として呼び出しても同じように動作しますが、 Chrome は例外 (TypeError) を投げます。

[5] WebIDL 仕様上は特に言及がなく、 Firefox の動作が正しそうです。

歴史

[1] ECMAScript Language Specification (HTML version) ( 版) <http://bclary.com/2004/11/07/#a-4.3.4>

A constructor is a Function object that creates and initialises objects. Each constructor has an associated prototype object that is used to implement inheritance and shared properties.

[7] Remove support for [Constructor] on dictionaries (fixes #109). ( (Ms2ger著, )) <https://github.com/heycam/webidl/commit/1982dc3f17002c07f93b39e22f69846478e4a9e2>

[8] Proposal: allow subclasses of constructible built-ins to be constructed · Issue #125 · heycam/webidl ( ()) <https://github.com/heycam/webidl/issues/125>

[9] Throw when not calling interfaces as constructors (#205) (tobie著, ) <https://github.com/heycam/webidl/commit/001ba520eb80c23133e65bc721f1f9910732316c>

[10] Revamp interface bindings (#313) (tobie著, ) <https://github.com/heycam/webidl/commit/4a8f57e276369db7ea5fb09974a09b0ca5d276dd>

[11] Use Web IDL to construct custom element constructors (domenic著, ) <https://github.com/whatwg/dom/commit/1ca094a209ba020348ac146c8bda157b7c5f3212>

[12] Link function objects and constructors to relevant DFNs in ES (#418) (tobie著, ) <https://github.com/heycam/webidl/commit/080bceaf43d9bee642aa797a21b3bd203b74c684>

[13] Link function objects and constructors to relevant DFNs in ES by tobie · Pull Request #418 · heycam/webidl () <https://github.com/heycam/webidl/pull/418>