diff --git a/src/js_init.cpp b/src/js_init.cpp index 8595f2cb..5c8d6010 100644 --- a/src/js_init.cpp +++ b/src/js_init.cpp @@ -76,16 +76,16 @@ JSObjectRef RJSConstructorCreate(JSContextRef ctx) { JSPropertyAttributes attributes = kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontEnum | kJSPropertyAttributeDontDelete; JSObjectRef listConstructor = JSObjectMakeConstructor(ctx, RJSListClass(), UncallableConstructor); - RJSObjectSetProperty(ctx, realmObject, listString, listConstructor, attributes); + RJSValidatedSetProperty(ctx, realmObject, listString, listConstructor, attributes); JSObjectRef resultsContructor = JSObjectMakeConstructor(ctx, RJSResultsClass(), UncallableConstructor); - RJSObjectSetProperty(ctx, realmObject, resultsString, resultsContructor, attributes); + RJSValidatedSetProperty(ctx, realmObject, resultsString, resultsContructor, attributes); JSObjectRef typesObject = JSObjectMake(ctx, RJSRealmTypeClass(), NULL); - RJSObjectSetProperty(ctx, realmObject, typeString, typesObject, attributes); + RJSValidatedSetProperty(ctx, realmObject, typeString, typesObject, attributes); JSObjectRef clearTestStateFunction = JSObjectMakeFunctionWithCallback(ctx, clearTestStateString, ClearTestState); - RJSObjectSetProperty(ctx, realmObject, clearTestStateString, clearTestStateFunction, attributes); + RJSValidatedSetProperty(ctx, realmObject, clearTestStateString, clearTestStateFunction, attributes); return realmObject; } diff --git a/src/js_util.hpp b/src/js_util.hpp index b02d4ed3..4d7fa311 100644 --- a/src/js_util.hpp +++ b/src/js_util.hpp @@ -201,7 +201,7 @@ static inline size_t RJSValidatedListLength(JSContextRef ctx, JSObjectRef object return RJSValidatedValueToNumber(ctx, lengthValue); } -static inline void RJSObjectSetProperty(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef value, JSPropertyAttributes attributes = 0) { +static inline void RJSValidatedSetProperty(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef value, JSPropertyAttributes attributes = 0) { JSValueRef exception = NULL; JSObjectSetProperty(ctx, object, propertyName, value, attributes, &exception); if (exception) {