構築

構築器 (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

[14] Update the requirement about the definition of a constructor (#697) (Ms2ger著, ) https://github.com/heycam/webidl/commit/c86c55b069ba1146aa345f819cd9833e5bcf51bf

[15] Update the requirement about the definition of a constructor by Ms2ger · Pull Request #697 · heycam/webidl () https://github.com/heycam/webidl/pull/697

[16] Disallow combining Global with Constructor/NamedConstructor. (#745) (Ms2ger著, ) https://github.com/heycam/webidl/commit/a029460787be46f850abfc60f35cc6da05145b89

[17] Disallow combining Global with Constructor/NamedConstructor. by Ms2ger · Pull Request #745 · heycam/webidl () https://github.com/heycam/webidl/pull/745

[18] Should make it clear that [Global] and [Constructor] can't coexist · Issue #744 · heycam/webidl () https://github.com/heycam/webidl/issues/744

[19] Use new syntax for DOMException. (#780) (Ms2ger著, ) https://github.com/heycam/webidl/commit/21ffd9bd979bbebc99d1b7ed28c4f56b7c02b018

[20] Use new syntax for DOMException. by Ms2ger · Pull Request #780 · heycam/webidl () https://github.com/heycam/webidl/pull/780

[21] Revert "Use new syntax for DOMException. (#780)" (bzbarsky著, ) https://github.com/heycam/webidl/commit/182b487c128bce00e62431f19458c15fe91e9738

[22] Revert "Use new syntax for DOMException." by bzbarsky · Pull Request #781 · heycam/webidl () https://github.com/heycam/webidl/pull/781

[23] Stop using extended attributes for constructors (Ms2ger著, ) https://github.com/heycam/webidl/commit/91ca6ebb4d4fca9703309e19256bbc5f5dd77e3c

[24] Stop using extended attributes for constructors by Ms2ger · Pull Request #700 · heycam/webidl () https://github.com/heycam/webidl/pull/700

[25] Stop using extended attributes for constructors · Issue #636 · heycam/webidl () https://github.com/heycam/webidl/issues/636

[26] Allow "constructor" as an argument name (#786) (saschanaz著, ) https://github.com/heycam/webidl/commit/fad813abd912f39f00a898181a6f306e38c5413e

[27] Allow "constructor" as an argument name by saschanaz · Pull Request #786 · heycam/webidl () https://github.com/heycam/webidl/pull/786

[28] Should "constructor" be allowed as an argument name? · Issue #779 · heycam/webidl () https://github.com/heycam/webidl/issues/779

[29] Updating constructor definitions (#1470) (jakearchibald著, ) https://github.com/w3c/ServiceWorker/commit/2500c4c29540ec685891837556e13a51a297d51a

[30] Updating constructor definitions by jakearchibald · Pull Request #1470 · w3c/ServiceWorker () https://github.com/w3c/ServiceWorker/pull/1470

[31] Update to constructor operations · Issue #1464 · w3c/ServiceWorker () https://github.com/w3c/ServiceWorker/issues/1464

[32] Fix "overriden" typo (#806) (TimothyGu著, ) https://github.com/heycam/webidl/commit/3f89daf3dfda699a7a1931b5415dc6ed2ee16d05

[33] Fix "overriden" typo by TimothyGu · Pull Request #806 · heycam/webidl () https://github.com/heycam/webidl/pull/806

[34] Align with IDL constructor changes (autokagami著, ) https://github.com/whatwg/encoding/commit/370ad805f7795be33a4f9fa95cc349da6999476d

[35] Update to constructor operations · Issue #183 · whatwg/encoding () https://github.com/whatwg/encoding/issues/183

[36] [encoding] Align with Web IDL specification by autokagami · Pull Request #186 · whatwg/encoding () https://github.com/whatwg/encoding/pull/186

[37] Align with IDL constructor changes (autokagami著, ) https://github.com/whatwg/fetch/commit/eff7659a2cb15aed801a9dbfc00c58e22efbbd42

[38] Update to constructor operations · Issue #929 · whatwg/fetch () https://github.com/whatwg/fetch/issues/929

[39] [fetch] Align with Web IDL specification by autokagami · Pull Request #940 · whatwg/fetch () https://github.com/whatwg/fetch/pull/940

[40] Editorial: use new constructor syntax from WebIDL (#296) (marcoscaceres著, ) https://github.com/w3c/IndexedDB/commit/f3a43a706a15d21cd0232ef44dafb4c76f7c5a86

[41] Editorial: use new constructor syntax from WebIDL by marcoscaceres · Pull Request #296 · w3c/IndexedDB · GitHub () https://github.com/w3c/IndexedDB/pull/296

[42] Update to constructor operations · Issue #293 · w3c/IndexedDB · GitHub () https://github.com/w3c/IndexedDB/issues/293

[43] Use new constructor() syntax (#236) (ChunMinChang著, ) https://github.com/w3c/mediasession/commit/998ff76217cb95c1f4dfb95c5e811f176a09ccac

[44] Use new constructor() syntax by ChunMinChang · Pull Request #236 · w3c/mediasession () https://github.com/w3c/mediasession/pull/236

[45] Update to constructor operations · Issue #235 · w3c/mediasession () https://github.com/w3c/mediasession/issues/235

[46] Define "overridden constructor steps" (domenic著, ) https://github.com/heycam/webidl/commit/9c597595875df28f39e0dce520bb96f05c6f6a37

[47] Define "usual constructor steps" by domenic · Pull Request #797 · heycam/webidl () https://github.com/heycam/webidl/pull/797

[48] [CSP3] Align with Web IDL specification (#410) (autokagami著, ) https://github.com/w3c/webappsec-csp/commit/4ef6262f53c1c60aff086c6db87d2071fc281b7c

[49] [CSP3] Align with Web IDL specification by autokagami · Pull Request #410 · w3c/webappsec-csp () https://github.com/w3c/webappsec-csp/pull/410

[50] [credential-management-1] Align with Web IDL specification (#142) (autokagami著, ) https://github.com/w3c/webappsec-credential-management/commit/315cc3dc2a5bb8f994fcb8e6644a76d224d2be7d

[51] [credential-management-1] Align with Web IDL specification by autokagami · Pull Request #142 · w3c/webappsec-credential-management () https://github.com/w3c/webappsec-credential-management/pull/142

[52] Align with IDL constructor changes (autokagami著, ) https://github.com/whatwg/dom/commit/57512fac17cf2f1c4c85be4aec178c8086ee5ee4

[53] Update to constructor operations · Issue #780 · whatwg/dom () https://github.com/whatwg/dom/issues/780

[54] Use Web IDL constructor operations by foolip · Pull Request #782 · whatwg/dom () https://github.com/whatwg/dom/pull/782

[55] Align with IDL constructor changes (autokagami著, ) https://github.com/whatwg/notifications/commit/976813ca068627405c972318441622ad94ff7557

[56] [notifications] Align with Web IDL specification by autokagami · Pull Request #151 · whatwg/notifications () https://github.com/whatwg/notifications/pull/151

[57] Align with IDL constructor changes (autokagami著, ) https://github.com/whatwg/xhr/commit/22424f0eed9696a935fb441e8cede66517fc5490

[58] [xhr] Align with Web IDL specification by autokagami · Pull Request #261 · whatwg/xhr () https://github.com/whatwg/xhr/pull/261

[59] Update to constructor operations · Issue #254 · whatwg/xhr () https://github.com/whatwg/xhr/issues/254

[60] Align with IDL constructor changes (autokagami著, ) https://github.com/whatwg/url/commit/5f8576eeb2004e973db681de3239ae39bcec4cb8

[61] Align with IDL constructor changes (autokagami著, ) https://github.com/whatwg/url/commit/5f8576eeb2004e973db681de3239ae39bcec4cb8

[62] [url] Align with Web IDL specification by autokagami · Pull Request #450 · whatwg/url () https://github.com/whatwg/url/pull/450

[63] Update to constructor operations · Issue #447 · whatwg/url () https://github.com/whatwg/url/issues/447

[64] Remove use of [Constructor] extended attribute (clelland著, ) https://github.com/heycam/webidl/commit/9e514c9dcfb09919af971931409aa075451804a5

[65] Remove use of [Constructor] extended attribute by clelland · Pull Request #798 · heycam/webidl () https://github.com/heycam/webidl/pull/798

[66] Update to constructor operations · Issue #4870 · whatwg/html () https://github.com/whatwg/html/issues/4870