-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathultralight_JS.prg
41 lines (31 loc) · 1.06 KB
/
ultralight_JS.prg
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
#include <hbclass.ch>
class JSVALUE
DATA pValue HIDDEN
// DATA pObject HIDDEN
METHOD IsNull()
METHOD IsUndefined()
METHOD IsBoolean()
METHOD IsNumber()
METHOD IsString()
METHOD IsObject()
METHOD IsArray()
METHOD IsFunction()
//v can be nil, number, logic, character, array, hash, codeblock or symbol
CONSTRUCTOR New(v)
// return a value base on its type, in case of object return a hash, in case of function throw an error
METHOD ToValue()
//CONSTRUCTOR FromJSON(cJSON)
//METHOD ToJSON()
// NOTE: IT is not possible copy 2 JSValue
// ** methods valid for array and object **
// return another JSVALUE but takes as as new and JSVALUE
method Attribute OPERATOR []
method HasProperty(cPropertyName) // => L
method DeleteProperty(cPropertyName) //=> L
// ** end of methods valid for array and object **
// valid only for function
Method CallNoThis()
Method Call(thisObj)
METHOD COPY OPERATOR ":="
DESTRUCTOR Destroy()
endclass