mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Incorrect decompilation with non-ASCII property name in destructuring (621814, r=igor).
This commit is contained in:
parent
97408da376
commit
2b4b0e0cd7
@ -756,7 +756,12 @@ QuoteString(Sprinter *sp, JSString *str, uint32 quote)
|
||||
? Sprint(sp, "%c", (char)c) >= 0
|
||||
: Sprint(sp, "\\%c", e[1]) >= 0;
|
||||
} else {
|
||||
ok = Sprint(sp, (c >> 8) ? "\\u%04X" : "\\x%02X", c) >= 0;
|
||||
/*
|
||||
* Use \x only if the high byte is 0 and we're in a quoted string,
|
||||
* because ECMA-262 allows only \u, not \x, in Unicode identifiers
|
||||
* (see bug 621814).
|
||||
*/
|
||||
ok = Sprint(sp, (qc && !(c >> 8)) ? "\\x%02X" : "\\u%04X", c) >= 0;
|
||||
}
|
||||
if (!ok)
|
||||
return NULL;
|
||||
|
@ -64,3 +64,4 @@ script regress-619003-1.js
|
||||
script regress-619003-2.js
|
||||
script regress-620376-1.js
|
||||
script regress-620376-2.js
|
||||
script regress-621814.js
|
||||
|
13
js/src/tests/js1_8_5/regress/regress-621814.js
Normal file
13
js/src/tests/js1_8_5/regress/regress-621814.js
Normal file
@ -0,0 +1,13 @@
|
||||
/*
|
||||
* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/licenses/publicdomain/
|
||||
*/
|
||||
var expect = 'pass';
|
||||
var actual = expect;
|
||||
function f({"\xF51F": x}) {}
|
||||
try {
|
||||
eval(uneval(f));
|
||||
} catch (e) {
|
||||
actual = '' + e;
|
||||
}
|
||||
reportCompare(expect, actual, "");
|
Loading…
Reference in New Issue
Block a user