Closed Bug 351988 Opened 18 years ago Closed 18 years ago

e4x adds spurious quotes when decompiling an XMLPI object initializer

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED

People

(Reporter: sayrer, Assigned: sayrer)

Details

(Keywords: verified1.8.1)

Attachments

(1 file)

js> var x = function() { var y = <?foo bar?>; }

function () {
    var y = <?foo "bar"?>;
}
js> var x = function() { var y = <?foo bar?>; }
js> x
function () {
    var y = <?foo "bar"?>;
}
js> dis(x)
flags: LAMBDA
main:
00000:  string "bar"
00003:  xmlpi "foo"
00006:  setvar 0
00009:  pop
00010:  stop

Source notes:
  0:     6 [   6] decl     offset 0

Trivial fix suggests itself: use JSOP_QNAMEPART instead of JSOP_STRING for the first bytecode.  Robert, you gonna take this one?

/be
Assignee: general → sayrer
Status: NEW → ASSIGNED
Attachment #237571 - Flags: review?(brendan)
Comment on attachment 237571 [details] [diff] [review]
use JSOP_QNAMEPART

Cool, thanks.

Trivially safe and good for 1.8.1 if you want to nominate, and to help the decompiler fuzzer avoid a special case.

/be
Attachment #237571 - Flags: review?(brendan) → review+
Checking in jsemit.c;
/cvsroot/mozilla/js/src/jsemit.c,v  <--  jsemit.c
new revision: 3.205; previous revision: 3.204
done
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Attachment #237571 - Flags: approval1.8.1?
Comment on attachment 237571 [details] [diff] [review]
use JSOP_QNAMEPART

a=schrep for JS decompiler bugs
Attachment #237571 - Flags: approval1.8.1? → approval1.8.1+
Checking in jsemit.c;
/cvsroot/mozilla/js/src/jsemit.c,v  <--  jsemit.c
new revision: 3.128.2.41; previous revision: 3.128.2.40
done
Keywords: fixed1.8.1
Checking in regress-351988.js;
/cvsroot/mozilla/js/tests/e4x/Regress/regress-351988.js,v  <--  regress-351988.js
initial revision: 1.1
done

Flags: in-testsuite+
verified fixed 1.8 1.9 2006091022 windows/mac*/linux
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: