@@ -317,25 +317,28 @@ static String valueToQuotedStringN(const char* value, unsigned length,
317
317
// Should add a flag to allow this compatibility mode and prevent this
318
318
// sequence from occurring.
319
319
default : {
320
- unsigned codepoint;
321
320
if (emitUTF8) {
322
- codepoint = static_cast <unsigned char >(*c);
323
- } else {
324
- codepoint = utf8ToCodepoint (c, end); // modifies `c`
325
- }
326
-
327
- if (codepoint < 0x20 ) {
328
- appendHex (result, codepoint);
329
- } else if (codepoint < 0x80 || emitUTF8) {
330
- appendRaw (result, codepoint);
331
- } else if (codepoint < 0x10000 ) {
332
- // Basic Multilingual Plane
333
- appendHex (result, codepoint);
321
+ unsigned codepoint = static_cast <unsigned char >(*c);
322
+ if (codepoint < 0x20 ) {
323
+ appendHex (result, codepoint);
324
+ } else {
325
+ appendRaw (result, codepoint);
326
+ }
334
327
} else {
335
- // Extended Unicode. Encode 20 bits as a surrogate pair.
336
- codepoint -= 0x10000 ;
337
- appendHex (result, 0xd800 + ((codepoint >> 10 ) & 0x3ff ));
338
- appendHex (result, 0xdc00 + (codepoint & 0x3ff ));
328
+ unsigned codepoint = utf8ToCodepoint (c, end); // modifies `c`
329
+ if (codepoint < 0x20 ) {
330
+ appendHex (result, codepoint);
331
+ } else if (codepoint < 0x80 ) {
332
+ appendRaw (result, codepoint);
333
+ } else if (codepoint < 0x10000 ) {
334
+ // Basic Multilingual Plane
335
+ appendHex (result, codepoint);
336
+ } else {
337
+ // Extended Unicode. Encode 20 bits as a surrogate pair.
338
+ codepoint -= 0x10000 ;
339
+ appendHex (result, 0xd800 + ((codepoint >> 10 ) & 0x3ff ));
340
+ appendHex (result, 0xdc00 + (codepoint & 0x3ff ));
341
+ }
339
342
}
340
343
} break ;
341
344
}
@@ -866,8 +869,7 @@ struct CommentStyle {
866
869
// / Decide whether to write comments.
867
870
enum Enum {
868
871
None, // /< Drop all comments.
869
- Most, // /< Recover odd behavior of previous versions (not implemented
870
- // /< yet).
872
+ Most, // /< Recover odd behavior of previous versions (not implemented yet).
871
873
All // /< Keep all comments.
872
874
};
873
875
};
0 commit comments