Closed
Conversation
Avoid use of arguments in Buffer.prototype.toString()
cjihrig
approved these changes
Feb 13, 2017
lpinca
approved these changes
Feb 14, 2017
joyeecheung
approved these changes
Feb 14, 2017
Member
Author
addaleax
approved these changes
Feb 15, 2017
lib/buffer.js
Outdated
| result = this.utf8Slice(0, this.length); | ||
| } else { | ||
| result = slowToString.apply(this, arguments); | ||
| result = slowToString.call(this, encoding, start, end); |
Member
There was a problem hiding this comment.
This is the only call site for slowToString, maybe we can drop the .call entirely?
Member
Author
There was a problem hiding this comment.
Will require a bit of editing inside slowToString which assumes it is bound to this, but that's certainly doable.
Since slowToString only has one callsite, refactor to eliminate the use of call.
Member
Author
|
@addaleax ... added a second commit that refactors |
Member
Author
jasnell
added a commit
that referenced
this pull request
Feb 15, 2017
Avoid use of arguments in Buffer.prototype.toString() PR-URL: #11358 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
jasnell
added a commit
that referenced
this pull request
Feb 15, 2017
Since slowToString only has one callsite, refactor to eliminate the use of call. PR-URL: #11358 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Member
Author
|
Landed in 1e21d05...4b8b7e9 |
2 tasks
italoacasas
pushed a commit
to italoacasas/node
that referenced
this pull request
Feb 16, 2017
Avoid use of arguments in Buffer.prototype.toString() PR-URL: nodejs#11358 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
italoacasas
pushed a commit
to italoacasas/node
that referenced
this pull request
Feb 16, 2017
Since slowToString only has one callsite, refactor to eliminate the use of call. PR-URL: nodejs#11358 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
italoacasas
pushed a commit
that referenced
this pull request
Feb 22, 2017
Avoid use of arguments in Buffer.prototype.toString() PR-URL: #11358 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
italoacasas
pushed a commit
that referenced
this pull request
Feb 22, 2017
Since slowToString only has one callsite, refactor to eliminate the use of call. PR-URL: #11358 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Avoid use of arguments in Buffer.prototype.toString()
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
buffer