Setting property attributes after calling JS_SetProperty()
[email protected] Wed, 1 Jul 2020 08:58:44 -0700 (PDT)
| Newsgroups | gmane.comp.mozilla.devel.jseng |
|---|---|
| Message-ID | <[email protected]> |
Hi, 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? Many thanks, Harry