Jul 1, 2020, 11:58:45 AM7/1/20
I'm currently trying to upgrade a program from using JS 1.8.5 to JS 76. In doing this, I've come across a function in which we try to:
- set a property that doesn't initially exist on an object, using JS_SetProperty(),
- then set that property's attributes to be JSPROP_PERMANENT, using JS_SetPropertyAttributes().
However, in JS 76, JS_SetPropertyAttributes() doesn't appear to exist. Instead, I've had to:
- get the property descriptor, using JS_GetPropertyDescriptor(),
- then set the attributes using .setAttributes().
I'm struggling to find any documentation on the matter so I'm not sure if this is even correct. Is there a new/alternative function to replace JS_SetPropertyAttributes() with?