problem with methods on a bound class

[email protected] (Dan Thomas) Sun, 1 May 2005 05:43:45 +0100
Newsgroups perl.javascript
Message-ID <[email protected]>
------=_Part_7932_18716444.1114922625826
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Hi,

I've been fiddling around with JavaScript.pm, which is very cool, I have to=
=20
say, I've bound a class, and sucessfully bound an object, and i can read=20
from the object's properties, and execute it's getter/setter functions, but=
=20
for some reason i cannot get the object's methods to work..

here's a cleaned up version of what i've been testing with:

$js->bind_class(
name=3D>'Foo',
methods=3D>{
test =3D> \&Foo::test
},
properties=3D>{
testy =3D>{
flags =3D> JS_PROP_READONLY | JS_PROP_ACCESSOR,
getter =3D> \&Foo::test_getter,
}
}
);
my $obj =3D new Foo();
$js->bind_object('obj', $obj)

(where package Foo has a 'test' method)

...

now in js: 'obj.testy' (the property) works fine, but 'obj.test()' (method)=
=20
just doesn't.. there seems to be no indication that it's successfully bound=
=20
(everything just says it's not defined).. getters and setters work, but=20
methods just don't seem to..

Any clues as to what's going on?

Dan

------=_Part_7932_18716444.1114922625826--