Mercurial > pymonkey
diff docs/rendered/_sources/pymonkey.txt @ 112:2086377c0abe
Added doctest for call_function().
author | Atul Varma <varmaa@toolness.com> |
---|---|
date | Sun, 16 Aug 2009 21:15:28 -0700 |
parents | df607254de2d |
children | e616b4605db0 |
line wrap: on
line diff
--- a/docs/rendered/_sources/pymonkey.txt Sun Aug 16 21:09:21 2009 -0700 +++ b/docs/rendered/_sources/pymonkey.txt Sun Aug 16 21:15:28 2009 -0700 @@ -146,6 +146,16 @@ :class:`Function` to execute, and `args` is a tuple of arguments to pass to the function. + For instance: + + >>> cx = pymonkey.Runtime().new_context() + >>> obj = cx.new_object() + >>> cx.init_standard_classes(obj) + >>> Math = cx.get_property(obj, 'Math') + >>> floor = cx.get_property(Math, 'floor') + >>> cx.call_function(Math, floor, (5.3,)) + 5 + .. method:: init_standard_classes(object) Defines the standard JavaScript classes on the given