gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash/testsuite/actionscript.all Number.as


From: Zou Lunkai
Subject: [Gnash-commit] gnash/testsuite/actionscript.all Number.as
Date: Wed, 02 Apr 2008 06:20:43 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Zou Lunkai <zoulunkai>  08/04/02 06:20:43

Modified files:
        testsuite/actionscript.all: Number.as 

Log message:
        cleanups and more tests.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/actionscript.all/Number.as?cvsroot=gnash&r1=1.49&r2=1.50

Patches:
Index: Number.as
===================================================================
RCS file: /sources/gnash/gnash/testsuite/actionscript.all/Number.as,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -b -r1.49 -r1.50
--- Number.as   1 Apr 2008 08:52:17 -0000       1.49
+++ Number.as   2 Apr 2008 06:20:43 -0000       1.50
@@ -28,7 +28,7 @@
 //     
 
 
-rcsid="$Id: Number.as,v 1.49 2008/04/01 08:52:17 strk Exp $";
+rcsid="$Id: Number.as,v 1.50 2008/04/02 06:20:43 zoulunkai Exp $";
 #include "check.as"
 
 Number.hasOwnProperty = ASnative(101, 5);
@@ -315,44 +315,64 @@
 check_equals(typeof(Number.prototype.valueOf), 'function'); 
 check_equals(typeof(Number.prototype.toString), 'function'); 
 #if OUTPUT_VERSION > 5
-check(isNaN(Number.valueOf()));
+    check(isNaN(Number.valueOf()));
+#else
+    check(!isNaN(Number.valueOf()) );
+#endif
+
+check_equals(typeof(Number), 'function'); 
+check(Number.hasOwnProperty('prototype')); 
+check(Number.hasOwnProperty('__proto__')); 
+check(Number.hasOwnProperty('constructor')); 
+check_equals(typeof(Number.prototype), 'object'); 
+#if OUTPUT_VERSION == 5
+    check_equals(Number.prototype, Object);
+#else
+    check(Number.prototype != Object);
+#endif
+ 
+#if OUTPUT_VERSION == 5
+    // not visible in swf5 by default.
+    check_equals(typeof(Number.valueOf), 'undefined'); 
+    check_equals(typeof(Number.toString), 'undefined'); 
+    check_equals(typeof(Number.__proto__), 'undefined'); 
+    // make properties visible.
+    ASSetPropFlags(Number, null, 0, 128 + 1);
+    ASSetPropFlags(Object, null, 0, 128 + 1);
+#endif
+check_equals(typeof(Number.__proto__), 'object'); 
+check_equals(Number.prototype.__proto__, Object.prototype); 
+
 check_equals(typeof(Number.toString), 'function');
 check_equals(typeof(Number.valueOf), 'function');
 check(!Number.hasOwnProperty('valueOf'));
 check(!Number.hasOwnProperty('toString'));
 check(!Number.__proto__.hasOwnProperty('valueOf'));
 check(!Number.__proto__.hasOwnProperty('toString'));
-check(Number.__proto__.__proto__.hasOwnProperty('valueOf'));
-check(Number.__proto__.__proto__.hasOwnProperty('toString'));
-check(Number.__proto__.__proto__ === Object.prototype);
+check(Number.__proto__.__proto__ == Object.prototype);
 
 check_equals(typeof(Number.valueOf()), 'function'); // this is odd
-#else // OUTPUT_VERSION <= 5
-check(!isNaN(Number.valueOf()) );
-check_equals(typeof(Number), 'function'); 
-check_equals(typeof(Number.valueOf), 'undefined'); 
-check_equals(typeof(Number.__proto__), 'undefined'); 
-check_equals(typeof(Number.toString), 'undefined'); 
-check_equals(typeof(Function), 'undefined');
-#endif
 
 a = 1;
 check_equals(typeof(a.toString), 'function');
 check_equals(typeof(a.valueOf), 'function');
-#if OUTPUT_VERSION > 5
 check(!a.hasOwnProperty('valueOf'));
+#if OUTPUT_VERSION == 5
+    // make properties visible.
+    ASSetPropFlags(Number.prototype, null, 0, 128 + 1);
+    ASSetPropFlags(Object.prototype, null, 0, 128 + 1);
+#endif
 check(a.__proto__.hasOwnProperty('valueOf'));
 check(!a.hasOwnProperty('toString'));
-#endif
+
 
 anum = new Number(1);
 check_equals(typeof(anum.toString), 'function');
 check_equals(typeof(anum.valueOf), 'function');
-#if OUTPUT_VERSION > 5
 check(!anum.hasOwnProperty('valueOf'));
 check(anum.__proto__.hasOwnProperty('valueOf'));
 check(!anum.hasOwnProperty('toString'));
-#endif
+
 
 //-----------------------------------------------------------
 // Check conversion to number
@@ -549,11 +569,11 @@
 // END OF TEST
 
 #if OUTPUT_VERSION < 6
- check_totals(187);
+ check_totals(207);
 #else
 #if OUTPUT_VERSION < 7
- check_totals(200);
+ check_totals(206);
 #else
- check_totals(198);
+ check_totals(204);
 #endif
 #endif




reply via email to

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