chromeos_smart_card_connector
chromeos_smart_card_connector copied to clipboard
Tighten value conversions in boundary cases
We implement several types of value conversions in the //common/cpp library:
- Conversions between
Valueobjects and regular C++ types; - Conversions between
Valueobjects and Native Clientpp::Varobjects (only in NaCl builds); - Conversions between
Valueobjects and Emscriptenemscripten::valobjects.
The task is to make sure that all of these conversions have a well-defined behavior (ideally - error out) in the corner cases, like:
- Converting a huge integer to a floating-point number type (C++
doubleor JavaScriptNumber) with a loss of precision, and vice versa; - Converting a fractional floating-point number into an integer type;
- Converting a NaN or an Infinity floating-point number;
- Converting an invalid sequence of characters into a UTF string type (JavaScript
String).