gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog server/asobj/Object.cpp testsui...


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog server/asobj/Object.cpp testsui...
Date: Fri, 28 Mar 2008 16:37:45 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  08/03/28 16:37:45

Modified files:
        .              : ChangeLog 
        server/asobj   : Object.cpp 
        testsuite/actionscript.all: Date.as Object.as 

Log message:
        add Object.toLocaleString.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6061&r2=1.6062
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/Object.cpp?cvsroot=gnash&r1=1.46&r2=1.47
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/actionscript.all/Date.as?cvsroot=gnash&r1=1.38&r2=1.39
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/actionscript.all/Object.as?cvsroot=gnash&r1=1.46&r2=1.47

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6061
retrieving revision 1.6062
diff -u -b -r1.6061 -r1.6062
--- ChangeLog   28 Mar 2008 16:23:06 -0000      1.6061
+++ ChangeLog   28 Mar 2008 16:37:44 -0000      1.6062
@@ -1,3 +1,9 @@
+2008-03-28 Sandro Santilli <address@hidden>
+
+       * server/asobj/Object.cpp: add Object.toLocaleString.
+       * testsuite/actionscript.all/: Date.as, Object.as:
+         toLocaleString tests pass.
+
 2008-03-28 Benjamin Wolsey <address@hidden>
 
        * server/as_environment.h

Index: server/asobj/Object.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/Object.cpp,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -b -r1.46 -r1.47
--- server/asobj/Object.cpp     28 Mar 2008 16:23:08 -0000      1.46
+++ server/asobj/Object.cpp     28 Mar 2008 16:37:44 -0000      1.47
@@ -27,6 +27,7 @@
 #include "sprite_instance.h" // for Object.registerClass  
(get_movie_definition)
 #include "sprite_definition.h" // for Object.registerClass  
(get_movie_definition)
 #include "VM.h" // for SWF version (attachObjectInterface)
+#include "namedStrings.h" // for NSV::PROP_TO_STRING
 
 #include "log.h"
 
@@ -43,6 +44,7 @@
 static as_value object_isPrototypeOf(const fn_call&);
 static as_value object_watch(const fn_call&);
 static as_value object_unwatch(const fn_call&);
+static as_value object_toLocaleString(const fn_call&);
 
 
 static void
@@ -59,6 +61,9 @@
        vm.registerNative(as_object::tostring_method, 101, 4);
        o.init_member("toString", vm.getNative(101, 4));
 
+       // Object.toLocaleString()
+       o.init_member("toLocaleString", new 
builtin_function(object_toLocaleString));
+
        if ( target_version  < 6 ) return;
 
        // Object.addProperty()
@@ -431,4 +436,11 @@
        return as_value();
 }
   
+as_value
+object_toLocaleString(const fn_call& fn)
+{
+       boost::intrusive_ptr<as_object> obj = fn.this_ptr;
+       return obj->callMethod(NSV::PROP_TO_STRING);
+}
+  
 } // namespace gnash

Index: testsuite/actionscript.all/Date.as
===================================================================
RCS file: /sources/gnash/gnash/testsuite/actionscript.all/Date.as,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -b -r1.38 -r1.39
--- testsuite/actionscript.all/Date.as  11 Mar 2008 19:31:47 -0000      1.38
+++ testsuite/actionscript.all/Date.as  28 Mar 2008 16:37:45 -0000      1.39
@@ -22,7 +22,7 @@
 // execute it like this gnash -1 -r 0 -v out.swf
 
 
-rcsid="$Id: Date.as,v 1.38 2008/03/11 19:31:47 strk Exp $";
+rcsid="$Id: Date.as,v 1.39 2008/03/28 16:37:45 strk Exp $";
 #include "check.as"
 
 check_equals(typeof(Date), 'function');
@@ -126,7 +126,7 @@
 check (d.setUTCSeconds);
 check (d.setYear);
 check (d.toString);
-xcheck (d.toLocaleString);
+check (d.toLocaleString);
 // UTC is a static method present from v5
 check_equals (d.UTC, undefined);
 check (Date.UTC);
@@ -250,7 +250,7 @@
        check_equals(d.getUTCMilliseconds(), 0);
        
     /// No difference:
-    xcheck_equals (Date.toLocaleString(), Date.toString());
+    check_equals (Date.toLocaleString(), Date.toString());
 
 // Check other convertible types
 // Booleans convert to 0 and 1

Index: testsuite/actionscript.all/Object.as
===================================================================
RCS file: /sources/gnash/gnash/testsuite/actionscript.all/Object.as,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -b -r1.46 -r1.47
--- testsuite/actionscript.all/Object.as        26 Mar 2008 08:25:03 -0000      
1.46
+++ testsuite/actionscript.all/Object.as        28 Mar 2008 16:37:45 -0000      
1.47
@@ -21,7 +21,7 @@
 // execute it like this gnash -1 -r 0 -v out.swf
 
 
-rcsid="$Id: Object.as,v 1.46 2008/03/26 08:25:03 bwy Exp $";
+rcsid="$Id: Object.as,v 1.47 2008/03/28 16:37:45 strk Exp $";
 #include "check.as"
 
 // Test existance of methods
@@ -31,12 +31,12 @@
 // registerClass is a public static function of Object
 check_equals(typeof(Object.registerClass), 'function');
 check_equals(typeof(Object.prototype.toString), 'function');
-xcheck_equals(typeof(Object.prototype.toLocaleString), 'function');
+check_equals(typeof(Object.prototype.toLocaleString), 'function');
 check_equals(typeof(Object.prototype.valueOf), 'function');
 check_equals(typeof(Object.prototype.constructor), 'function'); 
 #if OUTPUT_VERSION > 5
  check(Object.prototype.hasOwnProperty('toString'));
- xcheck(Object.prototype.hasOwnProperty('toLocaleString'));
+ check(Object.prototype.hasOwnProperty('toLocaleString'));
  check(Object.prototype.hasOwnProperty('valueOf'));
 #endif
 check_equals(Object.prototype.prototype, undefined);
@@ -410,8 +410,8 @@
 
 // Check toLocaleString calls toString
 backup = Object.prototype.toString;
-Object.prototype.toString = function() { return "toString"; };
-xcheck_equals(Object.prototype.toLocaleString(), "toString");
+Object.prototype.toString = function() { return "toString"+arguments.length; };
+check_equals(Object.prototype.toLocaleString(1), "toString0");
 Object.prototype.toString = backup;
 
 //----------------------




reply via email to

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