Uh oh!
There was an error while loading. Please reload this page.
src: fix erroneous fallthrough in ParseEncoding() - #7262
Conversation
There was a problem hiding this comment.
tiny nit: the trailing \ here is superfluous/inconsistent with the way line continuations are ended in the rest of the Makefile
There was a problem hiding this comment.
I tend to write it like that because it keeps the diff small when you add lines later on. But you're right, the rest of the Makefile doesn't use that style.
addaleax
commented
Jun 10, 2016
LGTM |
thefourtheye
commented
Jun 10, 2016
Shouldn't the } elseif (StringEqualNoCase(encoding, "latin1")) {
returnLATIN1;
} elseif (StringEqualNoCase(encoding, "binary")) {
returnBINARY; // HERE
} elseif (StringEqualNoCase(encoding, "buffer")) {
returnBUFFER;I think it should be } elseif (StringEqualNoCase(encoding, "latin1")) {
returnLATIN1;
} elseif (StringEqualNoCase(encoding, "binary")) {
returnLATIN1; // HERE
} elseif (StringEqualNoCase(encoding, "buffer")) {
returnBUFFER; |
jasnell
commented
Jun 10, 2016
LGTM |
bnoordhuis
commented
Jun 10, 2016
I think @thefourtheye is on to something. It wouldn't matter except that BINARY and LATIN1 are different values. @trevnorris Can you comment on whether this patch makes sense? diff --git a/src/node.h b/src/node.h
index d813b45..427f45d 100644
--- a/src/node.h+++ b/src/node.h@@ -278,7 +278,7 @@ inline void NODE_SET_PROTOTYPE_METHOD(v8::Local<v8::FunctionTemplate> recv,
}
#define NODE_SET_PROTOTYPE_METHOD node::NODE_SET_PROTOTYPE_METHOD
-enum encoding {ASCII, UTF8, BASE64, UCS2, LATIN1, BINARY, HEX, BUFFER};+enum encoding {ASCII, UTF8, BASE64, UCS2, LATIN1, HEX, BUFFER, BINARY = LATIN1};
NODE_EXTERN enum encoding ParseEncoding(
v8::Isolate* isolate,
v8::Local<v8::Value> encoding_v, |
trevnorris
commented
Jun 11, 2016
@bnoordhuis I think that makes better sense. The two are functionally equivalent. Rest of the changes LGTM. (thanks for adding the native API tests) |
The prerequisite for rebuilding was on the binding.gyp file but the actual sources. PR-URL: nodejs#7262 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
A missing 'break' statement unintentionally allowed "linary" and "luffer" as alternatives for "binary" and "buffer". Regression introduced in commit 54cc721 ("buffer: introduce latin1 encoding term".) PR-URL: nodejs#7262 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
bnoordhuis
commented
Jun 13, 2016
Landed in d06820c...6b48324, thanks. I'm going to follow up with a separate PR for the BINARY/LATIN1 thing. |
evanlucas
commented
Jun 15, 2016
This depends on #7111 which is semver minor, so will hold out on this until the next v6.x minor release |
The prerequisite for rebuilding was on the binding.gyp file but the actual sources. PR-URL: #7262 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Make BINARY an alias for LATIN1 rather than a distinct enum value. PR-URL: nodejs#7284 Refs: nodejs#7262 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
MylesBorins
commented
Jul 11, 2016
added don't land label for v4.x @evanlucas did you want to leave the v6.x label on there ? |
evanlucas
commented
Jul 12, 2016
It actually depends on a semver-major change, so I believe that leaving the |
A missing 'break' statement unintentionally allowed "linary" and "luffer" as alternatives for "binary" and "buffer". Regression introduced in commit 54cc721 ("buffer: introduce latin1 encoding term".) PR-URL: nodejs#7262 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Make BINARY an alias for LATIN1 rather than a distinct enum value. PR-URL: nodejs#7284 Refs: nodejs#7262 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
A missing 'break' statement unintentionally allowed "linary"
and "luffer" as alternatives for "binary" and "buffer".
Regression introduced in commit 54cc721 ("buffer: introduce latin1
encoding term".)
R=@trevnorris
CI: https://ci.nodejs.org/job/node-test-pull-request/2972/