only ignore invalid property exceptions

This commit is contained in:
Ari Lazier 2015-10-27 09:16:19 -07:00
parent 9092f9ac5f
commit db67fe71ea
1 changed files with 6 additions and 2 deletions

View File

@ -33,10 +33,14 @@ JSValueRef ObjectGetProperty(JSContextRef ctx, JSObjectRef jsObject, JSStringRef
try {
Object *obj = RJSGetInternal<Object *>(jsObject);
return obj->get_property_value<JSValueRef>(ctx, RJSStringForJSString(jsPropertyName));
} catch (std::exception &ex) {
} catch (InvalidPropertyException &ex) {
// getters for nonexistent properties in JS should always return undefined
return NULL;
} catch (std::exception &ex) {
if (exception) {
*exception = RJSMakeError(ctx, ex);
}
}
return NULL;
}
bool ObjectSetProperty(JSContextRef ctx, JSObjectRef jsObject, JSStringRef jsPropertyName, JSValueRef value, JSValueRef* exception) {