<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[163756] trunk/Source/JavaScriptCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/163756">163756</a></dd>
<dt>Author</dt> <dd>mhahnenberg@apple.com</dd>
<dt>Date</dt> <dd>2014-02-09 15:32:25 -0800 (Sun, 09 Feb 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Objective-C API NSDate conversion is off by 1000x (ms vs s)
https://bugs.webkit.org/show_bug.cgi?id=128386

Reviewed by Michael Saboff.

* API/JSValue.mm:
(valueToObjectWithoutCopy):
(valueToDate):
(objectToValueWithoutCopy):
* API/tests/DateTests.h: Added.
* API/tests/DateTests.mm: Added.
(+[DateTests NSDateToJSDateTest]):
(+[DateTests JSDateToNSDateTest]):
(+[DateTests roundTripThroughJSDateTest]):
(+[DateTests roundTripThroughObjCDateTest]):
* API/tests/testapi.mm:
(checkResult):
* JavaScriptCore.xcodeproj/project.pbxproj:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreAPIJSValuemm">trunk/Source/JavaScriptCore/API/JSValue.mm</a></li>
<li><a href="#trunkSourceJavaScriptCoreAPIteststestapimm">trunk/Source/JavaScriptCore/API/tests/testapi.mm</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj">trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreAPItestsDateTestsh">trunk/Source/JavaScriptCore/API/tests/DateTests.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreAPItestsDateTestsmm">trunk/Source/JavaScriptCore/API/tests/DateTests.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreAPIJSValuemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/API/JSValue.mm (163755 => 163756)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/API/JSValue.mm        2014-02-09 21:33:17 UTC (rev 163755)
+++ trunk/Source/JavaScriptCore/API/JSValue.mm        2014-02-09 23:32:25 UTC (rev 163756)
</span><span class="lines">@@ -656,7 +656,7 @@
</span><span class="cx">         return (JSContainerConvertor::Task){ object, wrapped, ContainerNone };
</span><span class="cx"> 
</span><span class="cx">     if (isDate(object, context))
</span><del>-        return (JSContainerConvertor::Task){ object, [NSDate dateWithTimeIntervalSince1970:JSValueToNumber(context, object, 0)], ContainerNone };
</del><ins>+        return (JSContainerConvertor::Task){ object, [NSDate dateWithTimeIntervalSince1970:JSValueToNumber(context, object, 0) / 1000.0], ContainerNone };
</ins><span class="cx"> 
</span><span class="cx">     if (isArray(object, context))
</span><span class="cx">         return (JSContainerConvertor::Task){ object, [NSMutableArray array], ContainerArray };
</span><span class="lines">@@ -759,7 +759,7 @@
</span><span class="cx">             return wrapped;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    double result = JSValueToNumber(context, value, exception);
</del><ins>+    double result = JSValueToNumber(context, value, exception) / 1000.0;
</ins><span class="cx">     return *exception ? nil : [NSDate dateWithTimeIntervalSince1970:result];
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -889,7 +889,7 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         if ([object isKindOfClass:[NSDate class]]) {
</span><del>-            JSValueRef argument = JSValueMakeNumber(contextRef, [object timeIntervalSince1970]);
</del><ins>+            JSValueRef argument = JSValueMakeNumber(contextRef, [object timeIntervalSince1970] * 1000.0);
</ins><span class="cx">             JSObjectRef result = JSObjectMakeDate(contextRef, 1, &amp;argument, 0);
</span><span class="cx">             return (ObjcContainerConvertor::Task){ object, result, ContainerNone };
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreAPItestsDateTestsh"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/API/tests/DateTests.h (0 => 163756)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/API/tests/DateTests.h                                (rev 0)
+++ trunk/Source/JavaScriptCore/API/tests/DateTests.h        2014-02-09 23:32:25 UTC (rev 163756)
</span><span class="lines">@@ -0,0 +1,32 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import &lt;JavaScriptCore/JavaScriptCore.h&gt;
+
+#if JSC_OBJC_API_ENABLED
+
+void runDateTests();
+
+#endif // JSC_OBJC_API_ENABLED
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreAPItestsDateTestsmm"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/API/tests/DateTests.mm (0 => 163756)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/API/tests/DateTests.mm                                (rev 0)
+++ trunk/Source/JavaScriptCore/API/tests/DateTests.mm        2014-02-09 23:32:25 UTC (rev 163756)
</span><span class="lines">@@ -0,0 +1,151 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import &quot;DateTests.h&quot;
+#import &lt;Foundation/Foundation.h&gt;
+
+#if JSC_OBJC_API_ENABLED
+
+extern &quot;C&quot; void checkResult(NSString *description, bool passed);
+
+@interface DateTests : NSObject
++ (void) NSDateToJSDateTest;
++ (void) JSDateToNSDateTest;
++ (void) roundTripThroughJSDateTest;
++ (void) roundTripThroughObjCDateTest;
+@end
+
+#if (TARGET_OS_IPHONE &amp;&amp; __IPHONE_OS_VERSION_MIN_REQUIRED &gt;= 70000) || (TARGET_OS_MAC &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 1090)
+static unsigned unitFlags = NSCalendarUnitSecond | NSCalendarUnitMinute | NSCalendarUnitHour | NSCalendarUnitDay | NSCalendarUnitMonth | NSCalendarUnitYear;
+#else
+static unsigned unitFlags = NSSecondCalendarUnit | NSMinuteCalendarUnit | NSHourCalendarUnit | NSDayCalendarUnit | NSMonthCalendarUnit | NSYearCalendarUnit;
+#endif
+
+@implementation DateTests
++ (void) NSDateToJSDateTest
+{
+    JSContext *context = [[JSContext alloc] init];
+    NSDate *now = [NSDate dateWithTimeIntervalSinceNow:0];
+    NSDateComponents *components = [[NSCalendar currentCalendar] components:unitFlags fromDate:now];
+    JSValue *jsNow = [JSValue valueWithObject:now inContext:context];
+    int year = [[jsNow invokeMethod:@&quot;getFullYear&quot; withArguments:@[]] toInt32];
+    // Months are 0-indexed for JavaScript Dates.
+    int month = [[jsNow invokeMethod:@&quot;getMonth&quot; withArguments:@[]] toInt32] + 1;
+    int day = [[jsNow invokeMethod:@&quot;getDate&quot; withArguments:@[]] toInt32];
+    int hour = [[jsNow invokeMethod:@&quot;getHours&quot; withArguments:@[]] toInt32];
+    int minute = [[jsNow invokeMethod:@&quot;getMinutes&quot; withArguments:@[]] toInt32];
+    int second = [[jsNow invokeMethod:@&quot;getSeconds&quot; withArguments:@[]] toInt32];
+
+    checkResult(@&quot;NSDate to JS Date&quot;, year == [components year]
+        &amp;&amp; month == [components month]
+        &amp;&amp; day == [components day]
+        &amp;&amp; hour == [components hour]
+        &amp;&amp; minute == [components minute]
+        &amp;&amp; second == [components second]);
+}
+
++ (void) JSDateToNSDateTest
+{
+    JSContext *context = [[JSContext alloc] init];
+    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
+    [formatter setDateFormat:@&quot;MMMM dd',' yyyy hh:mm:ss&quot;];
+    NSDate *februaryFourth2014 = [formatter dateFromString:@&quot;February 4, 2014 11:40:03&quot;];
+    NSDateComponents *components = [[NSCalendar currentCalendar] components:unitFlags fromDate:februaryFourth2014];
+    // Months are 0-indexed for JavaScript Dates.
+    JSValue *jsDate = [context[@&quot;Date&quot;] constructWithArguments:@[@2014, @1, @4, @11, @40, @3]];
+    
+    int year = [[jsDate invokeMethod:@&quot;getFullYear&quot; withArguments:@[]] toInt32];
+    int month = [[jsDate invokeMethod:@&quot;getMonth&quot; withArguments:@[]] toInt32] + 1;
+    int day = [[jsDate invokeMethod:@&quot;getDate&quot; withArguments:@[]] toInt32];
+    int hour = [[jsDate invokeMethod:@&quot;getHours&quot; withArguments:@[]] toInt32];
+    int minute = [[jsDate invokeMethod:@&quot;getMinutes&quot; withArguments:@[]] toInt32];
+    int second = [[jsDate invokeMethod:@&quot;getSeconds&quot; withArguments:@[]] toInt32];
+
+    checkResult(@&quot;JS Date to NSDate&quot;, year == [components year]
+        &amp;&amp; month == [components month]
+        &amp;&amp; day == [components day]
+        &amp;&amp; hour == [components hour]
+        &amp;&amp; minute == [components minute]
+        &amp;&amp; second == [components second]);
+}
+
++ (void) roundTripThroughJSDateTest
+{
+    JSContext *context = [[JSContext alloc] init];
+    [context evaluateScript:@&quot;function jsReturnDate(date) { return date; }&quot;];
+    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
+    [formatter setDateFormat:@&quot;MMMM dd',' yyyy hh:mm:ss&quot;];
+    NSDate *februaryFourth2014 = [formatter dateFromString:@&quot;February 4, 2014 11:40:03&quot;];
+    NSDateComponents *components = [[NSCalendar currentCalendar] components:unitFlags fromDate:februaryFourth2014];
+    
+    JSValue *roundTripThroughJS = [context[@&quot;jsReturnDate&quot;] callWithArguments:@[februaryFourth2014]];
+    int year = [[roundTripThroughJS invokeMethod:@&quot;getFullYear&quot; withArguments:@[]] toInt32];
+    // Months are 0-indexed for JavaScript Dates.
+    int month = [[roundTripThroughJS invokeMethod:@&quot;getMonth&quot; withArguments:@[]] toInt32] + 1;
+    int day = [[roundTripThroughJS invokeMethod:@&quot;getDate&quot; withArguments:@[]] toInt32];
+    int hour = [[roundTripThroughJS invokeMethod:@&quot;getHours&quot; withArguments:@[]] toInt32];
+    int minute = [[roundTripThroughJS invokeMethod:@&quot;getMinutes&quot; withArguments:@[]] toInt32];
+    int second = [[roundTripThroughJS invokeMethod:@&quot;getSeconds&quot; withArguments:@[]] toInt32];
+
+    checkResult(@&quot;JS date round trip&quot;, year == [components year]
+        &amp;&amp; month == [components month]
+        &amp;&amp; day == [components day]
+        &amp;&amp; hour == [components hour]
+        &amp;&amp; minute == [components minute]
+        &amp;&amp; second == [components second]);
+}
+
++ (void) roundTripThroughObjCDateTest
+{
+    JSContext *context = [[JSContext alloc] init];
+    context[@&quot;objcReturnDate&quot;] = ^(NSDate *date) {
+        return date;
+    };
+    [context evaluateScript:@&quot;function test() {\
+        var date = new Date(2014, 1, 4, 11, 40, 3); \
+        var result = objcReturnDate(date); \
+        return date.getYear() === result.getYear() \
+            &amp;&amp; date.getMonth() === result.getMonth() \
+            &amp;&amp; date.getDate() === result.getDate() \
+            &amp;&amp; date.getHours() === result.getHours() \
+            &amp;&amp; date.getMinutes() === result.getMinutes() \
+            &amp;&amp; date.getSeconds() === result.getSeconds() \
+            &amp;&amp; date.getMilliseconds() === result.getMilliseconds();\
+    }&quot;];
+    
+    checkResult(@&quot;ObjC date round trip&quot;, [[context[@&quot;test&quot;] callWithArguments:@[]] toBool]);
+}
+
+@end
+
+void runDateTests()
+{
+    [DateTests NSDateToJSDateTest];
+    [DateTests JSDateToNSDateTest];
+    [DateTests roundTripThroughJSDateTest];
+    [DateTests roundTripThroughObjCDateTest];
+}
+
+#endif // JSC_OBJC_API_ENABLED
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreAPIteststestapimm"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/API/tests/testapi.mm (163755 => 163756)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/API/tests/testapi.mm        2014-02-09 21:33:17 UTC (rev 163755)
+++ trunk/Source/JavaScriptCore/API/tests/testapi.mm        2014-02-09 23:32:25 UTC (rev 163756)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> #import &lt;JavaScriptCore/JavaScriptCore.h&gt;
</span><span class="cx"> 
</span><span class="cx"> #import &quot;CurrentThisInsideBlockGetterTest.h&quot;
</span><ins>+#import &quot;DateTests.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> extern &quot;C&quot; void JSSynchronousGarbageCollectForDebugging(JSContextRef);
</span><span class="cx"> 
</span><span class="lines">@@ -34,6 +35,7 @@
</span><span class="cx"> 
</span><span class="cx"> extern int failed;
</span><span class="cx"> extern &quot;C&quot; void testObjectiveCAPI(void);
</span><ins>+extern &quot;C&quot; void checkResult(NSString *, bool);
</ins><span class="cx"> 
</span><span class="cx"> #if JSC_OBJC_API_ENABLED
</span><span class="cx"> 
</span><span class="lines">@@ -450,7 +452,7 @@
</span><span class="cx"> }
</span><span class="cx"> @end
</span><span class="cx"> 
</span><del>-static void checkResult(NSString *description, bool passed)
</del><ins>+extern &quot;C&quot; void checkResult(NSString *description, bool passed)
</ins><span class="cx"> {
</span><span class="cx">     NSLog(@&quot;TEST: \&quot;%@\&quot;: %@&quot;, description, passed ? @&quot;PASSED&quot; : @&quot;FAILED&quot;);
</span><span class="cx">     if (!passed)
</span><span class="lines">@@ -1256,6 +1258,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     currentThisInsideBlockGetterTest();
</span><ins>+    runDateTests();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #else
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (163755 => 163756)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2014-02-09 21:33:17 UTC (rev 163755)
+++ trunk/Source/JavaScriptCore/ChangeLog        2014-02-09 23:32:25 UTC (rev 163756)
</span><span class="lines">@@ -1,3 +1,24 @@
</span><ins>+2014-02-09  Mark Hahnenberg  &lt;mhahnenberg@apple.com&gt;
+
+        Objective-C API NSDate conversion is off by 1000x (ms vs s)
+        https://bugs.webkit.org/show_bug.cgi?id=128386
+
+        Reviewed by Michael Saboff.
+
+        * API/JSValue.mm:
+        (valueToObjectWithoutCopy):
+        (valueToDate):
+        (objectToValueWithoutCopy):
+        * API/tests/DateTests.h: Added.
+        * API/tests/DateTests.mm: Added.
+        (+[DateTests NSDateToJSDateTest]):
+        (+[DateTests JSDateToNSDateTest]):
+        (+[DateTests roundTripThroughJSDateTest]):
+        (+[DateTests roundTripThroughObjCDateTest]):
+        * API/tests/testapi.mm:
+        (checkResult):
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+
</ins><span class="cx"> 2014-02-09  Andreas Kling  &lt;akling@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Pass VM instead of ExecState to JSCell::fastGetOwnProperty().
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj (163755 => 163756)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2014-02-09 21:33:17 UTC (rev 163755)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2014-02-09 23:32:25 UTC (rev 163756)
</span><span class="lines">@@ -1345,13 +1345,14 @@
</span><span class="cx">                 C25F8BCE157544A900245B71 /* IncrementalSweeper.h in Headers */ = {isa = PBXBuildFile; fileRef = C25F8BCC157544A900245B71 /* IncrementalSweeper.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 C283190016FE4B7D00157BFD /* HandleBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = C28318FF16FE4B7D00157BFD /* HandleBlock.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 C283190216FE533E00157BFD /* HandleBlockInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = C283190116FE533E00157BFD /* HandleBlockInlines.h */; };
</span><ins>+                C288B2DE18A54D3E007BE40B /* DateTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = C288B2DD18A54D3E007BE40B /* DateTests.mm */; };
</ins><span class="cx">                 C2981FD817BAEE4B00A3BC98 /* DFGDesiredWeakReferences.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2981FD617BAEE4B00A3BC98 /* DFGDesiredWeakReferences.cpp */; };
</span><span class="cx">                 C2981FD917BAEE4B00A3BC98 /* DFGDesiredWeakReferences.h in Headers */ = {isa = PBXBuildFile; fileRef = C2981FD717BAEE4B00A3BC98 /* DFGDesiredWeakReferences.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 C2981FDC17BAFF4400A3BC98 /* DFGDesiredWriteBarriers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2981FDA17BAFF4400A3BC98 /* DFGDesiredWriteBarriers.cpp */; };
</span><span class="cx">                 C2981FDD17BAFF4400A3BC98 /* DFGDesiredWriteBarriers.h in Headers */ = {isa = PBXBuildFile; fileRef = C2981FDB17BAFF4400A3BC98 /* DFGDesiredWriteBarriers.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 C29ECB031804D0ED00D2CBB4 /* CurrentThisInsideBlockGetterTest.mm in Sources */ = {isa = PBXBuildFile; fileRef = C29ECB011804D0ED00D2CBB4 /* CurrentThisInsideBlockGetterTest.mm */; };
</span><span class="cx">                 C2A7F688160432D400F76B98 /* JSDestructibleObject.h in Headers */ = {isa = PBXBuildFile; fileRef = C2A7F687160432D400F76B98 /* JSDestructibleObject.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><del>-       C2B6D75318A33793004A9301 /* WriteBarrierInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = C2B6D75218A33793004A9301 /* WriteBarrierInlines.h */; settings = {ATTRIBUTES = (Private, ); }; };
</del><ins>+                C2B6D75318A33793004A9301 /* WriteBarrierInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = C2B6D75218A33793004A9301 /* WriteBarrierInlines.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 C2B916C214DA014E00CBAC86 /* MarkedAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = C2B916C114DA014E00CBAC86 /* MarkedAllocator.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 C2B916C514DA040C00CBAC86 /* MarkedAllocator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2B916C414DA040C00CBAC86 /* MarkedAllocator.cpp */; };
</span><span class="cx">                 C2C0F7CD17BBFC5B00464FE4 /* DFGDesiredTransitions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2C0F7CB17BBFC5B00464FE4 /* DFGDesiredTransitions.cpp */; };
</span><span class="lines">@@ -2795,6 +2796,8 @@
</span><span class="cx">                 C25F8BCC157544A900245B71 /* IncrementalSweeper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IncrementalSweeper.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 C28318FF16FE4B7D00157BFD /* HandleBlock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HandleBlock.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 C283190116FE533E00157BFD /* HandleBlockInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HandleBlockInlines.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                C288B2DC18A54D3E007BE40B /* DateTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DateTests.h; path = API/tests/DateTests.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                C288B2DD18A54D3E007BE40B /* DateTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = DateTests.mm; path = API/tests/DateTests.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 C2981FD617BAEE4B00A3BC98 /* DFGDesiredWeakReferences.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGDesiredWeakReferences.cpp; path = dfg/DFGDesiredWeakReferences.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 C2981FD717BAEE4B00A3BC98 /* DFGDesiredWeakReferences.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGDesiredWeakReferences.h; path = dfg/DFGDesiredWeakReferences.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 C2981FDA17BAFF4400A3BC98 /* DFGDesiredWriteBarriers.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGDesiredWriteBarriers.cpp; path = dfg/DFGDesiredWriteBarriers.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -2802,7 +2805,7 @@
</span><span class="cx">                 C29ECB011804D0ED00D2CBB4 /* CurrentThisInsideBlockGetterTest.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = CurrentThisInsideBlockGetterTest.mm; path = API/tests/CurrentThisInsideBlockGetterTest.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 C29ECB021804D0ED00D2CBB4 /* CurrentThisInsideBlockGetterTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CurrentThisInsideBlockGetterTest.h; path = API/tests/CurrentThisInsideBlockGetterTest.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 C2A7F687160432D400F76B98 /* JSDestructibleObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDestructibleObject.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-       C2B6D75218A33793004A9301 /* WriteBarrierInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WriteBarrierInlines.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><ins>+                C2B6D75218A33793004A9301 /* WriteBarrierInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WriteBarrierInlines.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 C2B916C114DA014E00CBAC86 /* MarkedAllocator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MarkedAllocator.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 C2B916C414DA040C00CBAC86 /* MarkedAllocator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MarkedAllocator.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 C2C0F7CB17BBFC5B00464FE4 /* DFGDesiredTransitions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGDesiredTransitions.cpp; path = dfg/DFGDesiredTransitions.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -3228,6 +3231,8 @@
</span><span class="cx">                                 14D857740A4696C80032146C /* testapi.js */,
</span><span class="cx">                                 86D22219167EF9440024C804 /* testapi.mm */,
</span><span class="cx">                                 651122E5140469BA002B101D /* testRegExp.cpp */,
</span><ins>+                                C288B2DC18A54D3E007BE40B /* DateTests.h */,
+                                C288B2DD18A54D3E007BE40B /* DateTests.mm */,
</ins><span class="cx">                         );
</span><span class="cx">                         name = tests;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="lines">@@ -3663,7 +3668,7 @@
</span><span class="cx">                 7EF6E0BB0EB7A1EC0079AFAF /* runtime */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><del>-               C2B6D75218A33793004A9301 /* WriteBarrierInlines.h */,
</del><ins>+                                C2B6D75218A33793004A9301 /* WriteBarrierInlines.h */,
</ins><span class="cx">                                 BCF605110E203EF800B9A64D /* ArgList.cpp */,
</span><span class="cx">                                 BCF605120E203EF800B9A64D /* ArgList.h */,
</span><span class="cx">                                 BC257DE50E1F51C50016B6C9 /* Arguments.cpp */,
</span><span class="lines">@@ -4698,7 +4703,7 @@
</span><span class="cx">                                 65C0285D1717966800351E35 /* ARMv7DOpcode.h in Headers */,
</span><span class="cx">                                 2A68295B1875F80500B6C3E2 /* CopyWriteBarrier.h in Headers */,
</span><span class="cx">                                 2A4EC90C1860D6C20094F782 /* WriteBarrierBuffer.h in Headers */,
</span><del>-               C2B6D75318A33793004A9301 /* WriteBarrierInlines.h in Headers */,
</del><ins>+                                C2B6D75318A33793004A9301 /* WriteBarrierInlines.h in Headers */,
</ins><span class="cx">                                 FE5932A8183C5A2600A1ECCC /* VMEntryScope.h in Headers */,
</span><span class="cx">                                 A532439318569709002ED692 /* CodeGeneratorInspectorStrings.py in Headers */,
</span><span class="cx">                                 A532439218569709002ED692 /* CodeGeneratorInspector.py in Headers */,
</span><span class="lines">@@ -5852,6 +5857,7 @@
</span><span class="cx">                                 C29ECB031804D0ED00D2CBB4 /* CurrentThisInsideBlockGetterTest.mm in Sources */,
</span><span class="cx">                                 1440F6100A4F85670005F061 /* testapi.c in Sources */,
</span><span class="cx">                                 86D2221A167EF9440024C804 /* testapi.mm in Sources */,
</span><ins>+                                C288B2DE18A54D3E007BE40B /* DateTests.mm in Sources */,
</ins><span class="cx">                         );
</span><span class="cx">                         runOnlyForDeploymentPostprocessing = 0;
</span><span class="cx">                 };
</span></span></pre>
</div>
</div>

</body>
</html>