- From: Domenic Denicola <d@domenic.me>
- Date: Tue, 9 Feb 2016 00:10:12 +0000
- To: "whatwg@whatwg.org" <whatwg@whatwg.org>
- Cc: "terin@terinstock.com" <terin@terinstock.com>, Travis Leithead <travis.leithead@microsoft.com>, Robert Kowalski <rok@kowalski.gd>
From: Domenic Denicola > So I think the plan of record is: `attribute any console`, with prose describing > how the getter returns "the window's console object" which is initially set to > a new instance of Console, but the setter can change it to any value. This > means accessor descriptors and enumerable, since that's how IDL works. If > anyone thinks this is bad, let us know. Otherwise the standard will be > updated any day now in that direction. In IRC, Smaug makes me aware of the [Replaceable] IDL attribute, which appears to be what Gecko does. Given `[Replaceable] readonly attribute Console console`, IDL auto-generates a setter that does (essentially) `this.defineOwnProperty("console", { value, writable: true, enumerable: true, configurable: true })`. For most objects this will shadow the prototype's getter, but for global objects like Window it will just overwrite it. So, new plan of record: `[Replaceable] readonly attribute Console console`.
Received on Tuesday, 9 February 2016 00:10:44 UTC