Cannot define nsIDOMKeyEvent.char even if I defined it as "_char"

RESOLVED FIXED in mozilla16

Status

()

Core
XPCOM
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: masayuki, Assigned: emk)

Tracking

Trunk
mozilla16
x86_64
Windows 7
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

Separated from bug 680830.

(In reply to Olli Pettay [:smaug] from comment #9)
> (In reply to Masayuki Nakano (:masayuki) (Mozilla Japan) from comment #7)
> > Ugh... I got this error:
> > 
> > error: name 'char' is a builtin and cannot be redeclared,
> > m:/mc-q/src/dom/interfaces/events/nsIDOMKeyEvent.idl line 245:11
> >   readonly attribute DOMString char;
> > 
> > How do I define char property?
> 
> Uh, that is painful. Do we need something new in xpidl.py, something similar
> to 'binaryname'?
> Kyle might know.

(In reply to Olli Pettay [:smaug] from comment #10)
> Or do we support the _  (underscore-prefix) hack webidl has.

(In reply to Kyle Huey [:khuey] (khuey@mozilla.com) from comment #11)
> _ works, iirc.

(In reply to Masayuki Nakano (:masayuki) (Mozilla Japan) from comment #12)
> Hmm, _char still failed...
> 
> 
> > nsIDOMKeyEvent.idl
> > error: unrecognized input, m:/mc-q/src/dom/interfaces/events/nsIDOMKeyEvent.idl line 245:31
> >   readonly attribute DOMString _char;
> >                                ^
> > Traceback (most recent call last):
> >   File "m:\mc-q\src\build\pymake\pymake\process.py", line 213, in run
> >     m.__dict__[self.method](self.argv)
> >   File "m:/mc-q/src/config\pythonpath.py", line 44, in main
> >     execfile(script, frozenglobals)
> >   File "m:/mc-q/firefox-debug-build/dist/sdk/bin/header.py", line 529, in <module>
> >     idl = p.parse(open(file).read(), filename=file)
> >   File "m:\mc-q\firefox-debug-build\dist\sdk\bin\xpidl.py", line 1596, in parse
> >     idl = self.parser.parse(lexer=self)
> >   File "m:\mc-q\firefox-debug-build\dist\sdk\bin\ply\yacc.py", line 265, in parse
> >     return self.parseopt_notrack(input,lexer,debug,tracking,tokenfunc)
> >   File "m:\mc-q\firefox-debug-build\dist\sdk\bin\ply\yacc.py", line 921, in parseopt_notrack
> >     lookahead = get_token()     # Get the next token
> >   File "m:\mc-q\firefox-debug-build\dist\sdk\bin\xpidl.py", line 1585, in token
> >     t = self.lexer.token()
> >   File "m:\mc-q\firefox-debug-build\dist\sdk\bin\ply\lex.py", line 384, in token
> >     newtok = self.lexerrorf(tok)
> >   File "m:\mc-q\firefox-debug-build\dist\sdk\bin\xpidl.py", line 1195, in t_ANY_error
> >     lexpos=self.lexer.lexpos))
> > IDLError: error: unrecognized input, m:/mc-q/src/dom/interfaces/events/nsIDOMKeyEvent.idl line 245:31
> >   readonly attribute DOMString _char;

This blocks bug 680830.

Kyle, would you fix this, or if you don't have much time, would you tell me how to fix this? I tried to read the parser, but I've never developed with python. So, it's too tough for me...
(Assignee)

Comment 1

5 years ago
Created attachment 631519 [details] [diff] [review]
Implement underscore-escape in xpidl parser

Does this patch help?
Attachment #631519 - Flags: feedback?(masayuki)
Comment on attachment 631519 [details] [diff] [review]
Implement underscore-escape in xpidl parser

Excellent!
Attachment #631519 - Flags: feedback?(masayuki) → feedback+
(Assignee)

Updated

5 years ago
Attachment #631519 - Flags: review?(khuey)
Attachment #631519 - Flags: review?(khuey) → review+
(Assignee)

Updated

5 years ago
Keywords: checkin-needed
https://hg.mozilla.org/integration/mozilla-inbound/rev/88d5451ed337

Thank you, Kimura-san!
Assignee: khuey → VYV03354
Status: NEW → ASSIGNED
Keywords: checkin-needed
Target Milestone: --- → mozilla16
https://hg.mozilla.org/mozilla-central/rev/88d5451ed337
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.