Hi all,

How can I get list of object or prototype methods? $objfields returns no methods anyway. :-[

var TestCase = {
   version => "111",

   run => function() {
              var a = $objfields(this);
              var i = 0;
          $print("Size: ", $asize(a), "\n");
              while(i < $asize(a)) {
                var fname = $field(a[i]);
                var fvalue = $objget(this, a[i]);
                $print(fname, " : ", fvalue, "\n");
                i += 1;
              }
          },
  foomethod => function() {}
};

var myTest = { zoomethod => function() {} }
$objsetproto(myTest, TestCase);

myTest.version = "222";
myTest.run();

$print("Proto:", $objgetproto(myTest), "\n");
$print(myTest, "\n");
$print(TestCase, "\n");

--
Neko : One VM to run them all
(http://nekovm.org)

Reply via email to