This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 29383 - Need a way to define toJSON, valueOf, @@toPrimitive
Summary: Need a way to define toJSON, valueOf, @@toPrimitive
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: WebIDL (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Cameron McCormack
QA Contact: public-webapps-bugzilla
Depends on: 27361 29183
Blocks: 29384
  Show dependency treegraph
Reported: 2016-01-20 13:22 UTC by Anne
Modified: 2016-01-29 01:56 UTC (History)
4 users (show)

See Also:


Description Anne 2016-01-20 13:22:07 UTC
We want to get rid of [Unforgeable] for Location (the only interface to use that annotation as far as I know), but we do not want to lose out on basically nullifying these properties.

As we change this setup, we should also consider making them no longer enumerable as per bug 27361.

This subsumes bug 29183 in a way.

Perhaps a good general solution would be to allow specifications to define data properties. This has been requested now and then, perhaps now is the time. has some additional context as does bug 29376 comment 7.
Comment 1 Anne 2016-01-22 14:41:16 UTC
See also by the way. There might be more properties here that warrant some kind of override.
Comment 2 Anne 2016-01-29 00:33:46 UTC
The way I plan to do this for now is by simply defining these properties in prose when the Location object is allocated.
Comment 3 Anne 2016-01-29 01:56:56 UTC
Resolving this as worksforme. If we want to add data properties in IDL that will need its own justification.