Issue metadata
Sign in to add a comment
|
Mode that always throws on NaN/Infinity |
||||||||||||||||||||||
Issue descriptionThis is a hail Mary sort of Bug. Would it be possible to create a new JS mode (akin to "use strict";) that would automatically throw when a JS variable becomes NaN or Infinity? Would it be possible to do this on DevTools instead? I feel like in most JS development a NaN/Infinity is always an error and is usually caught way too late. It would be amazing if the error was caught the moment the variable is assigned to one of those values.
,
Feb 20 2018
Note that x86* can trap floating-point exceptions that by default are masked. This includes invalid operations (NaN), division by zero (infinity), overflow (infinity), underflow (denormal), and inexact results (precision loss). On Linux you can control these using sigfpe(), on Windows you can use _controlfp() and signal(). Note that these are exceptions at the native code level (actually at the machine level), so correlating them to JavaScript code is the harder part. That said I assume V8 has ways of handling some of these low-level exceptions, so it might not be all that hard to get it working as desired. [*] I think other CPU architectures support this too, because these exceptions are defined by the IEEE-754 floating-point standard.
,
Mar 3 2018
Alexey, can we make embedder to play with sigfpe when debugger is active?
,
Mar 6 2018
|
|||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||
Comment 1 by adamk@chromium.org
, Feb 14 2018