gnash-commit
[Top][All Lists]
Advanced

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

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


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog server/asobj/Number.cpp
Date: Tue, 19 Feb 2008 08:51:44 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  08/02/19 08:51:44

Modified files:
        .              : ChangeLog 
        server/asobj   : Number.cpp 

Log message:
        log UNIMPLEMENTED for Number.toString(<radix>)

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.5689&r2=1.5690
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/Number.cpp?cvsroot=gnash&r1=1.36&r2=1.37

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.5689
retrieving revision 1.5690
diff -u -b -r1.5689 -r1.5690
--- ChangeLog   19 Feb 2008 08:51:01 -0000      1.5689
+++ ChangeLog   19 Feb 2008 08:51:44 -0000      1.5690
@@ -1,5 +1,7 @@
 2008-02-19 Sandro Santilli <address@hidden>
 
+       * server/asobj/Number.cpp: log UNIMPLEMENTED for
+         Number.toString(<radix>)
        * server/asobj/xml.{cpp,h}: fix getBytesLoaded/Total to return
          undefined when nothing was loaded (reguardless of the .loaded
          property setting).

Index: server/asobj/Number.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/Number.cpp,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -b -r1.36 -r1.37
--- server/asobj/Number.cpp     30 Jan 2008 10:09:35 -0000      1.36
+++ server/asobj/Number.cpp     19 Feb 2008 08:51:44 -0000      1.37
@@ -17,7 +17,7 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 //
 
-/* $Id: Number.cpp,v 1.36 2008/01/30 10:09:35 bwy Exp $ */
+/* $Id: Number.cpp,v 1.37 2008/02/19 08:51:44 strk Exp $ */
 
 #include "log.h"
 #include "tu_config.h"
@@ -55,23 +55,7 @@
 // Forward declarations
 //static void number_val_to_str(double val, char *str);
 //static as_value number_to_string(const fn_call& fn);
-
-static void
-attachNumberInterface(as_object& o)
-{
-       // FIXME: add Number interface here:
-       // Number.MAX_VALUE
-       // Number.MIN_VALUE
-       // Number.NaN
-       // Number.NEGATIVE_INFINITY
-       // Number.POSITIVE_INFINITY
-
-       // Number.toString()
-       o.init_member("toString", new 
builtin_function(as_object::tostring_method));
-
-       // Number.valueOf()
-       o.init_member("valueOf", new 
builtin_function(as_object::valueof_method));
-}
+static void attachNumberInterface(as_object& o);
 
 static as_object*
 getNumberInterface()
@@ -123,8 +107,27 @@
                return _val;
        }
 
+       static as_value toString_method(const fn_call& fn);
 };
 
+static void
+attachNumberInterface(as_object& o)
+{
+       // FIXME: add Number interface here:
+       // Number.MAX_VALUE
+       // Number.MIN_VALUE
+       // Number.NaN
+       // Number.NEGATIVE_INFINITY
+       // Number.POSITIVE_INFINITY
+
+       // Number.toString()
+       o.init_member("toString", new 
builtin_function(number_as_object::toString_method));
+
+       // Number.valueOf()
+       o.init_member("valueOf", new 
builtin_function(as_object::valueof_method));
+}
+
+
 static as_value
 number_ctor(const fn_call& fn)
 {
@@ -183,4 +186,18 @@
        return cl->constructInstance(env, 1, 0);
 }
   
+as_value
+number_as_object::toString_method(const fn_call& fn)
+{
+       boost::intrusive_ptr<as_object> obj = fn.this_ptr;
+
+       if ( fn.nargs ) 
+       {
+               // See https://savannah.gnu.org/bugs/index.php?22360
+               log_unimpl("Number.toString(<radix>)");
+       }
+       std::string text_val = obj->get_text_value();
+       return as_value(text_val);
+}
+  
 } // namespace gnash




reply via email to

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