gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] /srv/bzr/gnash/avm2 r9635: Convert instance instanceof Cl


From: Tom Stellard
Subject: [Gnash-commit] /srv/bzr/gnash/avm2 r9635: Convert instance instanceof Class to Std.is(instance, Class)
Date: Sun, 19 Oct 2008 20:00:12 +0800
User-agent: Bazaar (1.5)

------------------------------------------------------------
revno: 9635
committer: Tom Stellard <address@hidden>
branch nick: gnash_dev
timestamp: Sun 2008-10-19 20:00:12 +0800
message:
  Convert instance instanceof Class to Std.is(instance,Class)
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-19 11:26:22 
+0000
+++ b/testsuite/actionscript.all/haxe-swf9/as_to_hx.pl  2008-10-19 12:00:12 
+0000
@@ -107,16 +107,7 @@
 #              print $_;
 #              next;
        }
-       #Convert instance of expressions.
-       #TODO: This only works some of the time.  Skipping these for now.
-       #BROKEN: 
-       #Dejagnu.check(! "literal string" instanceof String, "! \"literal 
string\" instanceof String"+' '+' ['+"String.as"+':'+1056 +']');
-       if(index($_,"instanceof") != $[-1){
-               skip_line();
-#              print instance_of($_);  
-               next;
-       }
-       
+
        #Replace deletes:
        #ACTIONSCRIPT: delete Object.prototype.toString
        #HAXE: Reflect.deleteField(Object.prototype,toString)
@@ -154,7 +145,7 @@
        #Calls to split()
        if(index($_,"split") != $[-1){
                
-               #CHECK 5.1
+               #CHECK 5.1 - Must run before CHECK 8
                #Replace calls to split that have no arguments with an array 
whose only member is the caller.
                $_ =~ s/(\w+)\.split\(\)/[$1]/g;
 
@@ -173,6 +164,10 @@
                
        }
 
+       #CHECK 8 - Must run after CHECK 5.1
+       #Convert instance instanceof Class to Std.is(instance,Class)
+       $_ =~ s/(\w+|\"[\w\s]+\"|\[\w+\])\s*instanceof\s*(\w+)/Std.is($1,$2)/g;
+
        #Replace undefined with null.
        $_ =~ s/undefined/null/g;
 


reply via email to

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