Closed Bug 352097 Opened 19 years ago Closed 19 years ago

E4X XMLPI that does not contain embedded spaces decompiles with extra space

Categories

(Core :: JavaScript Engine, defect)

PowerPC
macOS
defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla1.8.1

People

(Reporter: jruderman, Assigned: Waldo)

References

Details

(Keywords: testcase, verified1.8.1)

Attachments

(2 files, 1 obsolete file)

js> function() { var y = <?foo?> } function () { var y = <?foo ?>; } js> function() { var y = <?foo ?> } function () { var y = <?foo ?>; }
Assignee: general → jwalden+bmo
Attached patch Patch (obsolete) — Splinter Review
Removing the added space and eliminating trailing spaces for PIs without data requires two changes: first, only print the space when the PI's data has non-zero length (the jsopcode.c change), and second, trim the tokenbuf containing the target so that we don't associate ("f ", "") with the PI denoted by <?f ?>, making sure to do so *after* js_AtomizeChars (the jsscan.c change). I also folded bug 352103's fix (|if (targetLength==0) goto bad_xml_markup;|) since it was so small.
Attachment #237812 - Flags: review?(brendan)
Attached file Testcase
Blocks: 352103
Comment on attachment 237812 [details] [diff] [review] Patch Local style prefers *rval = = '\0' to !*rval. r=me with that, and nominate the updated patch for 1.8.1. Thanks, /be
Attachment #237812 - Flags: review?(brendan) → review+
Attached patch Fixes nitSplinter Review
Checked in on trunk. Small, tightly-contained patch to make XML PI decompilation saner and to reject a certain type of invalid XML PI in E4X processing...
Attachment #237812 - Attachment is obsolete: true
Attachment #237829 - Flags: review+
Attachment #237829 - Flags: approval1.8.1?
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Comment on attachment 237829 [details] [diff] [review] Fixes nit a=schrep
Attachment #237829 - Flags: approval1.8.1? → approval1.8.1+
Fixed on branch.
Keywords: fixed1.8.1
Target Milestone: --- → mozilla1.8.1
(In reply to comment #3) > Created an attachment (id=237816) [edit] > Testcase > Checking in regress-352097.js; /cvsroot/mozilla/js/tests/e4x/Regress/regress-352097.js,v <-- regress-352097.js initial revision: 1.1 done thanks!
Flags: in-testsuite+
verified fixed 1.8 20060914 windows/linux 1.9 20060914 windows/mac*/linux
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: