Return Fallible from get_callable_property.

This commit is contained in:
Ms2ger 2015-06-14 16:01:11 +02:00
parent 6b886e545d
commit 0607cd3fb5
2 changed files with 7 additions and 9 deletions

View file

@ -5304,10 +5304,8 @@ class CallbackOperationBase(CallbackMethod):
"methodName": self.methodName
}
getCallableFromProp = string.Template(
'match self.parent.get_callable_property(cx, "${methodName}") {\n'
' Err(_) => return Err(JSFailed),\n'
' Ok(callable) => callable,\n'
'}').substitute(replacements)
'try!(self.parent.get_callable_property(cx, "${methodName}"))'
).substitute(replacements)
if not self.singleOperation:
return 'JS::Rooted<JS::Value> callable(cx);\n' + getCallableFromProp
return (