[whatwg/webidl] > Should promise getters be required to use [NewObject]? (Issue #1247)

        > Should promise getters be required to use [NewObject]? 

Was this meant to say [SameObject]? [NewObject] is only defined for operations and I assumed this was because that behavior is very problematic in practice for attributes. Neither is permitted by a Promise<T> attribute.

Although there is at least one existing quirk where this doesn't hold (valueAsDate), attribute getters that cause SameValue(foo.bar, foo.bar) to always be false (i.e., with no other code in between) tend to break JS expectations, sometimes catastrophically (e.g. the old Angular diffing algorithm).

"Can use [NewObject]" isn't true for any attribute currently, regardless of its type. [SameObject] does work with attributes but specifically forbids Promise<T> types. AFAIK it's for "fully permanent" values, i.e. never changing regardless of application state, not just never changing across consecutive accesses.

_Originally posted by @bathos in https://github.com/whatwg/webidl/issues/71#issuecomment-996224190_
      

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/webidl/issues/1247
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/webidl/issues/1247@github.com>

Received on Saturday, 24 December 2022 01:54:31 UTC