Skip to content
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

Tighten value conversions in boundary cases #217

Open
emaxx-google opened this issue Oct 28, 2020 · 0 comments
Open

Tighten value conversions in boundary cases #217

emaxx-google opened this issue Oct 28, 2020 · 0 comments
Assignees

Comments

@emaxx-google
Copy link
Collaborator

emaxx-google commented Oct 28, 2020

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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant