W3C home > Mailing lists > Public > public-script-coord@w3.org > July to September 2016

How to use [EnforceRange] with union types and enums

From: Adam Bergkvist <adam.bergkvist@ericsson.com>
Date: Tue, 13 Sep 2016 11:26:54 +0000
To: "public-script-coord@w3.org" <public-script-coord@w3.org>
Message-ID: <A222C88B6882744D8D4B9681B315889029835126@ESESSMB307.ericsson.se>
Hi

The WebIDL spec is a bit slim on how the [EnforceRange] extended 
attribute can be used.

Consider the below case. The LongRage dictionary enforces range on it's 
max and min members. I want to enforce range on the remaining 'long' in 
the Longish typedef. Is it valid to squeeze in the extended attribute in 
the typedef?

==========
void acceptLongish(Longish num);

typedef (long or LongRange) Longish;

dictionary LongRange {
     [EnforceRange] long max;
     [EnforceRange] long min;
};
==========

BR
/Adam
Received on Tuesday, 13 September 2016 11:27:29 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 13 September 2016 11:27:30 UTC