The CSS parser has long had a TODO comment that it should use nsresult for its |aErrorCode| values. The following patch is largely the result of: s/PRInt32& aErrorCode/nsresult& aErrorCode/ s/PRInt32 errorCode/nsresult errorCode/ but also: * removes three checks for -1 error code meaning EOF and replaces them with assertions, since I can't find any place that sets the error code to -1 on EOF * removes the TODO comment
I tested that the "test styles" bookmarklet at http://www.squarefree.com/bookmarklets/webdevel.html still works as I type.
(I should really do that in a debug build, though.)
Status: NEW → ASSIGNED
Priority: -- → P3
Target Milestone: --- → mozilla1.6beta
Are the callers who used to check for -1 likely to throw exceptions on EOF when we don't want them to? (I guess no, since the scanner does not set rv to -1 on EOF....)
No assertions in the same test in a debug build, so I don't think anything is returning -1 in aErrorCode for EOF.
I'll try to get to this sometime this week...
Comment on attachment 134542 [details] [diff] [review] patch r+sr=bzbarsky; I'm sorry this took so long... The EOF thing is indeed not a -1 anymore, since we just use rv from the stream for that error code, and streams return NS_OK and 0 bytes for a read at EOF.
Fix checked in to trunk, 2003-11-13 14:48 -0800.
Status: ASSIGNED → RESOLVED
Last Resolved: 15 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.