gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog server/as_function.cpp server/v...


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog server/as_function.cpp server/v...
Date: Wed, 28 Feb 2007 23:58:27 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  07/02/28 23:58:26

Modified files:
        .              : ChangeLog 
        server         : as_function.cpp 
        server/vm      : ASHandlers.cpp 
        testsuite/actionscript.all: Function.as String.as array.as 

Log message:
                * testsuite/actionscript.all/: array.as, Function.as
                  Don't expect failures when checking for missing
                  apply/call in SWF5.
                * server/as_function.cpp (getFunctionPrototype):
                  Don't register 'apply' and 'call' members if
                  SWF < 6; use builtin_function when registering them.
                * testsuite/actionscript.all/String.as:
                  Add test for 'substring' with base == length;
                  Fix test for SWF5 (no Function.call or Function.apply
                  there)
                * server/vm/ASHandlers.cpp (ActionSubString):
                  fix case in which base is == length.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.2503&r2=1.2504
http://cvs.savannah.gnu.org/viewcvs/gnash/server/as_function.cpp?cvsroot=gnash&r1=1.19&r2=1.20
http://cvs.savannah.gnu.org/viewcvs/gnash/server/vm/ASHandlers.cpp?cvsroot=gnash&r1=1.43&r2=1.44
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/actionscript.all/Function.as?cvsroot=gnash&r1=1.23&r2=1.24
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/actionscript.all/String.as?cvsroot=gnash&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/actionscript.all/array.as?cvsroot=gnash&r1=1.13&r2=1.14

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.2503
retrieving revision 1.2504
diff -u -b -r1.2503 -r1.2504
--- ChangeLog   28 Feb 2007 23:40:44 -0000      1.2503
+++ ChangeLog   28 Feb 2007 23:58:26 -0000      1.2504
@@ -1,7 +1,18 @@
 2007-03-01 Sandro Santilli <address@hidden>
 
+       * testsuite/actionscript.all/: array.as, Function.as
+         Don't expect failures when checking for missing
+         apply/call in SWF5.
+       * server/as_function.cpp (getFunctionPrototype):
+         Don't register 'apply' and 'call' members if
+         SWF < 6; use builtin_function when registering them.
+       * testsuite/actionscript.all/String.as:
+         Add test for 'substring' with base == length;
+         Fix test for SWF5 (no Function.call or Function.apply
+         there)
        * server/vm/ASHandlers.cpp (ActionGotoExpression):
-         Simplified function, reduced emitted warnings.
+         Simplified function, reduced emitted warnings;
+         (ActionSubString): fix case in which base is == length.
        * server/asobj/Global.cpp: register Stage object always.
        * server/asobj/Stage.cpp: don't register addListener
          and removeListener if SWF < 6.

Index: server/as_function.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/as_function.cpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -b -r1.19 -r1.20
--- server/as_function.cpp      28 Feb 2007 08:14:30 -0000      1.19
+++ server/as_function.cpp      28 Feb 2007 23:58:26 -0000      1.20
@@ -29,8 +29,8 @@
 #include "array.h"
 #include "gnash.h"
 #include "fn_call.h"
-//#include "sprite_instance.h"
 #include "GnashException.h"
+#include "VM.h"
 
 #include <typeinfo>
 #include <iostream>
@@ -78,8 +78,12 @@
        if ( proto.get() == NULL ) {
                // Initialize Function prototype
                proto = new as_object();
-               proto->init_member("apply", &function_apply);
-               proto->init_member("call", &function_call);
+
+               if ( VM::get().getSWFVersion() >= 6 )
+               {
+                       proto->init_member("apply", new 
builtin_function(function_apply));
+                       proto->init_member("call", new 
builtin_function(function_call));
+               }
        }
 
        return proto.get();

Index: server/vm/ASHandlers.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/vm/ASHandlers.cpp,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -b -r1.43 -r1.44
--- server/vm/ASHandlers.cpp    28 Feb 2007 23:40:44 -0000      1.43
+++ server/vm/ASHandlers.cpp    28 Feb 2007 23:58:26 -0000      1.44
@@ -14,7 +14,7 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-/* $Id: ASHandlers.cpp,v 1.43 2007/02/28 23:40:44 strk Exp $ */
+/* $Id: ASHandlers.cpp,v 1.44 2007/02/28 23:58:26 strk Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -78,21 +78,6 @@
 
 namespace SWF { // gnash::SWF
 
-// Utility.  Try to convert str to a number.  If successful,
-// put the result in *result, and return true.  If not
-// successful, put 0 in *result, and return false.
-static bool string_to_number(double* result, const char* str)
-{
-    char* tail = 0;
-    *result = strtod(str, &tail);
-    if (tail == str || *tail != 0)
-       {
-           // Failed conversion to Number.
-           return false;
-       }
-    return true;
-}
-
 // 
 // Utility: construct an object using given constructor.
 // This is used by both ActionNew and ActionNewMethod and
@@ -936,7 +921,7 @@
        base=1;
     }
 
-    else if ( base >= str.length() )
+    else if ( base > str.length() )
     {
        IF_VERBOSE_ASCODING_ERRORS (
        log_aserror("base goes beyond input string in ActionSubString, "

Index: testsuite/actionscript.all/Function.as
===================================================================
RCS file: /sources/gnash/gnash/testsuite/actionscript.all/Function.as,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -b -r1.23 -r1.24
--- testsuite/actionscript.all/Function.as      28 Feb 2007 07:46:23 -0000      
1.23
+++ testsuite/actionscript.all/Function.as      28 Feb 2007 23:58:26 -0000      
1.24
@@ -20,7 +20,7 @@
 // compile this test case with Ming makeswf, and then
 // execute it like this gnash -1 -r 0 -v out.swf
 
-rcsid="$Id: Function.as,v 1.23 2007/02/28 07:46:23 strk Exp $";
+rcsid="$Id: Function.as,v 1.24 2007/02/28 23:58:26 strk Exp $";
 
 #include "check.as"
 
@@ -107,7 +107,7 @@
 #else // OUTPUT_VERSION < 6
 
 // No Function.apply... for SWF up to 5
-xcheck_equals(typeOf(getThisName.apply), 'undefined');
+check_equals(typeOf(getThisName.apply), 'undefined');
 
 #endif
 
@@ -124,7 +124,7 @@
 
 #else // OUTPUT_VERSION < 6
 
-xcheck_equals ( typeOf(getThisName.call), 'undefined' );
+check_equals ( typeOf(getThisName.call), 'undefined' );
 
 #endif
 

Index: testsuite/actionscript.all/String.as
===================================================================
RCS file: /sources/gnash/gnash/testsuite/actionscript.all/String.as,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- testsuite/actionscript.all/String.as        28 Feb 2007 10:52:38 -0000      
1.12
+++ testsuite/actionscript.all/String.as        28 Feb 2007 23:58:26 -0000      
1.13
@@ -1,7 +1,22 @@
-// Mike Carlson's test program for actionscript strings
-// June 19th, 2006
+// 
+//   Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
+// 
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+// 
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+// Original author: Mike Carlson - June 19th, 2006
 
-rcsid="$Id: String.as,v 1.12 2007/02/28 10:52:38 strk Exp $";
+rcsid="$Id: String.as,v 1.13 2007/02/28 23:58:26 strk Exp $";
 
 #include "check.as"
 
@@ -55,8 +70,15 @@
 check_equals ( a.substr(-2,3), "yz" );
 check_equals ( a.substr(-3,2), "xy" );
 check_equals ( a.slice(-5,-3), "vw" );
+#if OUTPUT_VERSION > 5
 check_equals ( a.slice.call(a, -5, -3), "vw" );
 check_equals ( String.prototype.slice.call(a, -5, -3), "vw" );
+#else
+// There was no 'call' or 'apply' thing up to SWF5
+// Actually, there was no Function interface at all!
+check_equals ( a.slice.call(a, -5, -3), undefined );
+check_equals ( String.prototype.slice.call(a, -5, -3), undefined );
+#endif
 check_equals ( a.slice(-4), "wxyz" );
 check_equals ( a.substring(5,2), "cde" );
 check_equals ( a.substring(5,7), "fg" );
@@ -110,6 +132,15 @@
        setvariable
 };
 check_equals( b, "");
+asm {
+       push "b"
+       push "all"
+       push "3" // base is 1-based!
+       push "1" 
+       substring
+       setvariable
+};
+check_equals( b, "l");
 #endif
 
 

Index: testsuite/actionscript.all/array.as
===================================================================
RCS file: /sources/gnash/gnash/testsuite/actionscript.all/array.as,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- testsuite/actionscript.all/array.as 28 Feb 2007 13:00:05 -0000      1.13
+++ testsuite/actionscript.all/array.as 28 Feb 2007 23:58:26 -0000      1.14
@@ -5,7 +5,7 @@
 // Updated with sort functions, and to use check() macro
 // by Mike Carlson Feb. 14th, 2006
 
-rcsid="$Id: array.as,v 1.13 2007/02/28 13:00:05 strk Exp $";
+rcsid="$Id: array.as,v 1.14 2007/02/28 23:58:26 strk Exp $";
 
 #include "check.as"
 
@@ -48,8 +48,8 @@
 check_equals ( a.join.apply(a), "9,8,7,551,200" );
 #else
 // It seems that up to SWF5 we couldn't do this ...
-xcheck_equals ( Array.prototype.join.apply(a), undefined );
-xcheck_equals ( a.join.apply(a), undefined );
+check_equals ( Array.prototype.join.apply(a), undefined );
+check_equals ( a.join.apply(a), undefined );
 #endif
 check_equals ( a.join("test") , "9test8test7test551test200" );
 
@@ -159,6 +159,20 @@
 check_equals(c[8], undefined);
 
 // $Log: array.as,v $
+// Revision 1.14  2007/02/28 23:58:26  strk
+//         * testsuite/actionscript.all/: array.as, Function.as
+//           Don't expect failures when checking for missing
+//           apply/call in SWF5.
+//         * server/as_function.cpp (getFunctionPrototype):
+//           Don't register 'apply' and 'call' members if
+//           SWF < 6; use builtin_function when registering them.
+//         * testsuite/actionscript.all/String.as:
+//           Add test for 'substring' with base == length;
+//           Fix test for SWF5 (no Function.call or Function.apply
+//           there)
+//         * server/vm/ASHandlers.cpp (ActionSubString):
+//       fix case in which base is == length.
+//
 // Revision 1.13  2007/02/28 13:00:05  strk
 //         * server/array.cpp: use builtin_method for builtin
 //           methods :) ensure the 'this' pointer passed




reply via email to

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