gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] /srv/bzr/gnash/avm2 r9607: Replace new Number() with Std.


From: Tom Stellard
Subject: [Gnash-commit] /srv/bzr/gnash/avm2 r9607: Replace new Number() with Std.ParseInt().
Date: Sat, 11 Oct 2008 00:30:52 +0800
User-agent: Bazaar (1.5)

------------------------------------------------------------
revno: 9607
committer: Tom Stellard <address@hidden>
branch nick: gnash_dev
timestamp: Sat 2008-10-11 00:30:52 +0800
message:
  Replace new Number() with Std.ParseInt().
modified:
  testsuite/actionscript.all/haxe-swf9/as_to_hx.pl
=== modified file 'testsuite/actionscript.all/haxe-swf9/as_to_hx.pl'
--- a/testsuite/actionscript.all/haxe-swf9/as_to_hx.pl  2008-10-10 16:19:12 
+0000
+++ b/testsuite/actionscript.all/haxe-swf9/as_to_hx.pl  2008-10-10 16:30:52 
+0000
@@ -87,6 +87,9 @@
                }
                #Replace calls to new String() with new String("").
                $_ =~ s/(new String\()\)/$1""\)/;
+
+               #TODO: We can probably figure out when to use parseFloat and 
when to use parseInt.
+               $_ =~ s/new Number\(\s*(\w+)\s*\)/Std.parseInt("$1")/g;
                
 #              print $_;
 #              next;
@@ -181,10 +184,6 @@
                next;
        }
 
-       if($_ =~ /Number/){
-               skip_line();
-               next;
-       }
        #Remove calls to hasOwnProperty.  I can't find a Haxe equivilent for 
this.
        if($_=~ /hasOwnProperty/){
                skip_line();


reply via email to

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