We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 59dd641 commit b3f4b97Copy full SHA for b3f4b97
1 file changed
packages/runtime/jsvalue.h
@@ -0,0 +1,37 @@
1
+//
2
+// Created by Dmitry Patsura on 2018-11-08.
3
4
+
5
+#ifndef HLVM_RUNTIME_JSVALUE_H
6
+#define HLVM_RUNTIME_JSVALUE_H
7
8
+class JSObject {
9
+};
10
11
+union JSValueHolder {
12
+ double *number;
13
+ bool *boolean;
14
+ char *string;
15
+ JSObject *object;
16
17
18
+enum JSValueType {
19
+ NUMBER = 0,
20
+ NULL = 2,
21
+ UNDEFINED = 3,
22
+ OBJECT = 4,
23
+ BOOLEAN = 5,
24
+ SYMBOL = 6,
25
26
27
+class JSValue {
28
+protected:
29
+ JSValueHolder *value;
30
+ JSValueType *type;
31
+public:
32
+ bool isUndefined() const {
33
+ return *this->type == UNDEFINED;
34
+ }
35
36
37
+#endif //HLVM_RUNTIME_JSVALUE_H
0 commit comments