jscript: Added undefined to number conversion implementation.
This commit is contained in:
parent
53ade93cd9
commit
7b41f77746
|
@ -16,6 +16,9 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "wine/port.h"
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#include "jscript.h"
|
||||
|
@ -325,6 +328,9 @@ static HRESULT str_to_number(BSTR str, VARIANT *ret)
|
|||
HRESULT to_number(script_ctx_t *ctx, VARIANT *v, jsexcept_t *ei, VARIANT *ret)
|
||||
{
|
||||
switch(V_VT(v)) {
|
||||
case VT_EMPTY:
|
||||
num_set_nan(ret);
|
||||
break;
|
||||
case VT_NULL:
|
||||
V_VT(ret) = VT_I4;
|
||||
V_I4(ret) = 0;
|
||||
|
|
|
@ -790,5 +790,6 @@ ok(isNaN(0.5) === false, "isNaN(0.5) !== false");
|
|||
ok(isNaN() === true, "isNaN() !== true");
|
||||
ok(isNaN(NaN, 0) === true, "isNaN(NaN, 0) !== true");
|
||||
ok(isNaN(0.5, NaN) === false, "isNaN(0.5, NaN) !== false");
|
||||
ok(isNaN(+undefined) === true, "isNaN(+undefined) !== true");
|
||||
|
||||
reportSuccess();
|
||||
|
|
Loading…
Reference in New Issue