getTypeForJsValue static method

Type getTypeForJsValue(
  1. Pointer<JSValueConst> jsValue
)

Implementation

static Type getTypeForJsValue(Pointer<JSValueConst> jsValue) {
  int value = _jsGetTypeTag(jsValue);

  switch (value) {
    case JS_TAG_BOOL:
      return bool;
    case JS_TAG_NULL:
      return Null;
    case JS_TAG_INT:
      return int;
    case JS_TAG_STRING:
      return String;
    case JS_TAG_OBJECT:
      return Object;
    case JS_TAG_UNDEFINED:
      return Null;
    default:
      return Null;
  }
}