We are currently reading the property when Runtime#call is called with no function arguments. In this case, we assume the property is a constant such as Math.PI and that the property must simply be read.
When there are no arguments to #call we must coerce the property key on the stack (a string) to a function using #get_prop. This allows us to use the #is_callable API method to determine if we should execute a function to get the return value.
Runtime#call
is called with no function arguments. In this case, we assume the property is a constant such asMath.PI
and that the property must simply be read.#call
we must coerce the property key on the stack (a string) to a function using#get_prop
. This allows us to use the#is_callable
API method to determine if we should execute a function to get the return value.resolves: https://github.com/jessedoyle/duktape.cr/issues/57