gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog server/as_value.cpp testsuite/a...


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog server/as_value.cpp testsuite/a...
Date: Wed, 07 Mar 2007 19:46:46 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  07/03/07 19:46:46

Modified files:
        .              : ChangeLog 
        server         : as_value.cpp 
        testsuite/actionscript.all: Boolean.as 

Log message:
                * server/as_value.cpp (to_bool) don't choke
                  when converting a movieclip value to a boolean.
                * testsuite/actionscript.all/Boolean.as:
                  Add tests for convertion to boolean value.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.2570&r2=1.2571
http://cvs.savannah.gnu.org/viewcvs/gnash/server/as_value.cpp?cvsroot=gnash&r1=1.22&r2=1.23
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/actionscript.all/Boolean.as?cvsroot=gnash&r1=1.10&r2=1.11

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.2570
retrieving revision 1.2571
diff -u -b -r1.2570 -r1.2571
--- ChangeLog   7 Mar 2007 19:06:12 -0000       1.2570
+++ ChangeLog   7 Mar 2007 19:46:46 -0000       1.2571
@@ -1,3 +1,10 @@
+2007-03-07 Sandro Santilli <address@hidden>
+
+       * server/as_value.cpp (to_bool) don't choke
+         when converting a movieclip value to a boolean.
+       * testsuite/actionscript.all/Boolean.as:
+         Add tests for convertion to boolean value.
+
 2007-03-07 Robert Millan <address@hidden>
 
        * plugin/plugin.cpp: Guard the first argument to kill() for previously
@@ -16,7 +23,7 @@
          on button state change (invalidate only when needed, restart only
                reappeared characters)                  
 
-2007-03-06 Sandro Santilli <address@hidden>
+2007-03-07 Sandro Santilli <address@hidden>
 
        * testsuite/swfdec/: README, swfdec_gnash_tester:
          Initial stuff to hook on swfdec testsuite.

Index: server/as_value.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/as_value.cpp,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -b -r1.22 -r1.23
--- server/as_value.cpp 6 Mar 2007 17:35:09 -0000       1.22
+++ server/as_value.cpp 7 Mar 2007 19:46:46 -0000       1.23
@@ -321,6 +321,8 @@
        return m_c_function_value != NULL;
     } else if (m_type == AS_FUNCTION) {
        return m_as_function_value != NULL;
+    } else if (m_type == MOVIECLIP) {
+       return true;
     } else {
        assert(m_type == UNDEFINED || m_type == NULLTYPE);
        return false;

Index: testsuite/actionscript.all/Boolean.as
===================================================================
RCS file: /sources/gnash/gnash/testsuite/actionscript.all/Boolean.as,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- testsuite/actionscript.all/Boolean.as       25 Nov 2006 14:50:23 -0000      
1.10
+++ testsuite/actionscript.all/Boolean.as       7 Mar 2007 19:46:46 -0000       
1.11
@@ -1,5 +1,5 @@
 // 
-//   Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+//   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
@@ -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: Boolean.as,v 1.10 2006/11/25 14:50:23 strk Exp $";
+rcsid="$Id: Boolean.as,v 1.11 2007/03/07 19:46:46 strk Exp $";
 
 #include "check.as"
 
@@ -53,3 +53,48 @@
 check_equals(falseBool.toString(), "false");
 check_equals(falseBool.valueOf(), false);
 
+
+//---------------------------------------------------
+// Test convertion to boolean
+//---------------------------------------------------
+
+// boolean
+check( true );
+check( ! false );
+ 
+// number
+check( 1 );
+check( !0 );
+
+// movieclip
+check( _root );
+
+// string
+check( "1" );
+#if OUTPUT_VERSION < 7
+ check( ! "0" );
+ xcheck( ! "true" );
+ check( ! "false" );
+#else
+ xcheck( "0" );
+ check( "true" );
+ xcheck( "false" );
+#endif
+
+// Null 
+check_equals(typeOf(null), "null" );
+check( ! null );
+
+// Undefined
+check( ! undefined );
+
+// Function
+check( play );
+
+// Object - conversion might depend on object type
+emptyArray = new Array();
+check( emptyArray );
+falseBoolean = new Boolean(false);
+check( falseBoolean );
+trueBoolean = new Boolean(true);
+check( trueBoolean );




reply via email to

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