| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Update example and signature for readInt32LE method.
|
LGTM |
Sorry, something went wrong.
|
LGTM. Do the other similar methods have the same problem? If so, might as well fix those too. |
Sorry, something went wrong.
|
Ouch, mistake was not in offsets. They are correct. We have const buf = Buffer.from([1, -2, 3, 4]);. buf.readInt8() reads 8 bytes starting from offset. offset can be in range 0 <= offset <= 4 - 1 in our case. buf.readInt8(3) returns the correct result. I'll update PR with correct version now. |
Sorry, something went wrong.
|
You're right. Thank you. |
Sorry, something went wrong.
|
@cjihrig I ran most of the other buf.readXXX() doc examples today and they seemed to be correct. |
Sorry, something went wrong.
Update example of readInt32LE method. buf.readInt32LE(1) is supposed to throw an error as it has only four elements and it tries to read 32 bits from three bytes. Fixes: #5889 PR-URL: #5890 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
|
LGTM and landed in 1213535. I squashed the commits and reworded the commit log a bit. |
Sorry, something went wrong.
Update example of readInt32LE method. buf.readInt32LE(1) is supposed to throw an error as it has only four elements and it tries to read 32 bits from three bytes. Fixes: #5889 PR-URL: #5890 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
|
should this be backported to v4? |
Sorry, something went wrong.
Update example of readInt32LE method. buf.readInt32LE(1) is supposed to throw an error as it has only four elements and it tries to read 32 bits from three bytes. Fixes: #5889 PR-URL: #5890 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
|
@thealphanerd Yes, this should be backported to 4.x |
Sorry, something went wrong.
Update example of readInt32LE method. buf.readInt32LE(1) is supposed to throw an error as it has only four elements and it tries to read 32 bits from three bytes. Fixes: #5889 PR-URL: #5890 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
| Back | FazBrowse Home | New Git URL |
Pull Request check-list
existing APIs, or introduces new ones)?
Affected core subsystem(s)
doc
Description of change
Update example and signature for readInt32LE method. It fixes #5889.