jSPropertyAttributesToCEnum function

int jSPropertyAttributesToCEnum(
  1. JSPropertyAttributes type
)

enum JSPropertyAttributes to C enum

Implementation

int jSPropertyAttributesToCEnum(JSPropertyAttributes type) {
  switch (type) {
    case JSPropertyAttributes.kJSPropertyAttributeReadOnly:
      return JSObjectRef.JSPropertyAttributes.kJSPropertyAttributeReadOnly;
    case JSPropertyAttributes.kJSPropertyAttributeDontEnum:
      return JSObjectRef.JSPropertyAttributes.kJSPropertyAttributeDontEnum;
    case JSPropertyAttributes.kJSPropertyAttributeDontDelete:
      return JSObjectRef.JSPropertyAttributes.kJSPropertyAttributeDontDelete;
    default:
      return JSObjectRef.JSPropertyAttributes.kJSPropertyAttributeNone;
  }
}