gnash-commit
[Top][All Lists]
Advanced

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

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


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog server/asobj/System.cpp testsui...
Date: Fri, 12 Jan 2007 10:15:13 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  07/01/12 10:15:13

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

Log message:
                * testsuite/actionscript.all/System.as: _global.System is
                  an object, not a class. Use typeof() for stricter checking.
                * server/asobj/System.cpp: fix case of methods, make System
                  an object, not a class.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.2094&r2=1.2095
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/System.cpp?cvsroot=gnash&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/actionscript.all/System.as?cvsroot=gnash&r1=1.8&r2=1.9

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.2094
retrieving revision 1.2095
diff -u -b -r1.2094 -r1.2095
--- ChangeLog   12 Jan 2007 09:53:58 -0000      1.2094
+++ ChangeLog   12 Jan 2007 10:15:13 -0000      1.2095
@@ -1,5 +1,9 @@
 2007-01-12 Sandro Santilli <address@hidden>
 
+       * testsuite/actionscript.all/System.as: _global.System is
+         an object, not a class. Use typeof() for stricter checking.
+       * server/asobj/System.cpp: fix case of methods, make System
+         an object, not a class.
        * testsuite/actionscript.all/Selection.as: _global.Seleciton is
          an object, not a class. Use typeof() for stricter checking.
        * server/asobj/Selection.cpp: fix case of methods, make Selection

Index: server/asobj/System.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/System.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- server/asobj/System.cpp     24 Nov 2006 14:50:30 -0000      1.6
+++ server/asobj/System.cpp     12 Jan 2007 10:15:13 -0000      1.7
@@ -73,9 +73,12 @@
        if ( proto == NULL )
        {
                proto = new as_object();
-               proto->set_member("allowdomain", &system_security_allowdomain);
-               proto->set_member("allowinsecuredomain", 
&system_security_allowinsecuredomain);
-               proto->set_member("loadpolicyfile", 
&system_security_loadpolicyfile);
+               proto->set_member("allowDomain", &system_security_allowdomain);
+
+               // TODO: only available when SWF >= 7 
+               proto->set_member("allowInsecureDomain", 
&system_security_allowinsecuredomain);
+
+               proto->set_member("loadPolicyFile", 
&system_security_loadpolicyfile);
        }
        return proto.get();
 }
@@ -98,8 +101,8 @@
        // Initialize Function prototype
        proto.set_member("security", getSystemSecurityInterface());
        proto.set_member("capabilities", getSystemCapabilitiesInterface());
-       proto.set_member("setclipboard", &system_setclipboard);
-       proto.set_member("showsettings", &system_showsettings);
+       proto.set_member("setClipboard", &system_setclipboard);
+       proto.set_member("showSettings", &system_showsettings);
 }
 
 static as_object*
@@ -150,33 +153,14 @@
     log_msg("%s: unimplemented \n", __PRETTY_FUNCTION__);
 }
 
-static void
-do_nothing(const fn_call& fn)
-{
-       log_msg("User tried to invoke new System()");
-       if ( fn.result )
-       {
-               fn.result->set_undefined();
-       }
-}
-
 void
-system_class_init(as_object& glob)
+system_class_init(as_object& global)
 {
-       // This is going to be the global System "class"/"function"
-       static boost::intrusive_ptr<as_function> sys;
-
-       if ( sys == NULL )
-       {
-               sys = new builtin_function(do_nothing, getSystemInterface());
-
-               // We replicate interface to the System class itself
-               attachSystemInterface(*sys);
-       }
-
-       // Register _global.System
-       glob.set_member("System", sys.get());
+       // _global.System is NOT a class, but a simple object, see System.as
 
+       static boost::intrusive_ptr<as_object> obj = new as_object();
+       attachSystemInterface(*obj);
+       global.set_member("System", obj.get());
 }
 
 

Index: testsuite/actionscript.all/System.as
===================================================================
RCS file: /sources/gnash/gnash/testsuite/actionscript.all/System.as,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- testsuite/actionscript.all/System.as        10 Jan 2007 00:09:56 -0000      
1.8
+++ testsuite/actionscript.all/System.as        12 Jan 2007 10:15:13 -0000      
1.9
@@ -20,33 +20,36 @@
 // compile this test case with Ming makeswf, and then
 // execute it like this gnash -1 -r 0 -v out.swf
 
-rcsid="$Id: System.as,v 1.8 2007/01/10 00:09:56 strk Exp $";
+rcsid="$Id: System.as,v 1.9 2007/01/12 10:15:13 strk Exp $";
 
 #include "check.as"
 
-#if OUTPUT_VERSION < 6
+#if OUTPUT_VERSION >= 6
 
-check_equals(NetStream, undefined);
+check_equals(typeof(System), 'object');
 
-#else // OUTPUT_VERSION >= 6
-
-// test the System constuctor (should fail, it's not instantiatable)
+// _global.System is NOT a class, just an object 
 var systemObj = new System;
-check (systemObj == undefined);
+check_equals ( typeof(systemObj), 'undefined' );
+
+// test the System::security.allowDomain method
+check_equals ( typeof(System.security.allowDomain), 'function' );
+
+// test the System.security.loadPolicyFile method
+check_equals ( typeof(System.security.loadPolicyFile), 'function');
 
-// test the System::security.allowdomain method
-check (System.security.allowdomain != undefined);
+// test the System.setClipboard method
+check_equals ( typeof(System.setClipboard), 'function');
 
-// test the System.security.allowinsecuredomain method
-check (System.security.allowinsecuredomain != undefined);
+// test the System.showSettings method
+check_equals ( typeof(System.showSettings), 'function');
 
-// test the System.security.loadpolicyfile method
-check (System.security.loadpolicyfile != undefined);
+#if OUTPUT_VERSION >= 7
 
-// test the System.setclipboard method
-check (System.setclipboard != undefined);
+// test the System.security.allowInsecureDomain method
+// added in player 7
+check_equals ( typeof(System.security.allowInsecureDomain), 'function' );
 
-// test the System.showsettings method
-check (System.showsettings != undefined);
+#endif // OUTPUT_VERSION >= 7
 
 #endif // OUTPUT_VERSION >= 6




reply via email to

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