Re: [heycam/webidl] Does `TreatNullAs` apply to `DOMString` inside a union type? (#441)

As per the [relevant section](https://heycam.github.io/webidl/#TreatNullAs) in the spec:

> The [TreatNullAs] extended attribute must not be associated with a type that is not DOMString.

What you want instead is to use [annotated types](https://heycam.github.io/webidl/#idl-annotated-types) like so:

```webidl
attribute ([TreatNullAs=EmptyString] DOMString or SomeObjectType) thing;
```
which will give you the desired behavior as long as `SomeObjectType` is not a nullable type.

Annotated types were introduced in https://github.com/heycam/webidl/pull/286. Implementation progress can be tracked from https://github.com/heycam/webidl/issues/336.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/heycam/webidl/issues/441#issuecomment-330479969

Received on Tuesday, 19 September 2017 09:16:10 UTC