Skip to content

Instantly share code, notes, and snippets.

@koush
Created November 15, 2019 07:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save koush/ecd9f1a65708f15bc1f71307ba3fd966 to your computer and use it in GitHub Desktop.
Save koush/ecd9f1a65708f15bc1f71307ba3fd966 to your computer and use it in GitHub Desktop.
JS_BOOL JS_IsArrayBuffer(JSValueConst v)
{
JSObject *p;
if (JS_VALUE_GET_TAG(v) != JS_TAG_OBJECT)
return FALSE;
p = JS_VALUE_GET_OBJ(v);
if (p->class_id != JS_CLASS_ARRAY_BUFFER &&
p->class_id != JS_CLASS_SHARED_ARRAY_BUFFER) {
return FALSE;
}
return TRUE;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment