File: readme.txt
The main documentation is in doc/quickjs.pdf or doc/quickjs.html.
File: readme-cosmo.txt
The executables included in this archive run on Linux, Mac, Windows,
FreeBSD, OpenBSD and NetBSD for both the ARM64 and x86_64
architectures.
Platform Notes:
- if you get errors on Linux, you should disable the binfmt_misc
module which automatically invokes wine with Windows executable:
sudo sh -c 'echo -1 > /proc/sys/fs/binfmt_misc/cli' # remove Ubuntu's MZ interpreter
sudo sh -c 'echo -1 > /proc/sys/fs/binfmt_misc/status' # remove ALL binfmt_misc entries
Under Windows, you can rename the executables with a .exe extension.
Use the --assimilate option to build a platform specific binary for
better startup time:./qjs --assimilate
See https://github.com/jart/cosmopolitan for more information about
platform specific issues.
File: test262_errors.txt
test262/test/language/statements/await-using/initializer-Symbol.asyncDispose-disposed-at-end-of-imported-module.js:11: SyntaxError: exported variable 'resource' does not exist
test262/test/language/statements/await-using/initializer-Symbol.dispose-disposed-at-end-of-imported-module.js:11: SyntaxError: exported variable 'resource' does not exist
test262/test/language/statements/using/initializer-disposed-at-end-of-imported-module.js:11: SyntaxError: exported variable 'resource' does not exist
test262/test/staging/sm/Function/arguments-parameter-shadowing.js:14: Test262Error: Expected SameValue(«true», «false») to be true
test262/test/staging/sm/Function/constructor-binding.js:11: Test262Error: Expected SameValue(«"function"», «"undefined"») to be true
test262/test/staging/sm/Function/function-bind.js:24: Test262Error: Conforms to NativeFunction Syntax: "function bound unbound() {\n [native code]\n}"
test262/test/staging/sm/Function/implicit-this-in-parameter-expression.js:12: Test262Error: Expected SameValue(«[object Object]», «undefined») to be true
test262/test/staging/sm/Function/invalid-parameter-list.js:13: Test262Error: Expected a SyntaxError to be thrown but no exception was thrown at all
test262/test/staging/sm/String/internalUsage.js:16: Test262Error: Expected SameValue(«false», «true») to be true
test262/test/staging/sm/class/strictExecution.js:13: Test262Error: Expected a TypeError to be thrown but no exception was thrown at all
test262/test/staging/sm/class/superPropOrdering.js:17: Test262Error: Expected a TypeError to be thrown but no exception was thrown at all
test262/test/staging/sm/lexical-environment/block-scoped-functions-annex-b-arguments.js:13: Test262Error: Expected SameValue(«"object"», «"function"») to be true
test262/test/staging/sm/lexical-environment/block-scoped-functions-annex-b-eval.js:11: Test262Error: Expected SameValue(«"outer-gouter-geval-gtruefalseq"», «"outer-geval-gwith-gtruefalseq"») to be true
test262/test/staging/sm/lexical-environment/block-scoped-functions-annex-b-if.js:19: TypeError: not a function
test262/test/staging/sm/lexical-environment/block-scoped-functions-annex-b-notapplicable.js:14: Test262Error: Expected SameValue(«function x() {2}», «function x() {1}») to be true
test262/test/staging/sm/lexical-environment/block-scoped-functions-deprecated-redecl.js:23: Test262Error: Expected SameValue(«3», «4») to be true
test262/test/staging/sm/lexical-environment/var-in-catch-body-annex-b-eval.js:16: Test262Error: Expected SameValue(«"g"», «"global-x"») to be true
test262/test/staging/sm/regress/regress-602621.js:13: Test262Error: function sub-statement must override arguments Expected SameValue(«"function"», «"object"») to be true
test262/test/staging/sm/statements/arrow-function-in-for-statement-head.js:13: Test262Error: Expected a SyntaxError to be thrown but no exception was thrown at all
File: test262o_errors.txt
[Empty file]
File: examples/message.json
{ "x" : 1, "tab": [ 1, 2, 3 ] }
File: .github/workflows/ci.yml
name: ci
on:
pull_request:
paths:
- ''
- '!.gitignore'
- '!LICENSE'
- '!TODO'
- '!doc/'
- '!examples/**'
- '.github/workflows/ci.yml'
push:
branches:
- '*'
jobs:
linux:
name: Linux (Ubuntu)
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v7
with:
submodules: true
- name: Build
run: |
make -j$(getconf _NPROCESSORS_ONLN) CONFIG_WERROR=y
- name: Stats
run: |
./qjs -qd
- name: Run built-in tests
run: |
make test
- name: Run microbench
run: |
make microbench
- name: Run test262
run: |
make test2-bootstrap
make test2
linux-lto:
name: Linux LTO
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v7
with:
submodules: true
- name: Build
run: |
make -j$(getconf _NPROCESSORS_ONLN) CONFIG_WERROR=y CONFIG_LTO=y
- name: Run built-in tests
run: |
make test
- name: Run microbench
run: |
make microbench
linux-32bit:
name: Linux 32bit
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v7
with:
submodules: true
- name: Install gcc-multilib
run: |
sudo apt update
sudo apt install -y gcc-multilib
- name: Build
run: |
make -j$(getconf _NPROCESSORS_ONLN) CONFIG_WERROR=y CONFIG_M32=y
- name: Run built-in tests
run: |
make CONFIG_M32=y test
linux-asan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
submodules: true
- name: Build
run: |
make -j$(getconf _NPROCESSORS_ONLN) CONFIG_WERROR=y CONFIG_ASAN=y
- name: Run built-in tests
env:
ASAN_OPTIONS: halt_on_error=1
run: |
make CONFIG_ASAN=y test
linux-msan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
submodules: true
- name: Build
env:
CC: clang
run: |
make -j$(getconf _NPROCESSORS_ONLN) CONFIG_WERROR=y CONFIG_MSAN=y CONFIG_CLANG=y
- name: Run built-in tests
env:
MSAN_OPTIONS: halt_on_error=1
run: |
make CONFIG_MSAN=y CONFIG_CLANG=y test
linux-ubsan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
submodules: true
- name: Build
run: |
make -j$(getconf _NPROCESSORS_ONLN) CONFIG_WERROR=y CONFIG_UBSAN=y
- name: Run built-in tests
env:
UBSAN_OPTIONS: halt_on_error=1
run: |
make CONFIG_UBSAN=y test
macos:
name: macOS
runs-on: macos-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v7
- name: Build
run: |
make -j$(getconf _NPROCESSORS_ONLN) CONFIG_WERROR=y
- name: Stats
run: |
./qjs -qd
- name: Run built-in tests
run: |
make test
- name: Run test262
run: |
make test2-bootstrap
make test2
macos-asan:
runs-on: macos-latest
steps:
- uses: actions/checkout@v7
- name: Build
run: |
make -j$(getconf _NPROCESSORS_ONLN) CONFIG_WERROR=y CONFIG_ASAN=y
- name: Run built-in tests
env:
ASAN_OPTIONS: halt_on_error=1
run: |
make CONFIG_ASAN=y test
macos-ubsan:
runs-on: macos-latest
steps:
- uses: actions/checkout@v7
- name: Build
run: |
make -j$(getconf _NPROCESSORS_ONLN) CONFIG_WERROR=y CONFIG_UBSAN=y
- name: Run built-in tests
env:
UBSAN_OPTIONS: halt_on_error=1
run: |
make CONFIG_UBSAN=y test
freebsd:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Build + test
uses: vmactions/freebsd-vm@v1
with:
usesh: true
copyback: false
mem: 16384
prepare: |
pkg install -y gmake
run: |
gmake
./qjs -qd
gmake test
cosmopolitan:
name: Cosmopolitan
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v7
with:
submodules: true
- name: Install Cosmopolitan
# https://cosmo.zip/pub/cosmocc/cosmocc.zip is no longer available
# get the release from github
env:
COSMOCC_VERSION: 4.0.2
run: |
mkdir ~/cosmocc
cd ~/cosmocc
wget https://github.com/jart/cosmopolitan/releases/download/$COSMOCC_VERSION/cosmocc-$COSMOCC_VERSION.zip
unzip -q cosmocc-$COSMOCC_VERSION.zip
echo "$HOME/cosmocc/bin" >> "$GITHUB_PATH"
- name: Build
run: |
make CONFIG_COSMO=y
- name: Run built-in tests
run: |
make CONFIG_COSMO=y test
- name: Run test262
run: |
make test2-bootstrap
make CONFIG_COSMO=y test2
mingw-windows:
name: MinGW Windows target
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v7
with:
submodules: true
- name: Install MinGW and Wine
run: |
sudo apt update
sudo apt install -y wine mingw-w64
cp /usr/x86_64-w64-mingw32/lib/libwinpthread-1.dll .
- name: Setup Wine
run: |
wine --version
winecfg /v
# binfmt doesn't work in GitHub Actions
#sudo apt install -y binfmt-support wine-binfmt
#echo ":Wine:M::MZ::/usr/bin/wine:" > /etc/binfmt.d/wine.conf
#sudo systemctl restart systemd-binfmt
- name: Build
run: |
make CONFIG_WIN32=y
- name: Run built-in tests
run: |
# If binfmt support worked, could just run make CONFIG_WIN32=y test
make WINE=/usr/bin/wine CONFIG_WIN32=y test
windows-msys:
name: Windows MSYS2
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v7
- uses: msys2/setup-msys2@v2
with:
msystem: UCRT64
update: true
install: git make mingw-w64-ucrt-x86_64-gcc mingw-w64-ucrt-x86_64-dlfcn
- name: Build
run: |
make -j$(getconf _NPROCESSORS_ONLN) CONFIG_WERROR=y
- name: Stats
run: |
./qjs -qd
- name: Run built-in tests
run: |
make test
- name: Run microbench
run: |
make microbench
qemu-alpine:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
platform:
- linux/386
- linux/riscv64
- linux/arm64
- linux/s390x
- linux/ppc64le
steps:
- uses: actions/checkout@v7
with:
submodules: recursive
- name: Get qemu
# See https://github.com/tonistiigi/binfmt/issues/215#issuecomment-2613004741
run: docker run --privileged --rm tonistiigi/binfmt:master --install all
- name: Run tests on ${{ matrix.platform }}
run: docker run --rm --interactive --mount type=bind,source=$(pwd),target=/host --platform ${{ matrix.platform }} alpine sh -c "apk add git patch make gcc libc-dev && cd /host && make test"qemu-alpine without temporal and intl because the C compiler does
not support int128
qemu-alpine2:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
platform:
- linux/arm/v6
- linux/arm/v7
steps:
- uses: actions/checkout@v7
with:
submodules: recursive
- name: Get qemu
# See https://github.com/tonistiigi/binfmt/issues/215#issuecomment-2613004741
run: docker run --privileged --rm tonistiigi/binfmt:master --install all
- name: Run tests on ${{ matrix.platform }}
run: docker run --rm --interactive --mount type=bind,source=$(pwd),target=/host --platform ${{ matrix.platform }} alpine sh -c "apk add git patch make gcc libc-dev && cd /host && make CONFIG_TEMPORAL_INTL= test"