Commit d2b9e7c
string_decoder: throw ERR_STRING_TOO_LONG for UTF-8
String::NewFromUtf8 doesn't generate an exception in V8 when the string
is too long but is guaranteed to return an empty MaybeLocal only in
that case. Generate a Node.js exception when it happens.
Fixes: #35676
PR-URL: #36661
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>1 parent d5e1b82 commit d2b9e7cCopy full SHA for d2b9e7c
File tree
Expand file treeCollapse file tree
2 files changed
+15
-1
lines changedOpen diff view settings
Filter options
- src
- test/parallel
Expand file treeCollapse file tree
2 files changed
+15
-1
lines changedOpen diff view settings
Collapse file
+8-1Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
3 | 3 | |
4 | 4 | |
5 | 5 | |
| 6 | + |
6 | 7 | |
7 | 8 | |
8 | 9 | |
| ||
30 | 31 | |
31 | 32 | |
32 | 33 | |
33 | | - |
| 34 | + |
34 | 35 | |
35 | 36 | |
36 | 37 | |
37 | 38 | |
| 39 | + |
| 40 | + |
| 41 | + |
| 42 | + |
| 43 | + |
| 44 | + |
38 | 45 | |
39 | 46 | |
40 | 47 | |
|
Collapse file
test/parallel/test-string-decoder.js
Copy file name to clipboardExpand all lines: test/parallel/test-string-decoder.js+7Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
201 | 201 | |
202 | 202 | |
203 | 203 | |
| 204 | + |
| 205 | + |
| 206 | + |
| 207 | + |
| 208 | + |
| 209 | + |
| 210 | + |
204 | 211 | |
205 | 212 | |
206 | 213 | |
|
0 commit comments