-
Notifications
You must be signed in to change notification settings - Fork 21
/
context-raw.go
68 lines (53 loc) · 1.33 KB
/
context-raw.go
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
package quickjs
/*
#cgo CFLAGS: -I.
#cgo LDFLAGS: -L. -lquickjs
#include "quickjs-bridge.h"
*/
import "C"
type JSContextRaw struct {
ref *C.JSContext
}
func JSNewContextRaw(runtime JSRuntime) *JSContextRaw {
ctx := new(JSContextRaw)
ctx.ref = C.JS_NewContextRaw(runtime.ref)
return ctx
}
func (ctx *JSContext) ToContext() JSContext {
return JSContext{
ref: ctx.ref,
}
}
func (ctx *JSContextRaw) AddIntrinsicBaseObjects() {
C.JS_AddIntrinsicBaseObjects(ctx.ref)
}
func (ctx *JSContextRaw) AddIntrinsicDate() {
C.JS_AddIntrinsicDate(ctx.ref)
}
func (ctx *JSContextRaw) AddIntrinsicEval() {
C.JS_AddIntrinsicEval(ctx.ref)
}
func (ctx *JSContextRaw) AddIntrinsicStringNormalize() {
C.JS_AddIntrinsicStringNormalize(ctx.ref)
}
func (ctx *JSContextRaw) AddIntrinsicRegExpCompiler() {
C.JS_AddIntrinsicRegExpCompiler(ctx.ref)
}
func (ctx *JSContextRaw) AddIntrinsicRegExp() {
C.JS_AddIntrinsicRegExp(ctx.ref)
}
func (ctx *JSContextRaw) AddIntrinsicJSON() {
C.JS_AddIntrinsicJSON(ctx.ref)
}
func (ctx *JSContextRaw) AddIntrinsicProxy() {
C.JS_AddIntrinsicProxy(ctx.ref)
}
func (ctx *JSContextRaw) AddIntrinsicMapSet() {
C.JS_AddIntrinsicMapSet(ctx.ref)
}
func (ctx *JSContextRaw) AddIntrinsicTypedArrays() {
C.JS_AddIntrinsicTypedArrays(ctx.ref)
}
func (ctx *JSContextRaw) AddIntrinsicPromise() {
C.JS_AddIntrinsicPromise(ctx.ref)
}