chromeos_smart_card_connector icon indicating copy to clipboard operation
chromeos_smart_card_connector copied to clipboard

Tighten value conversions in boundary cases

Open emaxx-google opened this issue 5 years ago • 0 comments

We implement several types of value conversions in the //common/cpp library:

  • Conversions between Value objects and regular C++ types;
  • Conversions between Value objects and Native Client pp::Var objects (only in NaCl builds);
  • Conversions between Value objects and Emscripten emscripten::val objects.

The task is to make sure that all of these conversions have a well-defined behavior (ideally - error out) in the corner cases, like:

  1. Converting a huge integer to a floating-point number type (C++ double or JavaScript Number) with a loss of precision, and vice versa;
  2. Converting a fractional floating-point number into an integer type;
  3. Converting a NaN or an Infinity floating-point number;
  4. Converting an invalid sequence of characters into a UTF string type (JavaScript String).

emaxx-google avatar Oct 28 '20 22:10 emaxx-google