1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//! Facilities for identifying the type of a `v8::Local` handle.

use raw::Local;

extern "C" {

    /// Indicates if the value type is `Undefined`.
    #[link_name = "Neon_Tag_IsUndefined"]
    pub fn is_undefined(val: Local) -> bool;

    /// Indicates if the value type is `Null`.
    #[link_name = "Neon_Tag_IsNull"]
    pub fn is_null(val: Local) -> bool;

    /// Indicates if the value type is `Number`.
    #[link_name = "Neon_Tag_IsNumber"]
    pub fn is_number(val: Local) -> bool;

    /// Indicates if the value type is `Boolean`.
    #[link_name = "Neon_Tag_IsBoolean"]
    pub fn is_boolean(val: Local) -> bool;

    /// Indicates if the value type is `String`.
    #[link_name = "Neon_Tag_IsString"]
    pub fn is_string(val: Local) -> bool;

    /// Indicates if the value type is `Object`.
    #[link_name = "Neon_Tag_IsObject"]
    pub fn is_object(val: Local) -> bool;

    /// Indicates if the value type is `Array`.
    #[link_name = "Neon_Tag_IsArray"]
    pub fn is_array(val: Local) -> bool;

    /// Indicates if the value type is `Function`.
    #[link_name = "Neon_Tag_IsFunction"]
    pub fn is_function(val: Local) -> bool;

    /// Indicates if the value type is `Error`.
    #[link_name = "Neon_Tag_IsError"]
    pub fn is_error(val: Local) -> bool;

    /// Indicates if the value type is `Buffer`.
    #[link_name = "Neon_Tag_IsBuffer"]
    pub fn is_buffer(obj: Local) -> bool;

    /// Indicates if the value type is `ArrayBuffer`.
    #[link_name = "Neon_Tag_IsArrayBuffer"]
    pub fn is_arraybuffer(obj: Local) -> bool;

}