From dd8bb3de4f353a81954234999f1fea748aee2ea9 Mon Sep 17 00:00:00 2001 From: Ben Murdoch Date: Wed, 11 Aug 2010 14:44:44 +0100 Subject: Merge WebKit at r65072 : Initial merge by git. Change-Id: Ibcf418498376b2660aacb7f8d46ea7085ef91585 --- JavaScriptCore/API/JSValueRef.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'JavaScriptCore/API/JSValueRef.cpp') diff --git a/JavaScriptCore/API/JSValueRef.cpp b/JavaScriptCore/API/JSValueRef.cpp index a29a207..c22e8d8 100644 --- a/JavaScriptCore/API/JSValueRef.cpp +++ b/JavaScriptCore/API/JSValueRef.cpp @@ -213,6 +213,12 @@ JSValueRef JSValueMakeNumber(JSContextRef ctx, double value) ExecState* exec = toJS(ctx); APIEntryShim entryShim(exec); + // Our JSValue representation relies on a standard bit pattern for NaN. NaNs + // generated internally to JavaScriptCore naturally have that representation, + // but an external NaN might not. + if (isnan(value)) + value = NaN; + return toRef(exec, jsNumber(exec, value)); } -- cgit v1.1