Closed Bug 828532 Opened 11 years ago Closed 11 years ago

Remove "prototype" as reserved identifier in WebIDL

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla21

People

(Reporter: wchen, Assigned: wchen)

References

()

Details

Attachments

(1 file, 2 obsolete files)

"prototype" is no longer a reserved identifier.
Attachment #699932 - Flags: review?(bzbarsky)
This needs a webidl parser test or three.  In particular, don't we need to still forbid this in the cases where it's not allowed?  Specifically it can't be the name of a constant, static attribute, or static operation.  Do we enforce that anywhere after this change?

We should add tests for those, as well as the fact that dictionary members and non-static attributes and operations named prototype all parse successfully.
I missed those cases when reading the new spec. No, it's currently not handled right now. I'll work on a new patch.
Attachment #699932 - Flags: review?(bzbarsky) → review-
Attachment #699932 - Attachment is obsolete: true
Attachment #700529 - Flags: review?(bzbarsky)
Attachment #700529 - Attachment is obsolete: true
Attachment #700529 - Flags: review?(bzbarsky)
Attachment #700535 - Flags: review?(bzbarsky)
Comment on attachment 700535 [details] [diff] [review]
Removed prototype as a reserved identifier in WebIDL.

>+    parser.reset()

That should be:

  parser = parser.reset();

I tend to print the actual exceptions in your except blocks when writing these tests so I can make sure the exception is being thrown for the right reasons, then remove the prints when finishing up the patch....  We need a better setup for this.  :(

Please add parser tests, not just TestCodeGen.webidl for being able to parse attributes/dictionaries/operations named 'prototype'.

Did you run the TestCodeGen test?  I'm a little surprised it passed as-is, since you didn't actually define C++ stuff for TestNonReservedAttribute and TestNonReservedOperation.  Probably simpler to just take those interfaces out.

r=me with all that.
Attachment #700535 - Flags: review?(bzbarsky) → review+
https://hg.mozilla.org/mozilla-central/rev/e7ee10b0e303
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla21
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: