compat.quickjs-ng
#includeQuickJS-ng, a small embeddable JavaScript engine (engine only, without quickjs-libc)
#include <quickjs.h>
mcpp add compat.quickjs-ng@0.17.0
Usage
From this repository's own test project — built and run by CI, not written for the website.
// Behavioral test: JavaScript evaluated by the engine, checked by value.
//
// The package compiles four sources, and each group below needs one of them to
// be present and built with the right flags, so a missing or mis-built TU shows
// up as a wrong answer rather than only as a link error:
//
// quickjs.c evaluation, closures, exceptions, the promise job queue
// dtoa.c shortest round-trip number formatting (0.1 + 0.2, 5e-324)
// libregexp.c named groups, case-insensitive and sticky matching
// libunicode.c full case mapping, NFC normalization, script properties
//
// The expected strings are what the ECMAScript specification requires, written
// out by hand; none is computed by the code under test.
//
// The runtime is freed at the end. The package does not define NDEBUG, so
// JS_FreeRuntime asserts that no object is still alive (quickjs.c:2699) and an
// object this test forgot to free aborts it.
#ifdef __linux__
#include <quickjs.h>
// …
tests/examples/quickjs-ng/tests/engine.cpp · project tests/examples/quickjs-ng
Build
- targets
quickjs-ng (lib)- language
c++23- C standard
c11- import std
- no
- include dirs
quickjs-0.17.0/mcpp/include
Sources (4)
*/dtoa.c*/libregexp.c*/libunicode.c*/quickjs.c
Generated files
quickjs-0.17.0/mcpp/include/quickjs.h
Versions
| Version | Platforms | Mirrors | sha256 |
|---|---|---|---|
0.17.0 latest |
Linux | source | 559bc4c42047… |