Danack / PHP-to-Javascript

A tool for converting simple PHP objects/code to Javascript, so that code for manipulating objects can be used both server-side and client-side.
Other
104 stars 32 forks source link

syntax error after static method call #66

Open ghost opened 10 years ago

ghost commented 10 years ago
class Foo{
    public function testIt(){
        $arg='';
        $t='';
        $d=array(
            'name'=>self::testStatic($arg).'-'.$t; // < wtf here?
        );
    }
    public static function testStatic($foo){}
}

is converted to

function Foo(){
     this.testIt = function (){
        var arg='';
        var t='';
        var d={
            'name':Foo.testStatic(arg) + "" + 0 : '-' + "" + t; // < wtf here?
        };
    };
}
Foo.testStatic = function (foo){}