lib: unify ICU and no-ICU TextDecoder#61409
Conversation
|
Review requested:
|
367908c to
5a2317f
Compare
4d6ff8f to
b2e1ece
Compare
adb2410 to
fb0ca32
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #61409 +/- ##
==========================================
- Coverage 89.87% 89.78% -0.09%
==========================================
Files 671 672 +1
Lines 203178 203876 +698
Branches 39062 39186 +124
==========================================
+ Hits 182599 183051 +452
- Misses 12926 13142 +216
- Partials 7653 7683 +30
🚀 New features to boost your workflow:
|
| let StringDecoder; | ||
| function lazyStringDecoder() { | ||
| if (StringDecoder === undefined) | ||
| ({ StringDecoder } = require('string_decoder')); | ||
| return StringDecoder; | ||
| } |
There was a problem hiding this comment.
There's a lazy utility in the internal utils.
There was a problem hiding this comment.
@avivkeller this is not new code, it's just moved to an outer scope
Ideally all that should go away with follow-up fixes, string_decoder path is invalid anyway
I don't think it's worth refactoring it further
There was a problem hiding this comment.
I still think we should use the new lazy module. Regardless of this being new code or not, git sees it as a new code.
There was a problem hiding this comment.
@anonrig Next two prs will remove this anyway. This is going in iterative steps, the intention of this PR is to make rewrite easier, not to be that rewrite. I don't think it should be blocked on rewriting a code block that wasn't introduced here and is gonna be removed.
fb0ca32 to
1204484
Compare
1204484 to
e74c6fe
Compare
|
Rebased, no actual changes |
|
The withoutintl test failure looks related. |
|
@richardlau indeed, I missed that, thanks! I'll update the test |
701604e to
54e7ba2
Compare
|
Landed in e155415 |
PR-URL: #61409 Reviewed-By: Aviv Keller <me@aviv.sh> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day> Reviewed-By: Richard Lau <richard.lau@ibm.com>
Better reviewed with whitespace ignored
this[kHandle]was not set in no-ICU versionI don't think this is major, and reporting the actual encoding name is better in that case.
This will allow further fixes and common fast path for UTF-16 / fixed impl for UTF-16 as string_decoder doesn't implement UTF-16 per spec.
UTF-16 is still broken in no-ICU version here, this PR does not address that.
Tracking: #61041