Skip to content

Commit aeace87

Browse files
update to quickjsng 0.8.0
1 parent 689af78 commit aeace87

34 files changed

+2109
-1239
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
edition = "2018"
33
name = "hirofa-quickjs-sys"
44
description = "QuickJS, QuickJS-NG Javascript Engine FFI bindings"
5-
version = "0.7.1"
5+
version = "0.8.0"
66
readme = "README.md"
77
repository = "https://github.com/HiRoFa/quickjs-sys"
88
license = "MIT"

quickjs-ng/bindings.rs

+38-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
/* automatically generated by rust-bindgen 0.69.4 */
22

3-
4-
53
pub const _STDIO_H: u32 = 1;
64
pub const _FEATURES_H: u32 = 1;
75
pub const _DEFAULT_SOURCE: u32 = 1;
@@ -195,7 +193,7 @@ pub const JS_PROP_NO_ADD: u32 = 65536;
195193
pub const JS_PROP_NO_EXOTIC: u32 = 131072;
196194
pub const JS_PROP_DEFINE_PROPERTY: u32 = 262144;
197195
pub const JS_PROP_REFLECT_DEFINE_PROPERTY: u32 = 524288;
198-
pub const JS_DEFAULT_STACK_SIZE: u32 = 262144;
196+
pub const JS_DEFAULT_STACK_SIZE: u32 = 1048576;
199197
pub const JS_EVAL_TYPE_GLOBAL: u32 = 0;
200198
pub const JS_EVAL_TYPE_MODULE: u32 = 1;
201199
pub const JS_EVAL_TYPE_DIRECT: u32 = 2;
@@ -235,7 +233,7 @@ pub const JS_DEF_PROP_UNDEFINED: u32 = 7;
235233
pub const JS_DEF_OBJECT: u32 = 8;
236234
pub const JS_DEF_ALIAS: u32 = 9;
237235
pub const QJS_VERSION_MAJOR: u32 = 0;
238-
pub const QJS_VERSION_MINOR: u32 = 7;
236+
pub const QJS_VERSION_MINOR: u32 = 8;
239237
pub const QJS_VERSION_PATCH: u32 = 0;
240238
pub const QJS_VERSION_SUFFIX: &[u8; 1] = b"\0";
241239
pub type __gnuc_va_list = __builtin_va_list;
@@ -4237,6 +4235,9 @@ extern "C" {
42374235
extern "C" {
42384236
pub fn JS_IsError(ctx: *mut JSContext, val: JSValue) -> ::std::os::raw::c_int;
42394237
}
4238+
extern "C" {
4239+
pub fn JS_IsUncatchableError(ctx: *mut JSContext, val: JSValue) -> ::std::os::raw::c_int;
4240+
}
42404241
extern "C" {
42414242
pub fn JS_ResetUncatchableError(ctx: *mut JSContext);
42424243
}
@@ -4691,6 +4692,27 @@ extern "C" {
46914692
extern "C" {
46924693
pub fn JS_GetUint8Array(ctx: *mut JSContext, psize: *mut usize, obj: JSValue) -> *mut u8;
46934694
}
4695+
pub const JSTypedArrayEnum_JS_TYPED_ARRAY_UINT8C: JSTypedArrayEnum = 0;
4696+
pub const JSTypedArrayEnum_JS_TYPED_ARRAY_INT8: JSTypedArrayEnum = 1;
4697+
pub const JSTypedArrayEnum_JS_TYPED_ARRAY_UINT8: JSTypedArrayEnum = 2;
4698+
pub const JSTypedArrayEnum_JS_TYPED_ARRAY_INT16: JSTypedArrayEnum = 3;
4699+
pub const JSTypedArrayEnum_JS_TYPED_ARRAY_UINT16: JSTypedArrayEnum = 4;
4700+
pub const JSTypedArrayEnum_JS_TYPED_ARRAY_INT32: JSTypedArrayEnum = 5;
4701+
pub const JSTypedArrayEnum_JS_TYPED_ARRAY_UINT32: JSTypedArrayEnum = 6;
4702+
pub const JSTypedArrayEnum_JS_TYPED_ARRAY_BIG_INT64: JSTypedArrayEnum = 7;
4703+
pub const JSTypedArrayEnum_JS_TYPED_ARRAY_BIG_UINT64: JSTypedArrayEnum = 8;
4704+
pub const JSTypedArrayEnum_JS_TYPED_ARRAY_FLOAT16: JSTypedArrayEnum = 9;
4705+
pub const JSTypedArrayEnum_JS_TYPED_ARRAY_FLOAT32: JSTypedArrayEnum = 10;
4706+
pub const JSTypedArrayEnum_JS_TYPED_ARRAY_FLOAT64: JSTypedArrayEnum = 11;
4707+
pub type JSTypedArrayEnum = ::std::os::raw::c_uint;
4708+
extern "C" {
4709+
pub fn JS_NewTypedArray(
4710+
ctx: *mut JSContext,
4711+
argc: ::std::os::raw::c_int,
4712+
argv: *mut JSValue,
4713+
array_type: JSTypedArrayEnum,
4714+
) -> JSValue;
4715+
}
46944716
extern "C" {
46954717
pub fn JS_GetTypedArrayBuffer(
46964718
ctx: *mut JSContext,
@@ -4711,7 +4733,7 @@ extern "C" {
47114733
) -> JSValue;
47124734
}
47134735
extern "C" {
4714-
pub fn JS_IsUint8Array(obj: JSValue) -> ::std::os::raw::c_int;
4736+
pub fn JS_GetTypedArrayType(obj: JSValue) -> ::std::os::raw::c_int;
47154737
}
47164738
extern "C" {
47174739
pub fn JS_NewUint8ArrayCopy(ctx: *mut JSContext, buf: *const u8, len: usize) -> JSValue;
@@ -5254,6 +5276,7 @@ pub union JSCFunctionListEntry__bindgen_ty_1 {
52545276
pub str_: *const ::std::os::raw::c_char,
52555277
pub i32_: i32,
52565278
pub i64_: i64,
5279+
pub u64_: u64,
52575280
pub f64_: f64,
52585281
}
52595282
#[repr(C)]
@@ -5547,6 +5570,16 @@ fn bindgen_test_layout_JSCFunctionListEntry__bindgen_ty_1() {
55475570
stringify!(i64_)
55485571
)
55495572
);
5573+
assert_eq!(
5574+
unsafe { ::std::ptr::addr_of!((*ptr).u64_) as usize - ptr as usize },
5575+
0usize,
5576+
concat!(
5577+
"Offset of field: ",
5578+
stringify!(JSCFunctionListEntry__bindgen_ty_1),
5579+
"::",
5580+
stringify!(u64_)
5581+
)
5582+
);
55505583
assert_eq!(
55515584
unsafe { ::std::ptr::addr_of!((*ptr).f64_) as usize - ptr as usize },
55525585
0usize,

quickjs-ng/quickjs/.github/workflows/ci.yml

+41-30
Original file line numberDiff line numberDiff line change
@@ -160,37 +160,10 @@ jobs:
160160
git submodule update --init --checkout --depth 1
161161
time make test262
162162
163-
linux-gcc48:
164-
runs-on: ubuntu-latest
165-
container:
166-
image: ubuntu:18.04
167-
# Work around an issue where the node from actions/checkout is too new
168-
# to run inside the old container image.
169-
env:
170-
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
171-
steps:
172-
- name: install dependencies
173-
run: |
174-
apt update && apt -y install make gcc-4.8 cmake software-properties-common
175-
# git in default ppa repository is too old to run submodule checkout
176-
add-apt-repository -y ppa:git-core/ppa
177-
apt update && apt install -y git
178-
- name: checkout
179-
uses: actions/checkout@v3
180-
with:
181-
submodules: true
182-
- name: build
183-
env:
184-
CC: gcc-4.8
163+
- name: test standalone
185164
run: |
186-
mkdir build
187-
cd build
188-
cmake ..
189-
cd ..
190-
make -C build -j$(getconf _NPROCESSORS_ONLN)
191-
- name: stats
192-
run: |
193-
./build/qjs -qd
165+
./build/qjs -c examples/hello.js -o hello
166+
./hello
194167
195168
windows-msvc:
196169
runs-on: windows-latest
@@ -216,6 +189,10 @@ jobs:
216189
build\${{matrix.buildType}}\qjs.exe examples\test_point.js
217190
build\${{matrix.buildType}}\run-test262.exe -c tests.conf
218191
build\${{matrix.buildType}}\function_source.exe
192+
- name: test standalone
193+
run: |
194+
build\${{matrix.buildType}}\qjs.exe -c examples\hello.js -o hello.exe
195+
.\hello.exe
219196
- name: Set up Visual Studio shell
220197
uses: egor-tensin/vs-shell@v2
221198
with:
@@ -308,6 +285,36 @@ jobs:
308285
build\run-test262.exe -c tests.conf
309286
build\function_source.exe
310287
288+
windows-sdk:
289+
runs-on: windows-latest
290+
strategy:
291+
fail-fast: false
292+
matrix:
293+
arch: [x64, Win32]
294+
buildType: [Debug, Release]
295+
steps:
296+
- uses: actions/checkout@v4
297+
- name: Install windows sdk
298+
uses: ChristopheLav/windows-sdk-install@v1
299+
with:
300+
version-sdk: 26100
301+
features: 'OptionId.DesktopCPPx86,OptionId.DesktopCPPx64'
302+
- name: build
303+
run: |
304+
cmake -B build -DBUILD_EXAMPLES=ON -DCMAKE_SYSTEM_VERSION="10.0.26100.0" -A ${{matrix.arch}}
305+
cmake --build build --config ${{matrix.buildType}}
306+
- name: stats
307+
run: |
308+
build\${{matrix.buildType}}\qjs.exe -qd
309+
- name: test
310+
run: |
311+
cp build\${{matrix.buildType}}\fib.dll examples\
312+
cp build\${{matrix.buildType}}\point.dll examples\
313+
build\${{matrix.buildType}}\qjs.exe examples\test_fib.js
314+
build\${{matrix.buildType}}\qjs.exe examples\test_point.js
315+
build\${{matrix.buildType}}\run-test262.exe -c tests.conf
316+
build\${{matrix.buildType}}\function_source.exe
317+
311318
windows-mingw:
312319
runs-on: windows-latest
313320
strategy:
@@ -353,6 +360,10 @@ jobs:
353360
- name: test
354361
run: |
355362
make test
363+
- name: test standalone
364+
run: |
365+
./build/qjs -c examples/hello.js -o hello.exe
366+
./hello
356367
windows-mingw-shared:
357368
runs-on: windows-latest
358369
defaults:

0 commit comments

Comments
 (0)