gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-


From: Bastiaan Jacques
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-1990-g4a15e8f
Date: Fri, 16 May 2014 23:33:11 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnash".

The branch, master has been updated
       via  4a15e8fcf035380799cf2135e6e2665cf89297a2 (commit)
       via  691c193c9c517bd400b51c1d6a82c2ff3850f97b (commit)
      from  924fed9f7502134ab3f6c036813223ae72dc31cd (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit//commit/?id=4a15e8fcf035380799cf2135e6e2665cf89297a2


commit 4a15e8fcf035380799cf2135e6e2665cf89297a2
Author: Bastiaan Jacques <address@hidden>
Date:   Sat May 17 01:31:05 2014 +0200

    Savannah #42375: Make Date component setting functions no-ops if the Date 
is NaN.

diff --git a/libcore/asobj/Date_as.cpp b/libcore/asobj/Date_as.cpp
index ee5d12b..b7a2f14 100644
--- a/libcore/asobj/Date_as.cpp
+++ b/libcore/asobj/Date_as.cpp
@@ -766,6 +766,9 @@ date_setTime(const fn_call& fn)
 // if an additional extra parameter is passed, switch to working in UTC
 // instead. Apart from the bottom-level conversions they are identical.
 
+// If the Date object has been set to NaN previously (see date_setTime()),
+// then all functions that set Date components are no-ops.
+
 void
 gnashTimeToDate(GnashTime& gt, Date_as& date, bool utc)
 {
@@ -839,15 +842,15 @@ date_setfullyear(const fn_call& fn)
     else if (rogue_date_args(fn, 3) != 0.0) {
         date->setTimeValue(NaN);
     }
-    else {
+    else if (!isNaN(date->getTimeValue())) {
         GnashTime gt;
         dateToGnashTime(*date, gt, utc);
         gt.year = toInt(fn.arg(0), getVM(fn)) - 1900;
         if (fn.nargs >= 2) gt.month = toInt(fn.arg(1), getVM(fn));
         if (fn.nargs >= 3) gt.monthday = toInt(fn.arg(2), getVM(fn));
         gnashTimeToDate(gt, *date, utc);
-  }
-  return as_value(date->getTimeValue());
+    }
+    return as_value(date->getTimeValue());
 }
 
 /// \brief Date.setYear(year[,month[,day]])
@@ -879,7 +882,7 @@ date_setYear(const fn_call& fn)
     else if (rogue_date_args(fn, 3) != 0.0) {
         date->setTimeValue(NaN);
     }
-    else {
+    else if (!isNaN(date->getTimeValue())) {
         GnashTime gt;
 
         dateToGnashTime(*date, gt, false);
@@ -934,7 +937,7 @@ date_setmonth(const fn_call& fn)
     else if (rogue_date_args(fn, 2) != 0.0) {
         date->setTimeValue(NaN);
     }
-    else {
+    else if (!isNaN(date->getTimeValue())) {
 
         GnashTime gt;
 
@@ -986,7 +989,7 @@ date_setDate(const fn_call& fn)
       date->setTimeValue(NaN);  // Is what FlashPlayer sets
   } else if (rogue_date_args(fn, 1) != 0.0) {
       date->setTimeValue(NaN);
-  } else {
+  } else if (!isNaN(date->getTimeValue())) {
     GnashTime gt;
 
     dateToGnashTime(*date, gt, utc);
@@ -1030,7 +1033,7 @@ date_setHours(const fn_call& fn)
     else if (rogue_date_args(fn, 4) != 0.0) {
         date->setTimeValue(NaN);
     }
-    else {
+    else if (!isNaN(date->getTimeValue())) {
       
         GnashTime gt;
 
@@ -1076,7 +1079,7 @@ date_setMinutes(const fn_call& fn)
     else if (rogue_date_args(fn, 3) != 0.0) {
         date->setTimeValue(NaN);
     }
-    else {
+    else if (!isNaN(date->getTimeValue())) {
         GnashTime gt;
 
         dateToGnashTime(*date, gt, utc);
@@ -1116,7 +1119,7 @@ date_setSeconds(const fn_call& fn)
     else if (rogue_date_args(fn, 2) != 0.0) {
         date->setTimeValue(NaN);
     }
-    else {
+    else if (!isNaN(date->getTimeValue())) {
         // We *could* set seconds [and milliseconds] without breaking the
         // structure out and reasembling it. We do it the same way as the
         // rest for simplicity and in case anyone's date routines ever
@@ -1154,7 +1157,7 @@ date_setMilliseconds(const fn_call& fn)
     else if (rogue_date_args(fn, 1) != 0.0) {
         date->setTimeValue(NaN);
     }
-    else {
+    else if (!isNaN(date->getTimeValue())) {
     
         GnashTime gt;
 
diff --git a/testsuite/actionscript.all/Date.as 
b/testsuite/actionscript.all/Date.as
index 3b9488e..174599d 100644
--- a/testsuite/actionscript.all/Date.as
+++ b/testsuite/actionscript.all/Date.as
@@ -692,16 +692,17 @@ check_equals(typeof(foo), 'string');
  check_equals(foo.substring(0, 7), 'foo 950');
 #endif
 
-var o = new Date();
-o.setUTCMilliseconds(); // sets o's date to NaN
-
-ASSetPropFlags(o.__proto__, null, 0, 1);
-for (prop in o) {
-   if (prop.substr(0, 3) == "set" && prop != "setTime") {
-      trace("Testing " + prop + "(1)");
-      o[prop](1);
-      xcheck_equals(o.valueOf().toString(), "NaN");
-   }
+{
+    var o = new Date();
+    o.setUTCMilliseconds(); // sets o's date to NaN
+
+    ASSetPropFlags(o.__proto__, null, 0, 1);
+    for (prop in o) {
+        if (prop.substr(0, 3) == "set" && prop != "setTime") {
+            o[prop](1,2,3,4);
+            check_equals(o.valueOf().toString(), "NaN");
+        }
+    }
 }
 
 #if OUTPUT_VERSION == 5

http://git.savannah.gnu.org/cgit//commit/?id=691c193c9c517bd400b51c1d6a82c2ff3850f97b


commit 691c193c9c517bd400b51c1d6a82c2ff3850f97b
Author: Bastiaan Jacques <address@hidden>
Date:   Sat May 17 00:12:29 2014 +0200

    Add a note about extensions support.

diff --git a/NEWS b/NEWS
index 20dfb8a..b950974 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,7 @@ Caveats:
 * The in-tree copy of jemalloc has been removed in preference to linking
   the system-installed jemalloc library.
 * The minimum required version of FFMPEG/libavcodec (if available) is 53.35.0.
+* Extensions support is now disabled by default.
 
 Improvements since 0.8.10 release are:
 

-----------------------------------------------------------------------

Summary of changes:
 NEWS                               |    1 +
 libcore/asobj/Date_as.cpp          |   23 +++++++++++++----------
 testsuite/actionscript.all/Date.as |   21 +++++++++++----------
 3 files changed, 25 insertions(+), 20 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

[Prev in Thread] Current Thread [Next in Thread]