Closed Bug 224254 Opened 21 years ago Closed 21 years ago

make CSS parser use nsresult for |aErrorCode|

Categories

(Core :: CSS Parsing and Computation, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla1.6beta

People

(Reporter: dbaron, Assigned: dbaron)

Details

(Whiteboard: [patch])

Attachments

(1 file)

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
Whiteboard: [patch]
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.
Attachment #134542 - Flags: superreview?(bz-vacation)
Attachment #134542 - Flags: review?(bz-vacation)
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.
Attachment #134542 - Flags: superreview?(bz-vacation)
Attachment #134542 - Flags: superreview+
Attachment #134542 - Flags: review?(bz-vacation)
Attachment #134542 - Flags: review+
Fix checked in to trunk, 2003-11-13 14:48 -0800.
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: