-
Notifications
You must be signed in to change notification settings - Fork 30
support for long.js #85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
writeLong(Long.fromValue(7))
|
@lishengguo, thanks for your PR! By analyzing the history of the files in this pull request, we identified @fengmk2, @gxcsoccer and @xusiyuan841028 to be potential reviewers. |
Codecov Report
@@ Coverage Diff @@
## master #85 +/- ##
======================================
Coverage 96.1% 96.1%
======================================
Files 7 7
Lines 1079 1079
Branches 204 204
======================================
Hits 1037 1037
Misses 42 42
Continue to review full report at Codecov.
|
|
any test cases? |
|
add test case : Long.fromNumber(0) |
| */ | ||
| proto.writeLong = function (val) { | ||
| if (typeof val !== 'number' && utility.isSafeNumberString(val)) { | ||
| if (typeof val !== 'number' && utility.isSafeNumberString(val + '')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
detect val is not equal string first.
if (typeof val !== 'number') {
if (typeof val !== 'string') {
val = val + '';
}
if (utility.isSafeNumberString(val)) {
val = Number(val);
}
}|
Please rebase from master branch. |
writeLong(Long.fromValue(7))