gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog testsuite/actionscript.all/Inhe...


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog testsuite/actionscript.all/Inhe...
Date: Fri, 02 Feb 2007 11:36:57 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  07/02/02 11:36:57

Modified files:
        .              : ChangeLog 
        testsuite/actionscript.all: Inheritance.as 

Log message:
                * testsuite/actionscript.all/Inheritance.as: 
                  Add a test about constructors calling order.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.2231&r2=1.2232
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/actionscript.all/Inheritance.as?cvsroot=gnash&r1=1.22&r2=1.23

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.2231
retrieving revision 1.2232
diff -u -b -r1.2231 -r1.2232
--- ChangeLog   2 Feb 2007 10:38:13 -0000       1.2231
+++ ChangeLog   2 Feb 2007 11:36:57 -0000       1.2232
@@ -1,7 +1,8 @@
 2007-02-02 Sandro Santilli <address@hidden>
 
        * testsuite/actionscript.all/Inheritance.as: don't expect
-         failures with Date object.
+         failures with Date object; add a test about constructors
+         calling order.
        * server/asobj/: Date.{cpp,h}, Global.cpp:
          Ported Date object to new layout; make Date.UTC a not-exported
          class-static

Index: testsuite/actionscript.all/Inheritance.as
===================================================================
RCS file: /sources/gnash/gnash/testsuite/actionscript.all/Inheritance.as,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -b -r1.22 -r1.23
--- testsuite/actionscript.all/Inheritance.as   2 Feb 2007 10:38:13 -0000       
1.22
+++ testsuite/actionscript.all/Inheritance.as   2 Feb 2007 11:36:57 -0000       
1.23
@@ -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: Inheritance.as,v 1.22 2007/02/02 10:38:13 strk Exp $";
+rcsid="$Id: Inheritance.as,v 1.23 2007/02/02 11:36:57 strk Exp $";
 
 #include "check.as"
 
@@ -193,9 +193,9 @@
 // see check.as
 #ifdef MING_SUPPORTS_ASM_EXTENDS
 
-function BaseClass1() {}
+function BaseClass1() { this.baseClassCtorCalled = 1; }
 BaseClass1.prototype.var1 = "var_in_Base_prototype";
-function DerivedClass1() {}
+function DerivedClass1() { this.derivedClassCtorCalled = 1; }
 asm {
        push "DerivedClass1"
        getvariable
@@ -205,6 +205,11 @@
 };
 DerivedClass1.prototype.var2 = "var_in_Derived_prototype";
 var obj = new DerivedClass1;
+check_equals(obj.derivedClassCtorCalled, 1);
+// constructor of 'super' is not automatically called
+// add 'super();' in DerivedClass1 function and see
+// the difference
+check_equals(obj.baseClassCtorCalled, undefined);
 check(obj instanceOf DerivedClass1);
 check(obj instanceOf BaseClass1);
 check_equals(obj.__proto__, DerivedClass1.prototype);
@@ -271,3 +276,9 @@
 check_equals(typeof(b), 'undefined');
 
 
+//------------------------------------------------------
+// Test constructors chain calling
+//------------------------------------------------------
+
+function BaseClass() { this.x = 3; }
+function DerivedClass() { this.x += 1; }




reply via email to

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