Last Comment Bug 762758 - Cannot define nsIDOMKeyEvent.char even if I defined it as "_char"
: Cannot define nsIDOMKeyEvent.char even if I defined it as "_char"
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: XPCOM (show other bugs)
: Trunk
: x86_64 Windows 7
: -- normal (vote)
: mozilla16
Assigned To: Masatoshi Kimura [:emk]
:
: Nathan Froyd [:froydnj]
Mentors:
Depends on:
Blocks: 680830
  Show dependency treegraph
 
Reported: 2012-06-07 19:12 PDT by Masayuki Nakano [:masayuki] (Mozilla Japan)
Modified: 2012-06-12 18:33 PDT (History)
4 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Implement underscore-escape in xpidl parser (1.88 KB, patch)
2012-06-08 13:51 PDT, Masatoshi Kimura [:emk]
khuey: review+
masayuki: feedback+
Details | Diff | Splinter Review

Description Masayuki Nakano [:masayuki] (Mozilla Japan) 2012-06-07 19:12:47 PDT
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...
Comment 1 Masatoshi Kimura [:emk] 2012-06-08 13:51:49 PDT
Created attachment 631519 [details] [diff] [review]
Implement underscore-escape in xpidl parser

Does this patch help?
Comment 2 Masayuki Nakano [:masayuki] (Mozilla Japan) 2012-06-09 01:10:28 PDT
Comment on attachment 631519 [details] [diff] [review]
Implement underscore-escape in xpidl parser

Excellent!
Comment 3 Masayuki Nakano [:masayuki] (Mozilla Japan) 2012-06-12 06:02:49 PDT
https://hg.mozilla.org/integration/mozilla-inbound/rev/88d5451ed337

Thank you, Kimura-san!
Comment 4 Matt Brubeck (:mbrubeck) 2012-06-12 18:33:51 PDT
https://hg.mozilla.org/mozilla-central/rev/88d5451ed337

Note You need to log in before you can comment on or make changes to this bug.