-
Notifications
You must be signed in to change notification settings - Fork 202
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added V8Js::FLAG_CHECK_BINARY_STRING
- Loading branch information
Showing
3 changed files
with
29 additions
and
24 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
fd3246b
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.
The code example on #454 had some of the original checks:
is this not necessary any longer?
fd3246b
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.
also - if the
mbstring
extension is NOT available (it wasn't on my build machine, until I had to test this) will it gracefully fallback to pre-existing behaviour?Should it be checked and fail gracefully, or should it throw an exception IF the new flag is enabled but the
mbstring
extension is missing?fd3246b
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.
I think that the numeric_limits its still necessary.
And if the
mbstring
extension is not available,call_user_function
will returnFAILURE
and then will fallback the default behaviour.But its possible to throw an exception if the new flag is enabled but fail to call
mb_check_encoding
.fd3246b
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.
Ahh I see it's still there, my bad!
It kind of feels safer this way (i.e. throw an Exception early/at startup if
mbstring
is not available but the option is enabled). Else you might find unpredictability between two systems (one with, one without) and not know why. You're in no doubt why it's not working if you're told.