Skip to content

Commit 1e91ed5

Browse files
upgrade quickjs-ng
1 parent b96ebc8 commit 1e91ed5

68 files changed

Lines changed: 10784 additions & 6492 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# hirofa-quickjs_sys - Changelog
22

3+
## 0.13.0
4+
5+
* update quickjs-ng to 0.12.0
6+
37
## 0.12.0
48

59
* update quickjs-ng to 0.11.0

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
edition = "2024"
33
name = "hirofa-quickjs-sys"
44
description = "QuickJS, QuickJS-NG Javascript Engine FFI bindings"
5-
version = "0.12.0"
5+
version = "0.13.0"
66
readme = "README.md"
77
repository = "https://github.com/HiRoFa/quickjs-sys"
88
license = "MIT"
@@ -13,8 +13,8 @@ keywords = ["quickjs"]
1313
build = "build.rs"
1414

1515
[features]
16-
#default = ["bellard"]
17-
default = ["quickjs-ng"]
16+
default = ["bellard"]
17+
#default = ["quickjs-ng"]
1818
bellard = []
1919
quickjs-ng = []
2020

quickjs-ng/bindings.rs

Lines changed: 85 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ pub const M_2_SQRTPI: f64 = 1.1283791670955126;
171171
pub const M_SQRT2: f64 = 1.4142135623730951;
172172
pub const M_SQRT1_2: f64 = 0.7071067811865476;
173173
pub const QUICKJS_NG: u32 = 1;
174+
pub const QUICKJS_NG_CC_GNULIKE: u32 = 1;
174175
pub const JS_PROP_CONFIGURABLE: u32 = 1;
175176
pub const JS_PROP_WRITABLE: u32 = 2;
176177
pub const JS_PROP_ENUMERABLE: u32 = 4;
@@ -254,7 +255,7 @@ pub const JS_DEF_PROP_UNDEFINED: u32 = 7;
254255
pub const JS_DEF_OBJECT: u32 = 8;
255256
pub const JS_DEF_ALIAS: u32 = 9;
256257
pub const QJS_VERSION_MAJOR: u32 = 0;
257-
pub const QJS_VERSION_MINOR: u32 = 11;
258+
pub const QJS_VERSION_MINOR: u32 = 12;
258259
pub const QJS_VERSION_PATCH: u32 = 0;
259260
pub const QJS_VERSION_SUFFIX: &[u8; 1] = b"\0";
260261
pub type __gnuc_va_list = __builtin_va_list;
@@ -2771,6 +2772,7 @@ pub const JS_TAG_FIRST: _bindgen_ty_2 = -9;
27712772
pub const JS_TAG_BIG_INT: _bindgen_ty_2 = -9;
27722773
pub const JS_TAG_SYMBOL: _bindgen_ty_2 = -8;
27732774
pub const JS_TAG_STRING: _bindgen_ty_2 = -7;
2775+
pub const JS_TAG_STRING_ROPE: _bindgen_ty_2 = -6;
27742776
pub const JS_TAG_MODULE: _bindgen_ty_2 = -3;
27752777
pub const JS_TAG_FUNCTION_BYTECODE: _bindgen_ty_2 = -2;
27762778
pub const JS_TAG_OBJECT: _bindgen_ty_2 = -1;
@@ -2843,6 +2845,16 @@ pub type JSCFunctionData = ::std::option::Option<
28432845
func_data: *mut JSValue,
28442846
) -> JSValue,
28452847
>;
2848+
pub type JSCClosure = ::std::option::Option<
2849+
unsafe extern "C" fn(
2850+
ctx: *mut JSContext,
2851+
this_val: JSValue,
2852+
argc: ::std::os::raw::c_int,
2853+
argv: *mut JSValue,
2854+
magic: ::std::os::raw::c_int,
2855+
opaque: *mut ::std::os::raw::c_void,
2856+
) -> JSValue,
2857+
>;
28462858
#[repr(C)]
28472859
#[derive(Debug, Copy, Clone)]
28482860
pub struct JSMallocFunctions {
@@ -3229,6 +3241,9 @@ unsafe extern "C" {
32293241
unsafe extern "C" {
32303242
pub fn JS_DupAtom(ctx: *mut JSContext, v: JSAtom) -> JSAtom;
32313243
}
3244+
unsafe extern "C" {
3245+
pub fn JS_DupAtomRT(rt: *mut JSRuntime, v: JSAtom) -> JSAtom;
3246+
}
32323247
unsafe extern "C" {
32333248
pub fn JS_FreeAtom(ctx: *mut JSContext, v: JSAtom);
32343249
}
@@ -3442,6 +3457,9 @@ unsafe extern "C" {
34423457
unsafe extern "C" {
34433458
pub fn JS_IsRegisteredClass(rt: *mut JSRuntime, class_id: JSClassID) -> bool;
34443459
}
3460+
unsafe extern "C" {
3461+
pub fn JS_GetClassName(rt: *mut JSRuntime, class_id: JSClassID) -> JSAtom;
3462+
}
34453463
unsafe extern "C" {
34463464
pub fn JS_NewNumber(ctx: *mut JSContext, d: f64) -> JSValue;
34473465
}
@@ -3630,7 +3648,7 @@ unsafe extern "C" {
36303648
) -> JSValue;
36313649
}
36323650
unsafe extern "C" {
3633-
pub fn JS_NewTwoByteString(ctx: *mut JSContext, buf: *const u16, len: usize) -> JSValue;
3651+
pub fn JS_NewStringUTF16(ctx: *mut JSContext, buf: *const u16, len: usize) -> JSValue;
36343652
}
36353653
unsafe extern "C" {
36363654
pub fn JS_NewAtomString(ctx: *mut JSContext, str_: *const ::std::os::raw::c_char) -> JSValue;
@@ -3649,9 +3667,22 @@ unsafe extern "C" {
36493667
cesu8: bool,
36503668
) -> *const ::std::os::raw::c_char;
36513669
}
3670+
unsafe extern "C" {
3671+
pub fn JS_ToCStringLenUTF16(ctx: *mut JSContext, plen: *mut usize, val1: JSValue)
3672+
-> *const u16;
3673+
}
36523674
unsafe extern "C" {
36533675
pub fn JS_FreeCString(ctx: *mut JSContext, ptr: *const ::std::os::raw::c_char);
36543676
}
3677+
unsafe extern "C" {
3678+
pub fn JS_FreeCStringRT(rt: *mut JSRuntime, ptr: *const ::std::os::raw::c_char);
3679+
}
3680+
unsafe extern "C" {
3681+
pub fn JS_FreeCStringUTF16(ctx: *mut JSContext, ptr: *const u16);
3682+
}
3683+
unsafe extern "C" {
3684+
pub fn JS_FreeCStringRT_UTF16(rt: *mut JSRuntime, ptr: *const u16);
3685+
}
36553686
unsafe extern "C" {
36563687
pub fn JS_NewObjectProtoClass(
36573688
ctx: *mut JSContext,
@@ -3742,6 +3773,9 @@ unsafe extern "C" {
37423773
unsafe extern "C" {
37433774
pub fn JS_GetProxyHandler(ctx: *mut JSContext, proxy: JSValue) -> JSValue;
37443775
}
3776+
unsafe extern "C" {
3777+
pub fn JS_NewProxy(ctx: *mut JSContext, target: JSValue, handler: JSValue) -> JSValue;
3778+
}
37453779
unsafe extern "C" {
37463780
pub fn JS_NewDate(ctx: *mut JSContext, epoch_ms: f64) -> JSValue;
37473781
}
@@ -4141,10 +4175,11 @@ unsafe extern "C" {
41414175
sf: *const JSSharedArrayBufferFunctions,
41424176
);
41434177
}
4178+
pub const JSPromiseStateEnum_JS_PROMISE_NOT_A_PROMISE: JSPromiseStateEnum = -1;
41444179
pub const JSPromiseStateEnum_JS_PROMISE_PENDING: JSPromiseStateEnum = 0;
41454180
pub const JSPromiseStateEnum_JS_PROMISE_FULFILLED: JSPromiseStateEnum = 1;
41464181
pub const JSPromiseStateEnum_JS_PROMISE_REJECTED: JSPromiseStateEnum = 2;
4147-
pub type JSPromiseStateEnum = ::std::os::raw::c_uint;
4182+
pub type JSPromiseStateEnum = ::std::os::raw::c_int;
41484183
unsafe extern "C" {
41494184
pub fn JS_NewPromiseCapability(ctx: *mut JSContext, resolving_funcs: *mut JSValue) -> JSValue;
41504185
}
@@ -4240,6 +4275,21 @@ pub type JSModuleLoaderFunc = ::std::option::Option<
42404275
opaque: *mut ::std::os::raw::c_void,
42414276
) -> *mut JSModuleDef,
42424277
>;
4278+
pub type JSModuleLoaderFunc2 = ::std::option::Option<
4279+
unsafe extern "C" fn(
4280+
ctx: *mut JSContext,
4281+
module_name: *const ::std::os::raw::c_char,
4282+
opaque: *mut ::std::os::raw::c_void,
4283+
attributes: JSValue,
4284+
) -> *mut JSModuleDef,
4285+
>;
4286+
pub type JSModuleCheckSupportedImportAttributes = ::std::option::Option<
4287+
unsafe extern "C" fn(
4288+
ctx: *mut JSContext,
4289+
opaque: *mut ::std::os::raw::c_void,
4290+
attributes: JSValue,
4291+
) -> ::std::os::raw::c_int,
4292+
>;
42434293
unsafe extern "C" {
42444294
pub fn JS_SetModuleLoaderFunc(
42454295
rt: *mut JSRuntime,
@@ -4248,6 +4298,15 @@ unsafe extern "C" {
42484298
opaque: *mut ::std::os::raw::c_void,
42494299
);
42504300
}
4301+
unsafe extern "C" {
4302+
pub fn JS_SetModuleLoaderFunc2(
4303+
rt: *mut JSRuntime,
4304+
module_normalize: JSModuleNormalizeFunc,
4305+
module_loader: JSModuleLoaderFunc2,
4306+
module_check_attrs: JSModuleCheckSupportedImportAttributes,
4307+
opaque: *mut ::std::os::raw::c_void,
4308+
);
4309+
}
42514310
unsafe extern "C" {
42524311
pub fn JS_GetImportMeta(ctx: *mut JSContext, m: *mut JSModuleDef) -> JSValue;
42534312
}
@@ -4257,6 +4316,16 @@ unsafe extern "C" {
42574316
unsafe extern "C" {
42584317
pub fn JS_GetModuleNamespace(ctx: *mut JSContext, m: *mut JSModuleDef) -> JSValue;
42594318
}
4319+
unsafe extern "C" {
4320+
pub fn JS_SetModulePrivateValue(
4321+
ctx: *mut JSContext,
4322+
m: *mut JSModuleDef,
4323+
val: JSValue,
4324+
) -> ::std::os::raw::c_int;
4325+
}
4326+
unsafe extern "C" {
4327+
pub fn JS_GetModulePrivateValue(ctx: *mut JSContext, m: *mut JSModuleDef) -> JSValue;
4328+
}
42604329
pub type JSJobFunc = ::std::option::Option<
42614330
unsafe extern "C" fn(
42624331
ctx: *mut JSContext,
@@ -4490,6 +4559,19 @@ unsafe extern "C" {
44904559
data: *mut JSValue,
44914560
) -> JSValue;
44924561
}
4562+
pub type JSCClosureFinalizerFunc =
4563+
::std::option::Option<unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void)>;
4564+
unsafe extern "C" {
4565+
pub fn JS_NewCClosure(
4566+
ctx: *mut JSContext,
4567+
func: JSCClosure,
4568+
name: *const ::std::os::raw::c_char,
4569+
opaque_finalize: JSCClosureFinalizerFunc,
4570+
length: ::std::os::raw::c_int,
4571+
magic: ::std::os::raw::c_int,
4572+
opaque: *mut ::std::os::raw::c_void,
4573+
) -> JSValue;
4574+
}
44934575
unsafe extern "C" {
44944576
pub fn JS_SetConstructor(ctx: *mut JSContext, func_obj: JSValue, proto: JSValue);
44954577
}

quickjs-ng/quickjs/.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Don't show changes in generated files when doing git diff
22

33
gen/** -diff
4-
4+
builtin-*.h -diff
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
2+
version: 2
3+
updates:
4+
- package-ecosystem: "github-actions"
5+
directory: "/" # Location of package manifests
6+
schedule:
7+
interval: "weekly"

0 commit comments

Comments
 (0)