Closed Bug 298286 Opened 20 years ago Closed 19 years ago

Clean up js_ReportCompileErrorNumber to deal with jschar *

Categories

(Core :: JavaScript Engine, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.8beta4

People

(Reporter: mrbkap, Assigned: mrbkap)

Details

Attachments

(1 file, 1 obsolete file)

Currently, js_ReportCompileErrorNumber() unconditionally calls
js_ExpandErrorArguments with its charArgs parameter set to PR_TRUE, which causes
problems for jsregexp.c which consistently calls it with jschar* arguments. This
breaks because interpreting the jschar* as a char* results in one-character-only
strings.

I'm volunteering to fix this in a sane way.
Status: NEW → ASSIGNED
Attached patch patch v1 (obsolete) — Splinter Review
This adds an argument to js_ReportCompileErrorNumber, which bloats the patch
somewhat. The alternative patch (which would probably be a bit cleaner) would
be to add a function js_ReportCompileErrorNumberUC [akin to
JS_ReportErrorNumber(UC)] and split the common code into another function. I
think I actually like the alternate better. Brendan, what do you think?
Attachment #187682 - Flags: review?(brendan)
Comment on attachment 187682 [details] [diff] [review]
patch v1

Yeah, let's do the UC thing (per office discussion).  Law of least effort has
not been repealed. ;-)

/be
Attachment #187682 - Flags: review?(brendan)
Attached patch patch v2Splinter Review
Using report as a pointer inflated this patch some, but I think this is as
close as I can get to combining the two functions.
Attachment #187682 - Attachment is obsolete: true
Attachment #187847 - Flags: review?(brendan)
Comment on attachment 187847 [details] [diff] [review]
patch v2

Looks good to me -- if it all tests well, go for 1.8b4 approval -- I'll help
approve.  Thanks,

/be
Attachment #187847 - Flags: review?(brendan) → review+
Attachment #187847 - Flags: approval1.8b4?
Comment on attachment 187847 [details] [diff] [review]
patch v2

This is safe for 1.8b4.

/be
Attachment #187847 - Flags: approval1.8b4? → approval1.8b4+
Checked in.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.8beta4
Flags: testcase?
testcase-, suggestions welcome.
Flags: testcase? → testcase-
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: