Closed
Bug 768190
Opened 13 years ago
Closed 13 years ago
Dictionary members should not allow [TreatNullAs] or [TreatUndefinedAs] annotations
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
mozilla16
People
(Reporter: bzbarsky, Assigned: bzbarsky)
Details
Attachments
(1 file)
|
4.27 KB,
patch
|
justin.lebar+bug
:
review+
|
Details | Diff | Splinter Review |
Spec says so.
Honestly, unless this is really easy to implement in the parser (and it's not clear that it would be), I don't think we should bother.
| Assignee | ||
Comment 2•13 years ago
|
||
Attachment #636473 -
Flags: review?(justin.lebar+bug)
| Assignee | ||
Comment 3•13 years ago
|
||
See above: pretty trivial to implement, imo.
Comment 4•13 years ago
|
||
Comment on attachment 636473 [details] [diff] [review]
Don't allow [TreatNullAs] or [TreatUndefinedAs] on dictionary members.
> class IDLArgument(IDLObjectWithIdentifier):
>- def __init__(self, location, identifier, type, optional=False, defaultValue=None, variadic=False):
>+ def __init__(self, location, identifier, type, optional=False, defaultValue=None, variadic=False, dictionaryMember=False):
> IDLObjectWithIdentifier.__init__(self, location, None, identifier)
>
> assert isinstance(type, IDLType)
> self.type = type
>
> if defaultValue:
> defaultValue = defaultValue.coerceToType(type, location)
> assert defaultValue
>
> self.optional = optional
> self.defaultValue = defaultValue
> self.variadic = variadic
>+ self.dictionaryMember = dictionaryMember
>
> assert not variadic or optional
>
> def addExtendedAttributes(self, attrs):
>+ if self.dictionaryMember:
>+ for (attr, value) in attrs:
>+ if attr == "TreatUndefinedAs":
>+ raise WebIDLError("[TreatUndefinedAs] is not allowed for "
>+ "dictionary members", [self.location])
>+ elif attr == "TreatNullAs":
>+ raise WebIDLError("[TreatNullAs] is not allowed for "
>+ "dictionary members", [self.location])
This could be just |if 'TreatUndefinedAs' in attrs| and so on.
Attachment #636473 -
Flags: review?(justin.lebar+bug) → review+
| Assignee | ||
Comment 5•13 years ago
|
||
> This could be just |if 'TreatUndefinedAs' in attrs| and so on.
Attrs is a list of tuples, so I'm not sure it could.
| Assignee | ||
Comment 6•13 years ago
|
||
Flags: in-testsuite+
Target Milestone: --- → mozilla16
Comment 7•13 years ago
|
||
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•