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
miqUncompressedId - fix [sprintf] expecting number but found string #10637
Conversation
@chrisarcand hope this fixes the problem... Should it not, could you please do.. (in the browser console) var bak = window.sprintf;
window.sprintf = function() { console.log(arguments); return bak.apply(window, arguments); }; and post the last one before it blows up? |
Great, thanks! :) Rebased.. |
@chrisarcand that's not really related to the other issue, so I'd prefer to fix that in a separate PR.. But yup, noted :) |
ok! LGTM from me, then 👍 |
<pr_mergeability_checker />This pull request is not mergeable. Please rebase and repush. |
sprintf doesn't typecast, and splitting a string yields two strings alternatively we could convert it to a number but might get weird off-by-ones on 32 bit systems that way..
Checked commits https://github.com/himdel/manageiq/compare/d70ef268da93c0c3bf8cb00125d725b0f99d56dc~...37297cf38c84110bfc65e2ee15bb0b6ca2421975 with ruby 2.2.5, rubocop 0.37.2, and haml-lint 0.16.1 |
Based on @chrisarcand's review, merging this. |
@chrisarcand reported seeing a
[sprintf] expecting number but found string
error..sprintf doesn't typecast, and splitting a string yields two strings.. fixing to expect a string.
(alternatively we could convert it to a number but might get weird off-by-ones on 32 bit systems that way..)
Actually, the typecasting bit is a bit more complicated, it can treat a string as a number, as long as the native
isNaN
returns false for it..