gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] /srv/bzr/gnash/avm2 r9583: Remove more directives from St


From: Tom Stellard
Subject: [Gnash-commit] /srv/bzr/gnash/avm2 r9583: Remove more directives from String.as.
Date: Fri, 03 Oct 2008 23:26:56 +0800
User-agent: Bazaar (1.5)

------------------------------------------------------------
revno: 9583
committer: Tom Stellard <address@hidden>
branch nick: gnash_dev
timestamp: Fri 2008-10-03 23:26:56 +0800
message:
  Remove more directives from String.as.
modified:
  testsuite/actionscript.all/String.as
  testsuite/actionscript.all/haxe-swf9/as_to_hx.pl
=== modified file 'testsuite/actionscript.all/String.as'
--- a/testsuite/actionscript.all/String.as      2008-10-03 11:37:27 +0000
+++ b/testsuite/actionscript.all/String.as      2008-10-03 15:26:56 +0000
@@ -117,7 +117,6 @@
 
 o = new Object;
 
-#ifndef HAXE
 o.charCodeAt = String.prototype.charCodeAt;
 o.charAt = String.prototype.charAt;
 
@@ -126,7 +125,6 @@
 c = o.charCodeAt(4);
 check_equals(c, "101");
 
-#endif
 //----------------------------------------
 // Check String.indexOf
 // TODO: test with ASnative(251,8)
@@ -342,12 +340,10 @@
 check_equals(ar.length, 3);
 check_equals(ar.toString(), "[o,ject O,ject]");
 
-#ifndef HAXE
 o = new Date(0);
 o.split = String.prototype.split;
 ar = o.split(":");
 check_equals(ar.length, 3);
-#endif
 
 #else
 // SWF5:
@@ -815,11 +811,6 @@
 //-------------------------------------------
 
 // These tests are only correct with SWF6 and above.
-#ifdef HAXE
-var a:Dynamic = new String("Längere Wörter");
-#else
-var a = new String("Längere Wörter");
-#endif
 
 #if OUTPUT_VERSION > 5
 check_equals (a.length, 14);

=== modified file 'testsuite/actionscript.all/haxe-swf9/as_to_hx.pl'
--- a/testsuite/actionscript.all/haxe-swf9/as_to_hx.pl  2008-10-03 11:37:27 
+0000
+++ b/testsuite/actionscript.all/haxe-swf9/as_to_hx.pl  2008-10-03 15:26:56 
+0000
@@ -34,10 +34,15 @@
        
        #CHECK 2
        #Check for a variable definition.
-       if($_ =~ /var\s+(\w+).*[\:\;]/){
-               if(!$vars{$1}){
-                       $vars{$1} = 1;
-                       $important_string = declare_variable($1);       
+       if($_ =~ /(var\s+)(\w+)(.*)([\;\:])/){
+               if(!$vars{$2}){
+                       $vars{$2} = 1;
+                       #Make sure the variable still gets declared even if 
this line is commented out latter.
+                       $important_string = declare_variable($2);
+               }
+#              If the type of the variable is not delcared, make it Dynamic.
+               if($4 eq ';'){
+                       $_ = "$1$2:Dynamic $3$4\n";     
                }
        }
 


reply via email to

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