forked from Ms2ger/rust-mozjs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcrust.rs
45 lines (37 loc) · 1.31 KB
/
crust.rs
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
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use std::libc;
use jsapi;
use jsapi::*;
use jsval::JSVal;
pub extern fn JS_PropertyStub(cx: *JSContext, obj: JSHandleObject, id: JSHandleId, vp: JSMutableHandleValue) -> JSBool {
unsafe {
jsapi::JS_PropertyStub(cx, obj, id, vp)
}
}
pub extern fn JS_StrictPropertyStub(cx: *JSContext, obj: JSHandleObject, id: JSHandleId, strict: JSBool, vp: JSMutableHandleValue) -> JSBool {
unsafe {
jsapi::JS_StrictPropertyStub(cx, obj, id, strict, vp)
}
}
pub extern fn JS_EnumerateStub(cx: *JSContext, obj: JSHandleObject) -> JSBool {
unsafe {
jsapi::JS_EnumerateStub(cx, obj)
}
}
pub extern fn JS_ResolveStub(cx: *JSContext, obj: JSHandleObject, id: JSHandleId) -> JSBool {
unsafe {
jsapi::JS_ResolveStub(cx, obj, id)
}
}
pub extern fn JS_ConvertStub(cx: *JSContext, obj: JSHandleObject, _type: JSType, vp: JSMutableHandleValue) -> JSBool {
unsafe {
jsapi::JS_ConvertStub(cx, obj, _type, vp)
}
}
pub extern fn JS_ArrayIterator(cx: *JSContext, argc: libc::c_uint, vp: *mut JSVal) -> JSBool {
unsafe {
jsapi::JS_ArrayIterator(cx, argc, &*vp)
}
}