jSTypeToCEnum static method

int jSTypeToCEnum(
  1. JSType type
)

enum JSType to C enum

Implementation

static int jSTypeToCEnum(JSType type) {
  switch (type) {
    case JSType.kJSTypeNull:
      return JSValueRef.JSType.kJSTypeNull;
    case JSType.kJSTypeBoolean:
      return JSValueRef.JSType.kJSTypeBoolean;
    case JSType.kJSTypeNumber:
      return JSValueRef.JSType.kJSTypeNumber;
    case JSType.kJSTypeString:
      return JSValueRef.JSType.kJSTypeString;
    case JSType.kJSTypeObject:
      return JSValueRef.JSType.kJSTypeObject;
    case JSType.kJSTypeSymbol:
      return JSValueRef.JSType.kJSTypeSymbol;
    default:
      return JSValueRef.JSType.kJSTypeUndefined;
  }
}