├── .clang-format ├── .github └── workflows │ └── main.yml ├── .gitignore ├── .gitmodules ├── ADOPTERS.md ├── AUTHORS.md ├── CMakeLists.txt ├── CODE_OF_CONDUCT.md ├── LICENSE ├── README.md ├── builtins ├── install_builtins.cpp └── web │ ├── base64.cpp │ ├── base64.h │ ├── blob.cpp │ ├── blob.h │ ├── console.cpp │ ├── console.h │ ├── crypto │ ├── crypto-algorithm.cpp │ ├── crypto-algorithm.h │ ├── crypto-key-ec-components.cpp │ ├── crypto-key-ec-components.h │ ├── crypto-key-rsa-components.cpp │ ├── crypto-key-rsa-components.h │ ├── crypto-key.cpp │ ├── crypto-key.h │ ├── crypto.cpp │ ├── crypto.h │ ├── json-web-key.cpp │ ├── json-web-key.h │ ├── subtle-crypto.cpp │ ├── subtle-crypto.h │ ├── uuid.cpp │ └── uuid.h │ ├── dom-exception.cpp │ ├── dom-exception.h │ ├── fetch │ ├── fetch-api.cpp │ ├── fetch-api.h │ ├── fetch-errors.h │ ├── fetch-utils.cpp │ ├── fetch-utils.h │ ├── fetch_event.cpp │ ├── fetch_event.h │ ├── headers.cpp │ ├── headers.h │ ├── request-response.cpp │ └── request-response.h │ ├── file.cpp │ ├── file.h │ ├── form-data │ ├── form-data-encoder.cpp │ ├── form-data-encoder.h │ ├── form-data-parser.cpp │ ├── form-data-parser.h │ ├── form-data.cpp │ └── form-data.h │ ├── global_self.cpp │ ├── global_self.h │ ├── performance.cpp │ ├── performance.h │ ├── queue-microtask.cpp │ ├── queue-microtask.h │ ├── streams │ ├── buf-reader.cpp │ ├── buf-reader.h │ ├── compression-stream.cpp │ ├── compression-stream.h │ ├── decompression-stream.cpp │ ├── decompression-stream.h │ ├── native-stream-sink.cpp │ ├── native-stream-sink.h │ ├── native-stream-source.cpp │ ├── native-stream-source.h │ ├── stream-errors.h │ ├── streams.cpp │ ├── streams.h │ ├── transform-stream-default-controller.cpp │ ├── transform-stream-default-controller.h │ ├── transform-stream.cpp │ └── transform-stream.h │ ├── structured-clone.cpp │ ├── structured-clone.h │ ├── text-codec │ ├── text-codec-errors.h │ ├── text-codec.cpp │ ├── text-codec.h │ ├── text-decoder.cpp │ ├── text-decoder.h │ ├── text-encoder.cpp │ └── text-encoder.h │ ├── timers.cpp │ ├── timers.h │ ├── url.cpp │ ├── url.h │ ├── worker-location.cpp │ └── worker-location.h ├── clang-format.ignore ├── cmake ├── CPM.cmake ├── add_as_subproject.cmake ├── add_builtin.cmake ├── binaryen.cmake ├── build-crates.cmake ├── builtins.cmake ├── compile-flags.cmake ├── fmt.cmake ├── init-corrosion.cmake ├── openssl.cmake ├── spidermonkey.cmake ├── toolchain.cmake ├── wasi-sdk.cmake ├── wasm-tools.cmake ├── wasmtime.cmake ├── weval.cmake └── wizer.cmake ├── componentize.sh.in ├── crates ├── rust-encoding │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── rust-hooks │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ └── wrappers.cpp ├── rust-multipart │ ├── .gitignore │ ├── Cargo.toml │ ├── cbindgen.toml │ ├── fuzz │ │ ├── .gitignore │ │ ├── Cargo.toml │ │ ├── corpus │ │ │ └── fuzz_multipart │ │ │ │ ├── multi.seed │ │ │ │ └── simple.seed │ │ └── fuzz_targets │ │ │ └── fuzz_multipart.rs │ ├── rust-multipart-ffi.h │ ├── src │ │ ├── capi.rs │ │ ├── error.rs │ │ ├── lib.rs │ │ ├── parser.rs │ │ └── trivia.rs │ └── tests │ │ └── integration.rs └── rust-url │ ├── .gitignore │ ├── Cargo.lock │ ├── Cargo.toml │ ├── cbindgen.toml │ ├── rust-url.h │ └── src │ └── lib.rs ├── deps ├── include │ ├── picosha2.h │ ├── rust-encoding.h │ └── wizer.h ├── patches │ ├── getuid.patch │ └── rand.patch └── wpt-hosts ├── host-apis ├── wasi-0.2.0 │ ├── bindings │ │ ├── bindings.c │ │ ├── bindings.h │ │ └── bindings_component_type.o │ ├── handles.h │ ├── host_api.cmake │ ├── host_api.cpp │ ├── host_call.cpp │ ├── include │ │ └── exports.h │ ├── preview1-adapter-debug │ │ └── wasi_snapshot_preview1.wasm │ ├── preview1-adapter-release │ │ └── wasi_snapshot_preview1.wasm │ └── wit │ │ ├── command-extended.wit │ │ ├── deps │ │ ├── cli │ │ │ ├── command.wit │ │ │ ├── environment.wit │ │ │ ├── exit.wit │ │ │ ├── imports.wit │ │ │ ├── run.wit │ │ │ ├── stdio.wit │ │ │ └── terminal.wit │ │ ├── clocks │ │ │ ├── monotonic-clock.wit │ │ │ ├── wall-clock.wit │ │ │ └── world.wit │ │ ├── filesystem │ │ │ ├── preopens.wit │ │ │ ├── types.wit │ │ │ └── world.wit │ │ ├── http │ │ │ ├── handler.wit │ │ │ ├── proxy.wit │ │ │ └── types.wit │ │ ├── io │ │ │ ├── error.wit │ │ │ ├── poll.wit │ │ │ ├── streams.wit │ │ │ └── world.wit │ │ ├── random │ │ │ ├── insecure-seed.wit │ │ │ ├── insecure.wit │ │ │ ├── random.wit │ │ │ └── world.wit │ │ └── sockets │ │ │ ├── instance-network.wit │ │ │ ├── ip-name-lookup.wit │ │ │ ├── network.wit │ │ │ ├── tcp-create-socket.wit │ │ │ ├── tcp.wit │ │ │ ├── udp-create-socket.wit │ │ │ ├── udp.wit │ │ │ └── world.wit │ │ └── main.wit ├── wasi-0.2.2 │ ├── bindings │ │ ├── bindings.c │ │ ├── bindings.h │ │ └── bindings_component_type.o │ ├── host_api.cmake │ └── wit │ │ ├── command-extended.wit │ │ ├── deps │ │ ├── cli │ │ │ ├── command.wit │ │ │ ├── environment.wit │ │ │ ├── exit.wit │ │ │ ├── imports.wit │ │ │ ├── run.wit │ │ │ ├── stdio.wit │ │ │ └── terminal.wit │ │ ├── clocks │ │ │ ├── monotonic-clock.wit │ │ │ ├── timezone.wit │ │ │ ├── wall-clock.wit │ │ │ └── world.wit │ │ ├── filesystem │ │ │ ├── preopens.wit │ │ │ ├── types.wit │ │ │ └── world.wit │ │ ├── http │ │ │ ├── handler.wit │ │ │ ├── proxy.wit │ │ │ └── types.wit │ │ ├── io │ │ │ ├── error.wit │ │ │ ├── poll.wit │ │ │ ├── streams.wit │ │ │ └── world.wit │ │ ├── random │ │ │ ├── insecure-seed.wit │ │ │ ├── insecure.wit │ │ │ ├── random.wit │ │ │ └── world.wit │ │ └── sockets │ │ │ ├── instance-network.wit │ │ │ ├── ip-name-lookup.wit │ │ │ ├── network.wit │ │ │ ├── tcp-create-socket.wit │ │ │ ├── tcp.wit │ │ │ ├── udp-create-socket.wit │ │ │ ├── udp.wit │ │ │ └── world.wit │ │ └── main.wit └── wasi-0.2.3 │ ├── bindings │ ├── bindings.c │ ├── bindings.h │ └── bindings_component_type.o │ ├── host_api.cmake │ ├── include │ └── sockets.h │ ├── sockets.cpp │ ├── wit │ ├── command-extended.wit │ ├── deps │ │ ├── wasi-cli-0.2.3 │ │ │ └── package.wit │ │ ├── wasi-clocks-0.2.3 │ │ │ └── package.wit │ │ ├── wasi-filesystem-0.2.3 │ │ │ └── package.wit │ │ ├── wasi-http-0.2.3 │ │ │ └── package.wit │ │ ├── wasi-io-0.2.3 │ │ │ └── package.wit │ │ ├── wasi-random-0.2.3 │ │ │ └── package.wit │ │ └── wasi-sockets-0.2.3 │ │ │ └── package.wit │ └── main.wit │ └── wkg.lock ├── include ├── builtin.h ├── config-parser.h ├── errors.h ├── extension-api.h └── host_api.h ├── justfile ├── runtime ├── allocator.cpp ├── allocator.h ├── builtin.cpp ├── crates │ └── staticlib-template │ │ ├── Cargo.lock │ │ ├── Cargo.toml.in │ │ └── rust-staticlib.rs.in ├── debugger.cpp ├── debugger.h ├── decode.cpp ├── decode.h ├── encode.cpp ├── encode.h ├── engine.cpp ├── event_loop.cpp ├── event_loop.h ├── js.cpp ├── script_loader.cpp ├── script_loader.h └── sequence.hpp ├── rust-toolchain.toml ├── scripts ├── clang-format.sh ├── cxx-wrapper.in └── wasm-opt └── tests ├── assert.js ├── e2e ├── blob │ ├── blob.js │ └── expect_serve_stdout.txt ├── eventloop-stall │ ├── eventloop-stall.js │ └── expect_serve_stderr.txt ├── headers │ ├── expect_serve_body.txt │ ├── expect_serve_headers.txt │ ├── expect_serve_stderr.txt │ └── headers.js ├── init-script │ ├── expect_serve_stdout.txt │ ├── init-script.js │ └── init.js ├── multi-stream-forwarding │ ├── expect_serve_body.txt │ └── multi-stream-forwarding.js ├── runtime-err │ ├── expect_serve_status.txt │ ├── expect_serve_stderr.txt │ └── runtime-err.js ├── smoke │ ├── expect_serve_body.txt │ ├── expect_serve_stdout.txt │ ├── nested-smoke-dependency.js │ ├── smoke-dependency.js │ └── smoke.js ├── stream-forwarding │ ├── expect_serve_body.txt │ └── stream-forwarding.js ├── syntax-err │ ├── expect_wizer_fail │ ├── expect_wizer_stderr.txt │ └── syntax-err.js ├── teed-stream-as-outgoing-body │ ├── expect_serve_body.txt │ ├── expect_serve_stdout.txt │ └── teed-stream-as-outgoing-body.js ├── tla-err │ ├── expect_wizer_fail │ ├── expect_wizer_stderr.txt │ └── tla-err.js ├── tla-runtime-resolve │ ├── expect_serve_body.txt │ ├── expect_serve_stdout.txt │ └── tla-runtime-resolve.js └── tla │ ├── expect_serve_body.txt │ └── tla.js ├── integration ├── blob │ └── blob.js ├── btoa │ └── btoa.js ├── crypto │ └── crypto.js ├── fetch │ └── fetch.js ├── handlers.js ├── performance │ └── performance.js ├── test-server.js └── timers │ └── timers.js ├── test.sh ├── tests.cmake └── wpt-harness ├── build-wpt-runtime.sh ├── expectations ├── FileAPI │ ├── blob │ │ ├── Blob-array-buffer.any.js.json │ │ ├── Blob-bytes.any.js.json │ │ ├── Blob-constructor-dom.window.js.json │ │ ├── Blob-constructor.any.js.json │ │ ├── Blob-slice-overflow.any.js.json │ │ ├── Blob-slice.any.js.json │ │ ├── Blob-stream.any.js.json │ │ └── Blob-text.any.js.json │ └── file │ │ ├── File-constructor.any.js.json │ │ ├── send-file-formdata-controls.any.js.json │ │ ├── send-file-formdata-punctuation.any.js.json │ │ ├── send-file-formdata-utf-8.any.js.json │ │ └── send-file-formdata.any.js.json ├── WebCryptoAPI │ ├── digest │ │ └── digest.https.any.js.json │ ├── getRandomValues.any.js.json │ ├── idlharness.https.any.js.json │ ├── import_export │ │ └── ec_importKey.https.any.js.json │ ├── randomUUID.https.any.js.json │ └── sign_verify │ │ ├── ecdsa.https.any.js.json │ │ └── hmac.https.any.js.json ├── compression │ ├── compression-bad-chunks.tentative.any.js.json │ ├── compression-constructor-error.tentative.any.js.json │ ├── compression-including-empty-chunk.tentative.any.js.json │ ├── compression-large-flush-output.any.js.json │ ├── compression-multiple-chunks.tentative.any.js.json │ ├── compression-output-length.tentative.any.js.json │ ├── compression-stream.tentative.any.js.json │ ├── compression-with-detach.tentative.window.js.json │ ├── decompression-bad-chunks.tentative.any.js.json │ ├── decompression-buffersource.tentative.any.js.json │ ├── decompression-constructor-error.tentative.any.js.json │ ├── decompression-correct-input.tentative.any.js.json │ ├── decompression-corrupt-input.tentative.any.js.json │ ├── decompression-empty-input.tentative.any.js.json │ ├── decompression-split-chunk.tentative.any.js.json │ ├── decompression-uint8array-output.tentative.any.js.json │ ├── decompression-with-detach.tentative.window.js.json │ └── idlharness.https.any.js.json ├── console │ ├── console-is-a-namespace.any.js.json │ ├── console-label-conversion.any.js.json │ ├── console-log-symbol.any.js.json │ ├── console-namespace-object-class-string.any.js.json │ ├── console-tests-historical.any.js.json │ └── idlharness.any.js.json ├── encoding │ ├── api-basics.any.js.json │ ├── api-invalid-label.any.js.json │ ├── api-replacement-encodings.any.js.json │ ├── api-surrogates-utf8.any.js.json │ ├── encodeInto.any.js.json │ ├── idlharness.any.js.json │ ├── iso-2022-jp-decoder.any.js.json │ ├── replacement-encodings.any.js.json │ ├── textdecoder-arguments.any.js.json │ ├── textdecoder-byte-order-marks.any.js.json │ ├── textdecoder-copy.any.js.json │ ├── textdecoder-eof.any.js.json │ ├── textdecoder-fatal-single-byte.any.js.json │ ├── textdecoder-fatal-streaming.any.js.json │ ├── textdecoder-fatal.any.js.json │ ├── textdecoder-ignorebom.any.js.json │ ├── textdecoder-labels.any.js.json │ ├── textdecoder-streaming.any.js.json │ ├── textdecoder-utf16-surrogates.any.js.json │ ├── textencoder-constructor-non-utf.any.js.json │ ├── textencoder-utf16-surrogates.any.js.json │ └── unsupported-encodings.any.js.json ├── fetch │ ├── api │ │ ├── abort │ │ │ ├── general.any.js.json │ │ │ └── request.any.js.json │ │ ├── basic │ │ │ ├── accept-header.any.js.json │ │ │ ├── conditional-get.any.js.json │ │ │ ├── header-value-combining.any.js.json │ │ │ ├── header-value-null-byte.any.js.json │ │ │ ├── historical.any.js.json │ │ │ ├── http-response-code.any.js.json │ │ │ ├── integrity.sub.any.js.json │ │ │ ├── keepalive.any.js.json │ │ │ ├── mode-same-origin.any.js.json │ │ │ ├── referrer.any.js.json │ │ │ ├── request-forbidden-headers.any.js.json │ │ │ ├── request-head.any.js.json │ │ │ ├── request-headers-case.any.js.json │ │ │ ├── request-headers-nonascii.any.js.json │ │ │ ├── request-headers.any.js.json │ │ │ ├── request-referrer.any.js.json │ │ │ ├── request-upload.any.js.json │ │ │ ├── response-null-body.any.js.json │ │ │ ├── response-url.sub.any.js.json │ │ │ ├── scheme-about.any.js.json │ │ │ ├── scheme-blob.sub.any.js.json │ │ │ ├── scheme-data.any.js.json │ │ │ ├── scheme-others.sub.any.js.json │ │ │ ├── status.h2.any.js.json │ │ │ ├── stream-response.any.js.json │ │ │ ├── stream-safe-creation.any.js.json │ │ │ └── text-utf8.any.js.json │ │ ├── body │ │ │ ├── cloned-any.js.json │ │ │ └── formdata.any.js.json │ │ ├── headers │ │ │ ├── header-setcookie.any.js.json │ │ │ ├── header-values-normalize.any.js.json │ │ │ ├── header-values.any.js.json │ │ │ ├── headers-basic.any.js.json │ │ │ ├── headers-casing.any.js.json │ │ │ ├── headers-combine.any.js.json │ │ │ ├── headers-errors.any.js.json │ │ │ ├── headers-no-cors.any.js.json │ │ │ ├── headers-normalize.any.js.json │ │ │ ├── headers-record.any.js.json │ │ │ └── headers-structure.any.js.json │ │ ├── redirect │ │ │ ├── redirect-back-to-original-origin.any.js.json │ │ │ ├── redirect-count.any.js.json │ │ │ ├── redirect-empty-location.any.js.json │ │ │ ├── redirect-keepalive.any.js.json │ │ │ ├── redirect-keepalive.https.any.js.json │ │ │ ├── redirect-location-escape.tentative.any.js.json │ │ │ ├── redirect-location.any.js.json │ │ │ ├── redirect-method.any.js.json │ │ │ ├── redirect-mode.any.js.json │ │ │ ├── redirect-origin.any.js.json │ │ │ ├── redirect-referrer-override.any.js.json │ │ │ ├── redirect-referrer.any.js.json │ │ │ ├── redirect-schemes.any.js.json │ │ │ ├── redirect-to-dataurl.any.js.json │ │ │ └── redirect-upload.h2.any.js.json │ │ ├── request │ │ │ ├── forbidden-method.any.js.json │ │ │ ├── request-bad-port.any.js.json │ │ │ ├── request-cache-default-conditional.any.js.json │ │ │ ├── request-cache-default.any.js.json │ │ │ ├── request-cache-force-cache.any.js.json │ │ │ ├── request-cache-no-cache.any.js.json │ │ │ ├── request-cache-no-store.any.js.json │ │ │ ├── request-cache-only-if-cached.any.js.json │ │ │ ├── request-cache-reload.any.js.json │ │ │ ├── request-constructor-init-body-override.any.js.json │ │ │ ├── request-consume-empty.any.js.json │ │ │ ├── request-consume.any.js.json │ │ │ ├── request-disturbed.any.js.json │ │ │ ├── request-error.any.js.json │ │ │ ├── request-headers.any.js.json │ │ │ ├── request-init-002.any.js.json │ │ │ ├── request-init-contenttype.any.js.json │ │ │ ├── request-init-priority.any.js.json │ │ │ ├── request-init-stream.any.js.json │ │ │ ├── request-keepalive.any.js.json │ │ │ └── request-structure.any.js.json │ │ └── response │ │ │ ├── json.any.js.json │ │ │ ├── response-blob-realm.any.js.json │ │ │ ├── response-cancel-stream.any.js.json │ │ │ ├── response-consume-empty.any.js.json │ │ │ ├── response-consume-stream.any.js.json │ │ │ ├── response-error-from-stream.any.js.json │ │ │ ├── response-error.any.js.json │ │ │ ├── response-from-stream.any.js.json │ │ │ ├── response-headers-guard.any.js.json │ │ │ ├── response-init-001.any.js.json │ │ │ ├── response-init-002.any.js.json │ │ │ ├── response-init-contenttype.any.js.json │ │ │ ├── response-static-error.any.js.json │ │ │ ├── response-static-json.any.js.json │ │ │ ├── response-static-redirect.any.js.json │ │ │ ├── response-stream-bad-chunk.any.js.json │ │ │ ├── response-stream-disturbed-1.any.js.json │ │ │ ├── response-stream-disturbed-2.any.js.json │ │ │ ├── response-stream-disturbed-3.any.js.json │ │ │ ├── response-stream-disturbed-4.any.js.json │ │ │ ├── response-stream-disturbed-5.any.js.json │ │ │ ├── response-stream-disturbed-6.any.js.json │ │ │ ├── response-stream-disturbed-by-pipe.any.js.json │ │ │ └── response-stream-with-broken-then.any.js.json │ ├── content-type │ │ ├── multipart-malformed.any.js.json │ │ └── multipart.window.js.json │ └── data-urls │ │ ├── base64.any.js.json │ │ └── processing.any.js.json ├── hr-time │ ├── basic.any.js.json │ ├── idlharness.any.js.json │ └── monotonic-clock.any.js.json ├── html │ └── webappapis │ │ ├── atob │ │ └── base64.any.js.json │ │ ├── structured-clone │ │ └── structured-clone.any.js.json │ │ └── timers │ │ ├── clearinterval-from-callback.any.js.json │ │ ├── cleartimeout-clearinterval.any.js.json │ │ ├── missing-timeout-setinterval.any.js.json │ │ ├── negative-setinterval.any.js.json │ │ ├── negative-settimeout.any.js.json │ │ ├── type-long-setinterval.any.js.json │ │ └── type-long-settimeout.any.js.json ├── streams │ ├── idlharness.any.js.json │ ├── piping │ │ ├── close-propagation-backward.any.js.json │ │ ├── close-propagation-forward.any.js.json │ │ ├── error-propagation-backward.any.js.json │ │ ├── error-propagation-forward.any.js.json │ │ ├── flow-control.any.js.json │ │ ├── general-addition.any.js.json │ │ ├── general.any.js.json │ │ ├── multiple-propagation.any.js.json │ │ ├── then-interception.any.js.json │ │ ├── throwing-options.any.js.json │ │ └── transform-streams.any.js.json │ ├── queuing-strategies.any.js.json │ ├── readable-byte-streams │ │ ├── bad-buffers-and-views.any.js.json │ │ ├── construct-byob-request.any.js.json │ │ ├── enqueue-with-detached-buffer.any.js.json │ │ ├── general.any.js.json │ │ ├── non-transferable-buffers.any.js.json │ │ ├── read-min.any.js.json │ │ ├── respond-after-enqueue.any.js.json │ │ └── tee.any.js.json │ ├── readable-streams │ │ ├── async-iterator.any.js.json │ │ ├── bad-strategies.any.js.json │ │ ├── bad-underlying-sources.any.js.json │ │ ├── cancel.any.js.json │ │ ├── constructor.any.js.json │ │ ├── count-queuing-strategy-integration.any.js.json │ │ ├── default-reader.any.js.json │ │ ├── floating-point-total-queue-size.any.js.json │ │ ├── from.any.js.json │ │ ├── garbage-collection.any.js.json │ │ ├── general.any.js.json │ │ ├── owning-type-message-port.any.js.json │ │ ├── owning-type-video-frame.any.js.json │ │ ├── owning-type.any.js.json │ │ ├── patched-global.any.js.json │ │ ├── reentrant-strategies.any.js.json │ │ ├── tee.any.js.json │ │ └── templated.any.js.json │ ├── transform-streams │ │ ├── backpressure.any.js.json │ │ ├── cancel.any.js.json │ │ ├── errors.any.js.json │ │ ├── flush.any.js.json │ │ ├── general.any.js.json │ │ ├── lipfuzz.any.js.json │ │ ├── patched-global.any.js.json │ │ ├── properties.any.js.json │ │ ├── reentrant-strategies.any.js.json │ │ ├── strategies.any.js.json │ │ └── terminate.any.js.json │ └── writable-streams │ │ ├── aborting.any.js.json │ │ ├── bad-strategies.any.js.json │ │ ├── bad-underlying-sinks.any.js.json │ │ ├── byte-length-queuing-strategy.any.js.json │ │ ├── close.any.js.json │ │ ├── constructor.any.js.json │ │ ├── count-queuing-strategy.any.js.json │ │ ├── error.any.js.json │ │ ├── floating-point-total-queue-size.any.js.json │ │ ├── general.any.js.json │ │ ├── properties.any.js.json │ │ ├── reentrant-strategy.any.js.json │ │ ├── start.any.js.json │ │ └── write.any.js.json ├── url │ ├── historical.any.js.json │ ├── url-constructor.any.js.json │ ├── url-origin.any.js.json │ ├── url-searchparams.any.js.json │ ├── url-setters-stripping.any.js.json │ ├── url-setters.any.js.json │ ├── url-statics-canparse.any.js.json │ ├── url-statics-parse.any.js.json │ ├── url-tojson.any.js.json │ ├── urlencoded-parser.any.js.json │ ├── urlsearchparams-append.any.js.json │ ├── urlsearchparams-constructor.any.js.json │ ├── urlsearchparams-delete.any.js.json │ ├── urlsearchparams-foreach.any.js.json │ ├── urlsearchparams-get.any.js.json │ ├── urlsearchparams-getall.any.js.json │ ├── urlsearchparams-has.any.js.json │ ├── urlsearchparams-set.any.js.json │ ├── urlsearchparams-size.any.js.json │ ├── urlsearchparams-sort.any.js.json │ └── urlsearchparams-stringifier.any.js.json ├── webidl │ └── ecmascript-binding │ │ └── es-exceptions │ │ ├── DOMException-constants.any.js.json │ │ ├── DOMException-constructor-and-prototype.any.js.json │ │ ├── DOMException-constructor-behavior.any.js.json │ │ └── DOMException-custom-bindings.any.js.json └── xhr │ └── formdata │ ├── append.any.js.json │ ├── constructor.any.js.json │ ├── delete.any.js.json │ ├── foreach.any.js.json │ ├── get.any.js.json │ ├── has.any.js.json │ ├── iteration.any.js.json │ ├── set-blob.any.js.json │ └── set.any.js.json ├── post-harness.js ├── pre-harness.js ├── results-page.template.html ├── results-section-error.template.html ├── results-section.template.html ├── run-wpt.mjs ├── tests.json ├── wpt.cmake └── wpt_builtins.cpp /.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | .DS_Store 5 | 6 | # Editor-based HTTP Client requests 7 | /httpRequests/ 8 | 9 | # CMake/CTest generated files 10 | /cmake-build-*/ 11 | /deps/cpm_cache/ 12 | /Testing/Temporary/CTestCostData.txt 13 | /Testing/Temporary/LastTest.log 14 | 15 | # IDEA project files 16 | /.idea/ 17 | 18 | # VSCode project files 19 | /.vscode/ 20 | 21 | # Spin runtime files 22 | /.spin 23 | 24 | # Rust compilation output 25 | /target 26 | 27 | /tests/e2e/*/*.wasm 28 | /tests/e2e/*/*.log 29 | /tests/integration/*/*.wasm 30 | /tests/integration/*/*.log 31 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bytecodealliance/StarlingMonkey/4051ee1e72b8c9ae49cc78140529fb6198992760/.gitmodules -------------------------------------------------------------------------------- /ADOPTERS.md: -------------------------------------------------------------------------------- 1 | # StarlingMonkey Adopters 2 | 3 | _If you are using StarlingMonkey in production at your organization, please add your company name to this list. 4 | The list is in alphabetical order._ 5 | 6 | | Organization | Contact | Status | Description of Use | 7 | | - | - | - | - | 8 | | [Fastly](https://www.fastly.com) | [@guybedford](https://github.com/guybedford) | ![production](https://img.shields.io/badge/-production-blue?style=flat) | Fastly's [JS SDK](https://github.com/fastly/js-compute-runtime) for Compute at edge is powered by StarlingMonkey. | 9 | | [Fermyon](https://www.fermyon.com/) | [@tschneidereit](https://github.com/tschneidereit) | ![production](https://img.shields.io/badge/-production-blue?style=flat) | [Fermyon Spin](https://www.fermyon.com/spin) supports serverless Wasm apps, using StarlingMonkey for its [Spin JS SDK](https://github.com/fermyon/spin-js-sdk). | 10 | | [Riza](https://riza.io/) | [@kyleconroy](https://github.com/kyleconroy) | ![production](https://img.shields.io/badge/-production-blue?style=flat) | The [Riza Code Interpreter API](https://docs.riza.io) relies on StarlingMonkey for isolated JavaScript execution. | 11 | -------------------------------------------------------------------------------- /AUTHORS.md: -------------------------------------------------------------------------------- 1 | The portions of this code found in the initial commit are Copyright © 2021-2023 Fastly Inc. and contributors to Fastly's [js-compute-runtime project](https://github.com/fastly/js-compute-runtime/). 2 | 3 | Changes following that initial commit are Copyright © the respective contributors. 4 | -------------------------------------------------------------------------------- /builtins/install_builtins.cpp: -------------------------------------------------------------------------------- 1 | #include "extension-api.h" 2 | 3 | #define NS_DEF(ns) \ 4 | namespace ns { \ 5 | extern bool install(api::Engine *engine); \ 6 | } 7 | #include "builtins.incl" 8 | #undef NS_DEF 9 | 10 | bool install_builtins(api::Engine *engine) { 11 | #define NS_DEF(ns) \ 12 | if (!ns::install(engine)) \ 13 | return false; 14 | #include "builtins.incl" 15 | #undef NS_DEF 16 | 17 | return true; 18 | } 19 | -------------------------------------------------------------------------------- /builtins/web/base64.h: -------------------------------------------------------------------------------- 1 | #ifndef BUILTINS_WEB_BASE64_H 2 | #define BUILTINS_WEB_BASE64_H 3 | 4 | #include "extension-api.h" 5 | 6 | namespace builtins { 7 | namespace web { 8 | namespace base64 { 9 | 10 | bool install(api::Engine *engine); 11 | 12 | extern const uint8_t base64DecodeTable[128]; 13 | extern const uint8_t base64URLDecodeTable[128]; 14 | extern const char base64EncodeTable[65]; 15 | extern const char base64URLEncodeTable[65]; 16 | 17 | std::string forgivingBase64Encode(std::string_view data, const char *encodeTable); 18 | JS::Result forgivingBase64Decode(std::string_view data, const uint8_t *decodeTable); 19 | 20 | JS::Result valueToJSByteString(JSContext *cx, HandleValue v); 21 | JS::Result stringToJSByteString(JSContext *cx, std::string v); 22 | 23 | } // namespace base64 24 | } // namespace web 25 | } // namespace builtins 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /builtins/web/console.h: -------------------------------------------------------------------------------- 1 | #ifndef BUILTINS_WEB_CONSOLE_H 2 | #define BUILTINS_WEB_CONSOLE_H 3 | 4 | #include "extension-api.h" 5 | 6 | namespace builtins::web::console { 7 | 8 | class Console : public BuiltinNoConstructor { 9 | private: 10 | public: 11 | static constexpr const char *class_name = "Console"; 12 | enum LogType { 13 | Log, 14 | Info, 15 | Debug, 16 | Warn, 17 | Error, 18 | }; 19 | enum Slots { Count }; 20 | static const JSFunctionSpec methods[]; 21 | static const JSPropertySpec properties[]; 22 | }; 23 | 24 | bool install(api::Engine *engine); 25 | 26 | } // namespace builtins::web::console 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /builtins/web/crypto/crypto-key-ec-components.cpp: -------------------------------------------------------------------------------- 1 | #include "crypto-key-ec-components.h" 2 | 3 | CryptoKeyECComponents::CryptoKeyECComponents(std::string_view x, std::string_view y) 4 | : type(Type::Public), x(x), y(y) {} 5 | 6 | std::unique_ptr CryptoKeyECComponents::createPublic(std::string_view x, 7 | std::string_view y) { 8 | return std::make_unique(x, y); 9 | } 10 | 11 | CryptoKeyECComponents::CryptoKeyECComponents(std::string_view x, std::string_view y, 12 | std::string_view d) 13 | : type(Type::Private), x(x), y(y), d(d) {} 14 | 15 | std::unique_ptr 16 | CryptoKeyECComponents::createPrivate(std::string_view x, std::string_view y, std::string_view d) { 17 | return std::make_unique(x, y, d); 18 | } 19 | -------------------------------------------------------------------------------- /builtins/web/crypto/crypto-key-ec-components.h: -------------------------------------------------------------------------------- 1 | #ifndef BUILTINS_WEB_CRYPTO_CRYPTO_KEY_EC_COMPONENTS_H 2 | #define BUILTINS_WEB_CRYPTO_CRYPTO_KEY_EC_COMPONENTS_H 3 | #include 4 | #include 5 | 6 | class CryptoKeyECComponents final { 7 | public: 8 | enum class Type : uint8_t { Public, Private }; 9 | const Type type; 10 | 11 | // Private and public keys. 12 | const std::string x; 13 | const std::string y; 14 | 15 | // Only private keys. 16 | const std::string d; 17 | static std::unique_ptr createPublic(std::string_view x, 18 | std::string_view y); 19 | 20 | static std::unique_ptr 21 | createPrivate(std::string_view x, std::string_view y, std::string_view d); 22 | 23 | CryptoKeyECComponents(std::string_view x, std::string_view y); 24 | 25 | CryptoKeyECComponents(std::string_view x, std::string_view y, std::string_view d); 26 | }; 27 | #endif -------------------------------------------------------------------------------- /builtins/web/crypto/crypto.h: -------------------------------------------------------------------------------- 1 | #ifndef BUILTINS_WEB_CRYPTO_H 2 | #define BUILTINS_WEB_CRYPTO_H 3 | 4 | #include "builtin.h" 5 | 6 | namespace builtins { 7 | namespace web { 8 | namespace crypto { 9 | 10 | class Crypto : public BuiltinNoConstructor { 11 | private: 12 | public: 13 | static constexpr const char *class_name = "Crypto"; 14 | static const int ctor_length = 0; 15 | 16 | static JS::PersistentRooted subtle; 17 | 18 | enum Slots { Count }; 19 | static const JSFunctionSpec static_methods[]; 20 | static const JSPropertySpec static_properties[]; 21 | static const JSFunctionSpec methods[]; 22 | static const JSPropertySpec properties[]; 23 | 24 | static bool subtle_get(JSContext *cx, unsigned argc, JS::Value *vp); 25 | static bool get_random_values(JSContext *cx, unsigned argc, JS::Value *vp); 26 | static bool random_uuid(JSContext *cx, unsigned argc, JS::Value *vp); 27 | 28 | static bool init_class(JSContext *cx, JS::HandleObject global); 29 | }; 30 | 31 | bool install(api::Engine *engine); 32 | 33 | } // namespace crypto 34 | } // namespace web 35 | } // namespace builtins 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /builtins/web/crypto/subtle-crypto.h: -------------------------------------------------------------------------------- 1 | #ifndef BUILTINS_WEB_CRYPTO_SUBTLE_CRYPTO_H 2 | #define BUILTINS_WEB_CRYPTO_SUBTLE_CRYPTO_H 3 | 4 | #include "builtin.h" 5 | #include "crypto-algorithm.h" 6 | 7 | namespace builtins { 8 | namespace web { 9 | namespace crypto { 10 | 11 | enum class Operations : uint8_t { 12 | Encrypt, 13 | Decrypt, 14 | Sign, 15 | Verify, 16 | Digest, 17 | GenerateKey, 18 | DeriveBits, 19 | ImportKey, 20 | WrapKey, 21 | UnwrapKey, 22 | GetKeyLength 23 | }; 24 | 25 | class SubtleCrypto : public BuiltinNoConstructor { 26 | private: 27 | public: 28 | static constexpr const char *class_name = "SubtleCrypto"; 29 | static const int ctor_length = 0; 30 | 31 | enum Slots { Count }; 32 | static const JSFunctionSpec static_methods[]; 33 | static const JSPropertySpec static_properties[]; 34 | static const JSFunctionSpec methods[]; 35 | static const JSPropertySpec properties[]; 36 | static bool digest(JSContext *cx, unsigned argc, JS::Value *vp); 37 | static bool importKey(JSContext *cx, unsigned argc, JS::Value *vp); 38 | static bool sign(JSContext *cx, unsigned argc, JS::Value *vp); 39 | static bool verify(JSContext *cx, unsigned argc, JS::Value *vp); 40 | 41 | static bool init_class(JSContext *cx, JS::HandleObject global); 42 | }; 43 | 44 | } // namespace crypto 45 | } // namespace web 46 | } // namespace builtins 47 | #endif 48 | -------------------------------------------------------------------------------- /builtins/web/crypto/uuid.h: -------------------------------------------------------------------------------- 1 | #ifndef BUILTINS_WEB_CRYPTO_UUID_H 2 | #define BUILTINS_WEB_CRYPTO_UUID_H 3 | 4 | #include "builtin.h" 5 | 6 | namespace builtins { 7 | namespace web { 8 | namespace crypto { 9 | 10 | // FROM RFC 4122 11 | // The version 4 UUID is meant for generating UUIDs from truly-random or 12 | // pseudo-random numbers. 13 | // 14 | // The algorithm is as follows: 15 | // 16 | // Set the two most significant bits (bits 6 and 7) of the clock_seq_hi_and_reserved to zero and one, 17 | // respectively. 18 | // 19 | // Set the four most significant bits (bits 12 through 15) of the time_hi_and_version field to the 20 | // 4-bit version number from Section 4.1.3. 21 | // 22 | // Set all the other bits to randomly (or pseudo-randomly) chosen values. 23 | std::optional random_uuid_v4(JSContext *cx); 24 | 25 | } // namespace crypto 26 | } // namespace web 27 | } // namespace builtins 28 | 29 | #endif // BUILTINS_WEB_CRYPTO_UUID_H 30 | -------------------------------------------------------------------------------- /builtins/web/dom-exception.h: -------------------------------------------------------------------------------- 1 | #ifndef BUILTINS_WEB_BUILTIN_DOM_EXCEPTION_H 2 | #define BUILTINS_WEB_BUILTIN_DOM_EXCEPTION_H 3 | 4 | #include "builtin.h" 5 | 6 | namespace builtins::web::dom_exception { 7 | 8 | class DOMException : public BuiltinImpl { 9 | private: 10 | public: 11 | static constexpr const char *class_name = "DOMException"; 12 | enum Slots { Name, Message, Code, Count }; 13 | static const JSFunctionSpec static_methods[]; 14 | static const JSPropertySpec static_properties[]; 15 | static const JSFunctionSpec methods[]; 16 | static const JSPropertySpec properties[]; 17 | 18 | static bool code_get(JSContext *cx, unsigned argc, JS::Value *vp); 19 | static bool message_get(JSContext *cx, unsigned argc, JS::Value *vp); 20 | static bool name_get(JSContext *cx, unsigned argc, JS::Value *vp); 21 | 22 | static const unsigned ctor_length = 0; 23 | 24 | static bool init_class(JSContext *cx, JS::HandleObject global); 25 | static bool constructor(JSContext *cx, unsigned argc, JS::Value *vp); 26 | static JSObject *create(JSContext *cx, std::string_view message, std::string_view name); 27 | static bool raise(JSContext *cx, std::string_view message, std::string_view name); 28 | }; 29 | 30 | bool install(api::Engine *engine); 31 | 32 | } // namespace builtins::web::dom_exception 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /builtins/web/fetch/fetch-api.h: -------------------------------------------------------------------------------- 1 | #ifndef BUILTINS_WEB_FETCH_API_H 2 | #define BUILTINS_WEB_FETCH_API_H 3 | 4 | #include "builtin.h" 5 | 6 | namespace builtins { 7 | namespace web { 8 | namespace fetch { 9 | 10 | bool install(api::Engine *engine); 11 | 12 | } // namespace fetch 13 | } // namespace web 14 | } // namespace builtins 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /builtins/web/fetch/fetch-utils.h: -------------------------------------------------------------------------------- 1 | #ifndef FETCH_UTILS_H_ 2 | #define FETCH_UTILS_H_ 3 | 4 | #include "builtin.h" 5 | 6 | namespace builtins::web::fetch { 7 | 8 | struct MimeType { 9 | std::string essence; 10 | std::vector> params; 11 | 12 | std::string to_string(); 13 | }; 14 | 15 | // MimeType parsing error type marker 16 | struct InvalidMimeType {}; 17 | 18 | // https://fetch.spec.whatwg.org/#concept-body-mime-type 19 | mozilla::Result extract_mime_type(std::string_view query); 20 | 21 | 22 | // Extracts a valid byte range from the given `Range` header query string, following 23 | // the steps defined for "blob" schemes in the Fetch specification: 24 | // https://fetch.spec.whatwg.org/#scheme-fetch 25 | // 26 | // @param range_query The raw `Range` header value (e.g. "bytes=0-499"). 27 | // @param full_len The total size of the resource for which the range is requested. 28 | // 29 | // @return An optional tuple `(start, end)` representing the byte range. Returns 30 | // `std::nullopt` if the range is invalid or cannot be parsed. 31 | std::optional> extract_range(std::string_view range_query, size_t full_len); 32 | 33 | } 34 | 35 | #endif // FETCH_UTILS_H_ 36 | -------------------------------------------------------------------------------- /builtins/web/file.h: -------------------------------------------------------------------------------- 1 | #ifndef BUILTINS_WEB_FILE_H 2 | #define BUILTINS_WEB_FILE_H 3 | 4 | #include "blob.h" 5 | #include "builtin.h" 6 | 7 | namespace builtins { 8 | namespace web { 9 | namespace file { 10 | class File : public BuiltinImpl { 11 | static bool name_get(JSContext *cx, unsigned argc, JS::Value *vp); 12 | static bool lastModified_get(JSContext *cx, unsigned argc, JS::Value *vp); 13 | 14 | public: 15 | static constexpr int ParentSlots = blob::Blob::Slots::Count; 16 | enum Slots { Name = ParentSlots, LastModified, Count }; 17 | 18 | static constexpr const char *class_name = "File"; 19 | static constexpr unsigned ctor_length = 2; 20 | 21 | static const JSFunctionSpec static_methods[]; 22 | static const JSPropertySpec static_properties[]; 23 | static const JSFunctionSpec methods[]; 24 | static const JSPropertySpec properties[]; 25 | 26 | static JSString *name(JSObject *self); 27 | 28 | static JSObject *create(JSContext *cx, HandleValue fileBits, HandleValue fileName, HandleValue opts); 29 | static bool init(JSContext *cx, HandleObject self, HandleValue fileBits, HandleValue fileName, HandleValue opts); 30 | static bool init_class(JSContext *cx, HandleObject global); 31 | static bool constructor(JSContext *cx, unsigned argc, Value *vp); 32 | }; 33 | 34 | bool install(api::Engine *engine); 35 | 36 | } // namespace file 37 | } // namespace web 38 | } // namespace builtins 39 | 40 | #endif // BUILTINS_WEB_FILE_H 41 | -------------------------------------------------------------------------------- /builtins/web/form-data/form-data-parser.h: -------------------------------------------------------------------------------- 1 | #ifndef BUILTINS_WEB_FORM_DATA_PARSER_ 2 | #define BUILTINS_WEB_FORM_DATA_PARSER_ 3 | 4 | #include "builtin.h" 5 | #include "form-data.h" 6 | 7 | namespace builtins { 8 | namespace web { 9 | namespace form_data { 10 | 11 | class FormDataParser { 12 | public: 13 | virtual JSObject *parse(JSContext *cx, std::string_view body) = 0; 14 | virtual ~FormDataParser() = default; 15 | 16 | static std::unique_ptr create(std::string_view content_type); 17 | }; 18 | 19 | } // namespace form_data 20 | } // namespace web 21 | } // namespace builtins 22 | 23 | #endif // BUILTINS_WEB_FORM_DATA_PARSER_ 24 | -------------------------------------------------------------------------------- /builtins/web/global_self.cpp: -------------------------------------------------------------------------------- 1 | #include "global_self.h" 2 | 3 | bool self_get(JSContext *cx, unsigned argc, Value *vp) { 4 | CallArgs args = CallArgsFromVp(argc, vp); 5 | args.rval().setObject(*JS::CurrentGlobalOrNull(cx)); 6 | return true; 7 | } 8 | 9 | bool self_set(JSContext *cx, unsigned argc, Value *vp) { 10 | CallArgs args = CallArgsFromVp(argc, vp); 11 | if (!args.requireAtLeast(cx, "globalThis.self setter", 1)) { 12 | return false; 13 | } 14 | 15 | RootedObject global(cx, JS::CurrentGlobalOrNull(cx)); 16 | if (args.thisv() != ObjectValue(*global)) { 17 | return api::throw_error(cx, api::Errors::WrongReceiver, "set self", "globalThis"); 18 | } 19 | 20 | if (!JS_DefineProperty(cx, global, "self", args[0], JSPROP_ENUMERATE)) { 21 | return false; 22 | } 23 | 24 | args.rval().setUndefined(); 25 | return true; 26 | } 27 | 28 | const JSPropertySpec properties[] = {JS_PSGS("self", self_get, self_set, JSPROP_ENUMERATE), 29 | JS_PS_END}; 30 | 31 | bool builtins::web::global_self::install(api::Engine *engine) { 32 | return JS_DefineProperties(engine->cx(), engine->global(), properties); 33 | } 34 | -------------------------------------------------------------------------------- /builtins/web/global_self.h: -------------------------------------------------------------------------------- 1 | #ifndef GLOBAL_SELF_H 2 | #define GLOBAL_SELF_H 3 | 4 | #include "extension-api.h" 5 | 6 | namespace builtins::web::global_self { 7 | 8 | bool install(api::Engine *engine); 9 | 10 | } // namespace builtins::web::global_self 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /builtins/web/performance.h: -------------------------------------------------------------------------------- 1 | #ifndef BUILTINS_WEB_BUILTIN_PERFORMANCE_H 2 | #define BUILTINS_WEB_BUILTIN_PERFORMANCE_H 3 | 4 | #include "builtin.h" 5 | 6 | namespace builtins { 7 | namespace web { 8 | namespace performance { 9 | 10 | class Performance : public BuiltinNoConstructor { 11 | public: 12 | static constexpr const char *class_name = "Performance"; 13 | static const int ctor_length = 0; 14 | enum Slots { Count }; 15 | static const JSFunctionSpec methods[]; 16 | static const JSFunctionSpec static_methods[]; 17 | static const JSPropertySpec properties[]; 18 | static const JSPropertySpec static_properties[]; 19 | static std::optional timeOrigin; 20 | 21 | static bool now(JSContext *cx, unsigned argc, JS::Value *vp); 22 | static bool timeOrigin_get(JSContext *cx, unsigned argc, JS::Value *vp); 23 | 24 | static bool create(JSContext *cx, JS::HandleObject global); 25 | static bool init_class(JSContext *cx, JS::HandleObject global); 26 | }; 27 | 28 | bool install(api::Engine *engine); 29 | 30 | } // namespace performance 31 | } // namespace web 32 | } // namespace builtins 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /builtins/web/queue-microtask.h: -------------------------------------------------------------------------------- 1 | #ifndef BUILTINS_WEB_QUEUE_MICROTASK_H 2 | #define BUILTINS_WEB_QUEUE_MICROTASK_H 3 | 4 | #include "builtin.h" 5 | 6 | namespace builtins { 7 | namespace web { 8 | namespace queue_microtask { 9 | 10 | bool install(api::Engine *engine); 11 | 12 | } // namespace queue_microtask 13 | } // namespace web 14 | } // namespace builtins 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /builtins/web/streams/stream-errors.h: -------------------------------------------------------------------------------- 1 | #ifndef STREAM_ERRORS_H 2 | #define STREAM_ERRORS_H 3 | 4 | #include "builtin.h" 5 | 6 | namespace StreamErrors { 7 | DEF_ERR(CompressingChunkFailed, JSEXN_TYPEERR, "CompressionStream transform: error compressing chunk", 0) 8 | DEF_ERR(DecompressingChunkFailed, JSEXN_TYPEERR, "DecompressionStream transform: error decompressing chunk", 0) 9 | DEF_ERR(StreamInitializationFailed, JSEXN_ERR, "Error initializing {0} stream", 1) 10 | DEF_ERR(StreamAlreadyLocked, JSEXN_TYPEERR, "Can't lock an already locked ReadableStream", 0) 11 | DEF_ERR(PipeThroughFromLockedStream, JSEXN_TYPEERR, "pipeThrough called on a ReadableStream that's already locked", 0) 12 | DEF_ERR(PipeThroughToLockedStream, JSEXN_TYPEERR, "The writable end of the transform object passed to pipeThrough " 13 | "is already locked", 0) 14 | DEF_ERR(PipeThroughWrongArg, JSEXN_TYPEERR, "pipeThrough called on a ReadableStream that's already locked", 0) 15 | DEF_ERR(TransformStreamTerminated, JSEXN_TYPEERR, "The TransformStream has been terminated", 0) 16 | DEF_ERR(InvalidCompressionFormat, JSEXN_TYPEERR, "'format' has to be \"deflate\", \"deflate-raw\", or \"gzip\", " 17 | "but got \"{0}\"", 1) 18 | }; // namespace StreamErrors 19 | 20 | #endif // STREAM_ERRORS_H 21 | -------------------------------------------------------------------------------- /builtins/web/streams/streams.cpp: -------------------------------------------------------------------------------- 1 | #include "streams.h" 2 | #include "buf-reader.h" 3 | #include "compression-stream.h" 4 | #include "decompression-stream.h" 5 | #include "event_loop.h" 6 | #include "native-stream-sink.h" 7 | #include "native-stream-source.h" 8 | #include "transform-stream-default-controller.h" 9 | #include "transform-stream.h" 10 | 11 | namespace builtins { 12 | namespace web { 13 | namespace streams { 14 | 15 | bool install(api::Engine *engine) { 16 | if (!NativeStreamSource::init_class(engine->cx(), engine->global())) 17 | return false; 18 | if (!NativeStreamSink::init_class(engine->cx(), engine->global())) 19 | return false; 20 | if (!TransformStreamDefaultController::init_class(engine->cx(), engine->global())) 21 | return false; 22 | if (!TransformStream::init_class(engine->cx(), engine->global())) 23 | return false; 24 | if (!CompressionStream::init_class(engine->cx(), engine->global())) 25 | return false; 26 | if (!DecompressionStream::init_class(engine->cx(), engine->global())) 27 | return false; 28 | if (!BufReader::init_class(engine->cx(), engine->global())) 29 | return false; 30 | return true; 31 | } 32 | 33 | } // namespace streams 34 | } // namespace web 35 | } // namespace builtins 36 | -------------------------------------------------------------------------------- /builtins/web/streams/streams.h: -------------------------------------------------------------------------------- 1 | #ifndef BUILTINS_WEB_STREAMS_H 2 | #define BUILTINS_WEB_STREAMS_H 3 | 4 | #include "builtin.h" 5 | 6 | namespace builtins { 7 | namespace web { 8 | namespace streams { 9 | bool install(api::Engine *engine); 10 | } // namespace streams 11 | } // namespace web 12 | } // namespace builtins 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /builtins/web/structured-clone.h: -------------------------------------------------------------------------------- 1 | #ifndef BUILTINS_WEB_STRUCTURED_CLONE_H 2 | #define BUILTINS_WEB_STRUCTURED_CLONE_H 3 | 4 | #include "builtin.h" 5 | #include "js/StructuredClone.h" 6 | #include "url.h" 7 | 8 | namespace builtins { 9 | namespace web { 10 | namespace structured_clone { 11 | 12 | bool install(api::Engine *engine); 13 | 14 | } // namespace structured_clone 15 | } // namespace web 16 | } // namespace builtins 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /builtins/web/text-codec/text-codec-errors.h: -------------------------------------------------------------------------------- 1 | #ifndef TEXT_CODEC_ERRORS_H 2 | #define TEXT_CODEC_ERRORS_H 3 | 4 | #include "builtin.h" 5 | 6 | namespace TextCodecErrors { 7 | DEF_ERR(FetchNetworkError, JSEXN_TYPEERR, "NetworkError when attempting to fetch resource", 0) 8 | DEF_ERR(InvalidEncoding, JSEXN_RANGEERR, "TextDecoder constructor: The given encoding is not supported.", 0) 9 | DEF_ERR(DecodingFailed, JSEXN_TYPEERR, "TextDecoder.decode: Decoding failed.", 0) 10 | }; 11 | 12 | #endif // TEXT_CODEC_ERRORS_H 13 | -------------------------------------------------------------------------------- /builtins/web/text-codec/text-codec.cpp: -------------------------------------------------------------------------------- 1 | #include "text-codec.h" 2 | #include "text-decoder.h" 3 | #include "text-encoder.h" 4 | 5 | namespace builtins { 6 | namespace web { 7 | namespace text_codec { 8 | 9 | bool install(api::Engine *engine) { 10 | if (!TextEncoder::init_class(engine->cx(), engine->global())) 11 | return false; 12 | if (!TextDecoder::init_class(engine->cx(), engine->global())) 13 | return false; 14 | return true; 15 | } 16 | 17 | } // namespace text_codec 18 | } // namespace web 19 | } // namespace builtins 20 | -------------------------------------------------------------------------------- /builtins/web/text-codec/text-codec.h: -------------------------------------------------------------------------------- 1 | #ifndef BUILTINS_WEB_TEXT_CODEC_H 2 | #define BUILTINS_WEB_TEXT_CODEC_H 3 | 4 | #include "builtin.h" 5 | 6 | namespace builtins { 7 | namespace web { 8 | namespace text_codec { 9 | bool install(api::Engine *engine); 10 | } 11 | } // namespace web 12 | } // namespace builtins 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /builtins/web/text-codec/text-decoder.h: -------------------------------------------------------------------------------- 1 | #ifndef BUILTINS_TEXT_DECODER_H 2 | #define BUILTINS_TEXT_DECODER_H 3 | 4 | #include "builtin.h" 5 | 6 | namespace builtins { 7 | namespace web { 8 | namespace text_codec { 9 | 10 | class TextDecoder final : public FinalizableBuiltinImpl { 11 | static bool decode(JSContext *cx, unsigned argc, JS::Value *vp); 12 | static bool encoding_get(JSContext *cx, unsigned argc, JS::Value *vp); 13 | static bool fatal_get(JSContext *cx, unsigned argc, JS::Value *vp); 14 | static bool ignoreBOM_get(JSContext *cx, unsigned argc, JS::Value *vp); 15 | 16 | public: 17 | static constexpr const char *class_name = "TextDecoder"; 18 | 19 | enum class Slots { 20 | Decoder, 21 | Encoding, 22 | Fatal, 23 | IgnoreBOM, 24 | Count, 25 | }; 26 | 27 | static const JSFunctionSpec static_methods[]; 28 | static const JSPropertySpec static_properties[]; 29 | static const JSFunctionSpec methods[]; 30 | static const JSPropertySpec properties[]; 31 | 32 | static const unsigned ctor_length = 0; 33 | 34 | static bool init_class(JSContext *cx, JS::HandleObject global); 35 | static bool constructor(JSContext *cx, unsigned argc, JS::Value *vp); 36 | static void finalize(JS::GCContext *gcx, JSObject *self); 37 | }; 38 | 39 | } // namespace text_codec 40 | } // namespace web 41 | } // namespace builtins 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /builtins/web/text-codec/text-encoder.h: -------------------------------------------------------------------------------- 1 | #ifndef BUILTIN_TEXT_ENCODER_H 2 | #define BUILTIN_TEXT_ENCODER_H 3 | 4 | #include "builtin.h" 5 | 6 | namespace builtins { 7 | namespace web { 8 | namespace text_codec { 9 | 10 | class TextEncoder final : public BuiltinImpl { 11 | static bool encode(JSContext *cx, unsigned argc, JS::Value *vp); 12 | static bool encodeInto(JSContext *cx, unsigned argc, JS::Value *vp); 13 | static bool encoding_get(JSContext *cx, unsigned argc, JS::Value *vp); 14 | 15 | public: 16 | static constexpr const char *class_name = "TextEncoder"; 17 | 18 | enum class Slots { Count }; 19 | static const JSFunctionSpec static_methods[]; 20 | static const JSPropertySpec static_properties[]; 21 | static const JSFunctionSpec methods[]; 22 | static const JSPropertySpec properties[]; 23 | 24 | static const unsigned ctor_length = 0; 25 | 26 | static bool init_class(JSContext *cx, JS::HandleObject global); 27 | static bool constructor(JSContext *cx, unsigned argc, JS::Value *vp); 28 | }; 29 | 30 | } // namespace text_codec 31 | } // namespace web 32 | } // namespace builtins 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /builtins/web/timers.h: -------------------------------------------------------------------------------- 1 | #ifndef BUILTINS_WEB_TIMERS_H 2 | #define BUILTINS_WEB_TIMERS_H 3 | 4 | #include "extension-api.h" 5 | 6 | namespace builtins::web::timers { 7 | 8 | bool install(api::Engine *engine); 9 | 10 | } 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /builtins/web/worker-location.h: -------------------------------------------------------------------------------- 1 | #ifndef BUILTINS_WEB_WORKER_LOCATION_H 2 | #define BUILTINS_WEB_WORKER_LOCATION_H 3 | 4 | #include "builtin.h" 5 | 6 | namespace builtins { 7 | namespace web { 8 | namespace worker_location { 9 | 10 | class WorkerLocation : public BuiltinNoConstructor { 11 | private: 12 | public: 13 | static constexpr const char *class_name = "WorkerLocation"; 14 | static const int ctor_length = 1; 15 | enum Slots { Count }; 16 | static const JSFunctionSpec static_methods[]; 17 | static const JSPropertySpec static_properties[]; 18 | static const JSFunctionSpec methods[]; 19 | static const JSPropertySpec properties[]; 20 | 21 | static JS::PersistentRooted url; 22 | static bool toString(JSContext *cx, unsigned argc, JS::Value *vp); 23 | 24 | static bool init_class(JSContext *cx, JS::HandleObject global); 25 | }; 26 | 27 | bool install(api::Engine *engine); 28 | 29 | } // namespace worker_location 30 | } // namespace web 31 | } // namespace builtins 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /clang-format.ignore: -------------------------------------------------------------------------------- 1 | deps/include/wizer.h 2 | crates/rust-url/rust-url.h 3 | crates/rust-encoding/rust-encoding.h 4 | bindings.h 5 | -------------------------------------------------------------------------------- /cmake/CPM.cmake: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: MIT 2 | # 3 | # SPDX-FileCopyrightText: Copyright (c) 2019-2023 Lars Melchior and contributors 4 | 5 | set(CPM_DOWNLOAD_VERSION 0.40.5) 6 | set(CPM_HASH_SUM "c46b876ae3b9f994b4f05a4c15553e0485636862064f1fcc9d8b4f832086bc5d") 7 | 8 | # Ensure that the CPM_SOURCE_CACHE is defined and in sync with ENV{CPM_SOURCE_CACHE} 9 | if (NOT DEFINED CPM_SOURCE_CACHE) 10 | if(DEFINED ENV{CPM_SOURCE_CACHE}) 11 | set(CPM_SOURCE_CACHE $ENV{CPM_SOURCE_CACHE}) 12 | else() 13 | set(CPM_SOURCE_CACHE ${CMAKE_CURRENT_SOURCE_DIR}/deps/cpm_cache) 14 | endif() 15 | endif() 16 | set(ENV{CPM_SOURCE_CACHE} ${CPM_SOURCE_CACHE}) 17 | 18 | set(CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake") 19 | set(CPM_USE_NAMED_CACHE_DIRECTORIES ON) 20 | 21 | # Expand relative path. This is important if the provided path contains a tilde (~) 22 | get_filename_component(CPM_DOWNLOAD_LOCATION ${CPM_DOWNLOAD_LOCATION} ABSOLUTE) 23 | 24 | file(DOWNLOAD 25 | https://github.com/cpm-cmake/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake 26 | ${CPM_DOWNLOAD_LOCATION} EXPECTED_HASH SHA256=${CPM_HASH_SUM} 27 | ) 28 | 29 | include(${CPM_DOWNLOAD_LOCATION}) 30 | -------------------------------------------------------------------------------- /cmake/add_as_subproject.cmake: -------------------------------------------------------------------------------- 1 | # Adds StarlingMonkey as a CMake sub-project, initializes the correct toolchain, and 2 | # exposes the `add_builtin` CMake function. 3 | 4 | cmake_minimum_required(VERSION 3.27 FATAL_ERROR) 5 | 6 | add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/.." ${CMAKE_BINARY_DIR}/starling-raw.wasm) 7 | 8 | set(PATH_BACKUP CMAKE_MODULE_PATH) 9 | set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}") 10 | include("toolchain") 11 | include("add_builtin") 12 | set(CMAKE_MODULE_PATH PATH_BACKUP) 13 | -------------------------------------------------------------------------------- /cmake/binaryen.cmake: -------------------------------------------------------------------------------- 1 | set(BINARYEN_VERSION 117) 2 | 3 | set(BINARYEN_ARCH ${HOST_ARCH}) 4 | if(HOST_OS STREQUAL "macos" AND HOST_ARCH STREQUAL "aarch64") 5 | set(BINARYEN_ARCH "arm64") 6 | endif() 7 | 8 | set(BINARYEN_URL https://github.com/WebAssembly/binaryen/releases/download/version_${BINARYEN_VERSION}/binaryen-version_${BINARYEN_VERSION}-${BINARYEN_ARCH}-${HOST_OS}.tar.gz) 9 | CPMAddPackage(NAME binaryen URL ${BINARYEN_URL} DOWNLOAD_ONLY TRUE) 10 | set(BINARYEN_DIR ${CPM_PACKAGE_binaryen_SOURCE_DIR}/bin) 11 | set(WASM_OPT ${BINARYEN_DIR}/wasm-opt CACHE FILEPATH "Path to wasm-opt binary") 12 | 13 | configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/cxx-wrapper.in ${CMAKE_BINARY_DIR}/cxx-wrapper) 14 | set(CMAKE_CXX_COMPILER "${CMAKE_BINARY_DIR}/cxx-wrapper") 15 | -------------------------------------------------------------------------------- /cmake/compile-flags.cmake: -------------------------------------------------------------------------------- 1 | set(WASI 1) 2 | set(CMAKE_CXX_STANDARD 20) 3 | add_compile_definitions("$<$:DEBUG=1>") 4 | 5 | list(APPEND CMAKE_EXE_LINKER_FLAGS 6 | -Wl,-z,stack-size=1048576 -Wl,--stack-first 7 | -mexec-model=reactor 8 | -lwasi-emulated-signal 9 | -lwasi-emulated-process-clocks 10 | -lwasi-emulated-getpid 11 | ) 12 | list(JOIN CMAKE_EXE_LINKER_FLAGS " " CMAKE_EXE_LINKER_FLAGS) 13 | 14 | list(APPEND CMAKE_CXX_FLAGS 15 | -std=gnu++20 -Wall -Werror -Qunused-arguments -Wimplicit-fallthrough 16 | -fno-sized-deallocation -fno-aligned-new -mthread-model single 17 | -fPIC -fno-rtti -fno-exceptions -fno-math-errno -pipe 18 | -fno-omit-frame-pointer -funwind-tables -m32 19 | ) 20 | list(JOIN CMAKE_CXX_FLAGS " " CMAKE_CXX_FLAGS) 21 | 22 | list(APPEND CMAKE_C_FLAGS 23 | -Wall -Werror -Wno-unknown-attributes -Wno-pointer-to-int-cast 24 | -Wno-int-to-pointer-cast -m32 25 | ) 26 | list(JOIN CMAKE_C_FLAGS " " CMAKE_C_FLAGS) 27 | -------------------------------------------------------------------------------- /cmake/fmt.cmake: -------------------------------------------------------------------------------- 1 | set(FMT_OS OFF) 2 | set(FMT_INSTALL OFF) 3 | CPMAddPackage(NAME fmt URL https://github.com/fmtlib/fmt/releases/download/10.1.1/fmt-10.1.1.zip) 4 | -------------------------------------------------------------------------------- /cmake/init-corrosion.cmake: -------------------------------------------------------------------------------- 1 | # Ensure that corrosion-rs is initialized, so we can use it or depend on variables it sets. 2 | # NOTE: This file must not be called `corrosion.cmake`, because otherwise it'll be called recursively instead of the 3 | # same-named one coming with Corrosion. 4 | 5 | set(Rust_CARGO_TARGET wasm32-wasip1) 6 | # Necessary to make cross-compiling to wasm32-wasi work for crates with -sys dependencies. 7 | set(Rust_CARGO_TARGET_LINK_NATIVE_LIBS "") 8 | 9 | file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/rust-toolchain.toml" Rust_TOOLCHAIN REGEX "^channel ?=") 10 | string(REGEX MATCH "[0-9.]+" Rust_TOOLCHAIN "${Rust_TOOLCHAIN}") 11 | execute_process(COMMAND rustup toolchain install ${Rust_TOOLCHAIN}) 12 | execute_process(COMMAND rustup target add --toolchain ${Rust_TOOLCHAIN} wasm32-wasi) 13 | 14 | CPMAddPackage("gh:corrosion-rs/corrosion@0.5.1") 15 | string(TOLOWER ${Rust_CARGO_HOST_ARCH} HOST_ARCH) 16 | -------------------------------------------------------------------------------- /cmake/toolchain.cmake: -------------------------------------------------------------------------------- 1 | string(TOLOWER ${CMAKE_HOST_SYSTEM_NAME} HOST_OS) 2 | cmake_host_system_information(RESULT HOST_CPU QUERY OS_PLATFORM) 3 | 4 | 5 | if (${HOST_OS} STREQUAL "darwin") 6 | set(HOST_OS "macos") 7 | endif() 8 | 9 | include("compile-flags") 10 | include("wasi-sdk") 11 | -------------------------------------------------------------------------------- /cmake/wasi-sdk.cmake: -------------------------------------------------------------------------------- 1 | set(WASI_SDK_VERSION 20 CACHE STRING "Version of wasi-sdk to use") 2 | 3 | set(WASI_SDK_URL "https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_SDK_VERSION}/wasi-sdk-${WASI_SDK_VERSION}.0-${HOST_OS}.tar.gz") 4 | CPMAddPackage(NAME wasi-sdk URL ${WASI_SDK_URL}) 5 | set(WASI_SDK_PREFIX ${CPM_PACKAGE_wasi-sdk_SOURCE_DIR}) 6 | set(CMAKE_TOOLCHAIN_FILE ${CPM_PACKAGE_wasi-sdk_SOURCE_DIR}/share/cmake/wasi-sdk.cmake) 7 | -------------------------------------------------------------------------------- /cmake/wasm-tools.cmake: -------------------------------------------------------------------------------- 1 | set(WASM_TOOLS_VERSION 1.0.54) 2 | 3 | set(WASM_TOOLS_URL https://github.com/bytecodealliance/wasm-tools/releases/download/wasm-tools-${WASM_TOOLS_VERSION}/wasm-tools-${WASM_TOOLS_VERSION}-${HOST_ARCH}-${HOST_OS}.tar.gz) 4 | CPMAddPackage(NAME wasm-tools URL ${WASM_TOOLS_URL} DOWNLOAD_ONLY TRUE) 5 | set(WASM_TOOLS_DIR ${CPM_PACKAGE_wasm-tools_SOURCE_DIR}) 6 | set(WASM_TOOLS_BIN ${WASM_TOOLS_DIR}/wasm-tools CACHE FILEPATH "Path to wasm-tools binary") 7 | -------------------------------------------------------------------------------- /cmake/wasmtime.cmake: -------------------------------------------------------------------------------- 1 | set(WASMTIME_VERSION v29.0.0) 2 | set(WASMTIME_URL https://github.com/bytecodealliance/wasmtime/releases/download/${WASMTIME_VERSION}/wasmtime-${WASMTIME_VERSION}-${HOST_ARCH}-${HOST_OS}.tar.xz) 3 | CPMAddPackage(NAME wasmtime URL ${WASMTIME_URL} DOWNLOAD_ONLY TRUE) 4 | set(WASMTIME_DIR ${CPM_PACKAGE_wasmtime_SOURCE_DIR}) 5 | set(WASMTIME ${WASMTIME_DIR}/wasmtime CACHE FILEPATH "Path to wasmtime binary") 6 | -------------------------------------------------------------------------------- /cmake/weval.cmake: -------------------------------------------------------------------------------- 1 | set(WEVAL_VERSION v0.3.2) 2 | 3 | set(WEVAL_URL https://github.com/bytecodealliance/weval/releases/download/${WEVAL_VERSION}/weval-${WEVAL_VERSION}-${HOST_ARCH}-${HOST_OS}.tar.xz) 4 | CPMAddPackage(NAME weval URL ${WEVAL_URL} DOWNLOAD_ONLY TRUE) 5 | set(WEVAL_DIR ${CPM_PACKAGE_weval_SOURCE_DIR}) 6 | set(WEVAL_BIN ${WEVAL_DIR}/weval CACHE FILEPATH "Path to weval binary") 7 | -------------------------------------------------------------------------------- /cmake/wizer.cmake: -------------------------------------------------------------------------------- 1 | set(WIZER_VERSION v3.0.1 CACHE STRING "Version of wizer to use") 2 | 3 | set(WIZER_URL https://github.com/bytecodealliance/wizer/releases/download/${WIZER_VERSION}/wizer-${WIZER_VERSION}-${HOST_ARCH}-${HOST_OS}.tar.xz) 4 | CPMAddPackage(NAME wizer URL ${WIZER_URL} DOWNLOAD_ONLY TRUE) 5 | set(WIZER_DIR ${CPM_PACKAGE_wizer_SOURCE_DIR}) 6 | set(WIZER_BIN ${WIZER_DIR}/wizer CACHE FILEPATH "Path to wizer binary") 7 | -------------------------------------------------------------------------------- /crates/rust-encoding/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "rust-encoding" 3 | version = "0.1.0" 4 | edition = "2021" 5 | description = "Character encoding library used by SpiderMonkey and web builtins" 6 | 7 | [lib] 8 | 9 | [dependencies] 10 | encoding_c = "0.9.8" 11 | encoding_c_mem = "0.2.6" 12 | -------------------------------------------------------------------------------- /crates/rust-encoding/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Ensure that the encoding modules are built, as SpiderMonkey relies on them. 2 | pub use encoding_c; 3 | pub use encoding_c_mem; 4 | -------------------------------------------------------------------------------- /crates/rust-hooks/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "rust-hooks" 3 | version = "0.1.0" 4 | edition = "2021" 5 | description = "A library for managing git hooks in Rust, copied from Gecko" 6 | license = "MPL-2.0" 7 | 8 | [dependencies] 9 | arrayvec = "0.7.6" 10 | 11 | [features] 12 | panic_hook = [] 13 | default_features = ["panic_hook"] 14 | -------------------------------------------------------------------------------- /crates/rust-hooks/src/wrappers.cpp: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* This Source Code Form is subject to the terms of the Mozilla Public 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this file, 4 | * You can obtain one at http://mozilla.org/MPL/2.0/. */ 5 | 6 | // This file is copied with slight changes from Gecko: 7 | // https://searchfox.org/mozilla-central/rev/91030e74f3e9bb2aac9fe2cbff80734c6fd610b9/mozglue/static/rust/wrappers.cpp 8 | 9 | #include "mozilla/Assertions.h" 10 | #include "mozilla/mozalloc_oom.h" 11 | 12 | // MOZ_Crash wrapper for use by rust, since MOZ_Crash is an inline function. 13 | extern "C" void RustMozCrash(const char* aFilename, int aLine, 14 | const char* aReason) { 15 | MOZ_Crash(aFilename, aLine, aReason); 16 | } 17 | 18 | // mozalloc_handle_oom wrapper for use by rust, because mozalloc_handle_oom is 19 | // MFBT_API, that rust can't respect. 20 | extern "C" void RustHandleOOM(size_t size) { mozalloc_handle_oom(size); } 21 | -------------------------------------------------------------------------------- /crates/rust-multipart/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | Cargo.lock 3 | -------------------------------------------------------------------------------- /crates/rust-multipart/Cargo.toml: -------------------------------------------------------------------------------- 1 | [workspace] 2 | resolver = "2" 3 | members = ["fuzz"] 4 | 5 | [package] 6 | name = "multipart" 7 | version = "0.1.0" 8 | edition = "2021" 9 | 10 | [dependencies] 11 | winnow = "0.7" 12 | 13 | [features] 14 | capi = [] 15 | simd = ["winnow/simd"] 16 | 17 | [profile.release] 18 | lto = true 19 | panic = 'abort' 20 | 21 | [profile.dev] 22 | lto = true 23 | panic = 'abort' 24 | -------------------------------------------------------------------------------- /crates/rust-multipart/cbindgen.toml: -------------------------------------------------------------------------------- 1 | language = "C++" 2 | 3 | pragma_once = true 4 | include_guard = "rust_multipart_bindings_h" 5 | 6 | autogen_warning = "/* Warning, this file is autogenerated by cbindgen. Don't modify this manually. */" 7 | 8 | include_version = false 9 | namespace = "jsmultipart" 10 | using_namespaces = [] 11 | sys_includes = [] 12 | includes = [] 13 | no_includes = false 14 | after_includes = "" 15 | 16 | braces = "SameLine" 17 | line_length = 100 18 | tab_width = 2 19 | documentation = true 20 | documentation_style = "auto" 21 | line_endings = "LF" 22 | 23 | usize_is_size_t = true 24 | -------------------------------------------------------------------------------- /crates/rust-multipart/fuzz/.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | corpus/*/* 3 | artifacts 4 | !*.seed 5 | coverage 6 | -------------------------------------------------------------------------------- /crates/rust-multipart/fuzz/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "multipart-fuzz" 3 | version = "0.0.0" 4 | publish = false 5 | edition = "2021" 6 | 7 | [package.metadata] 8 | cargo-fuzz = true 9 | 10 | [dependencies] 11 | libfuzzer-sys = "0.4" 12 | 13 | [dependencies.multipart] 14 | path = ".." 15 | 16 | [[bin]] 17 | name = "fuzz_multipart" 18 | path = "fuzz_targets/fuzz_multipart.rs" 19 | test = false 20 | doc = false 21 | bench = false 22 | -------------------------------------------------------------------------------- /crates/rust-multipart/fuzz/corpus/fuzz_multipart/multi.seed: -------------------------------------------------------------------------------- 1 | ----BoundaryjXo5N4HEAXWcKrw7 2 | Content-Disposition: form-data; name="field1" 3 | 4 | value1 5 | ----BoundaryjXo5N4HEAXWcKrw7 6 | Content-Disposition: form-data; name="field2" 7 | 8 | value2 9 | ----BoundaryjXo5N4HEAXWcKrw7 10 | Content-Disposition: form-data; name="file1"; filename="dummy.txt" 11 | Content-Type: foo 12 | 13 | Hello World! 14 | ----BoundaryjXo5N4HEAXWcKrw7-- 15 | -------------------------------------------------------------------------------- /crates/rust-multipart/fuzz/corpus/fuzz_multipart/simple.seed: -------------------------------------------------------------------------------- 1 | --X-BOUNDARY 2 | content-disposition: form-data; name="field1" 3 | content-type: text/plain;charset=UTF-8 4 | content-transfer-encoding: quoted-printable 5 | 6 | Joe owes =E2=82=AC100. 7 | --X-BOUNDARY-- 8 | -------------------------------------------------------------------------------- /crates/rust-multipart/fuzz/fuzz_targets/fuzz_multipart.rs: -------------------------------------------------------------------------------- 1 | #![no_main] 2 | 3 | use libfuzzer_sys::fuzz_target; 4 | use multipart::MultipartParser; 5 | 6 | fuzz_target!(|data: &[u8]| { 7 | let mut parser = MultipartParser::new(data, "X-BOUNDARY"); 8 | let mut retries = 0; 9 | 10 | while retries < 5 { 11 | let entry = parser.parse_next(); 12 | match entry { 13 | Some(Ok(_)) => continue, 14 | Some(Err(_)) | None => retries += 1, 15 | }; 16 | } 17 | }); 18 | -------------------------------------------------------------------------------- /crates/rust-multipart/src/error.rs: -------------------------------------------------------------------------------- 1 | use std::fmt::Display; 2 | 3 | #[derive(Copy, Clone, Debug)] 4 | pub(crate) enum Error { 5 | MissingName, 6 | InvalidBoundary, 7 | MissingContentDisposition, 8 | } 9 | 10 | impl Display for Error { 11 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 12 | match self { 13 | Error::MissingName => { 14 | write!(f, "name field is missing from content-disposition header") 15 | } 16 | Error::InvalidBoundary => { 17 | write!(f, "Invalid boundary position, CRLF not found") 18 | } 19 | Error::MissingContentDisposition => { 20 | write!(f, "content-disposition is missing from headers") 21 | } 22 | } 23 | } 24 | } 25 | 26 | impl std::error::Error for Error { 27 | fn description(&self) -> &'static str { 28 | "Multipart parse error" 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /crates/rust-url/.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | -------------------------------------------------------------------------------- /crates/rust-url/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "rust-url" 3 | version = "0.1.0" 4 | edition = "2018" 5 | 6 | [lib] 7 | 8 | [dependencies] 9 | url = "2.5.2" 10 | -------------------------------------------------------------------------------- /crates/rust-url/cbindgen.toml: -------------------------------------------------------------------------------- 1 | language = "C++" 2 | 3 | header = """ 4 | // The constructor created by cbindgen's `derive_constructor` causes this warning. 5 | // Gecko's various uses of cbindgen silence it, so we do, too. 6 | #ifdef __clang__ 7 | # pragma GCC diagnostic ignored "-Wreturn-type-c-linkage" 8 | #endif 9 | """ 10 | 11 | pragma_once = true 12 | include_guard = "rust_url_bindings_h" 13 | 14 | autogen_warning = "/* Warning, this file is autogenerated by cbindgen. Don't modify this manually. */" 15 | 16 | include_version = false 17 | namespace = "jsurl" 18 | using_namespaces = [] 19 | sys_includes = [] 20 | includes = [] 21 | no_includes = false 22 | after_includes = "" 23 | 24 | braces = "SameLine" 25 | line_length = 100 26 | tab_width = 2 27 | documentation = true 28 | documentation_style = "auto" 29 | line_endings = "LF" 30 | 31 | usize_is_size_t = true 32 | 33 | [struct] 34 | derive_constructor = true 35 | -------------------------------------------------------------------------------- /deps/patches/getuid.patch: -------------------------------------------------------------------------------- 1 | diff --color -ru openssl-3.0.7/crypto/uid.c openssl-3.0.7-orig/crypto/uid.c 2 | --- a/crypto/uid.c 2023-01-09 17:00:00.094912576 -0800 3 | +++ b/crypto/uid.c 2022-11-01 07:14:36.000000000 -0700 4 | @@ -10,7 +10,7 @@ 5 | #include 6 | #include 7 | 8 | -#if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_UEFI) 9 | +#if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_UEFI) || defined(__wasi__) 10 | 11 | int OPENSSL_issetugid(void) 12 | { 13 | -------------------------------------------------------------------------------- /deps/patches/rand.patch: -------------------------------------------------------------------------------- 1 | diff --git openssl-3.0.7/crypto/rand/rand_lib.c openssl-3.0.7/crypto/rand/rand_lib.c 2 | --- a/crypto/rand/rand_lib.c 3 | +++ b/crypto/rand/rand_lib.c 4 | @@ -320,6 +320,10 @@ const RAND_METHOD *RAND_get_rand_method(void) 5 | int RAND_priv_bytes_ex(OSSL_LIB_CTX *ctx, unsigned char *buf, size_t num, 6 | unsigned int strength) 7 | { 8 | +#ifdef __wasi__ 9 | + arc4random_buf(buf, num); 10 | + return 1; 11 | +#endif 12 | EVP_RAND_CTX *rand; 13 | #if !defined(OPENSSL_NO_DEPRECATED_3_0) && !defined(FIPS_MODULE) 14 | const RAND_METHOD *meth = RAND_get_rand_method(); 15 | @@ -349,6 +353,10 @@ int RAND_priv_bytes(unsigned char *buf, int num) 16 | int RAND_bytes_ex(OSSL_LIB_CTX *ctx, unsigned char *buf, size_t num, 17 | unsigned int strength) 18 | { 19 | +#ifdef __wasi__ 20 | + arc4random_buf(buf, num); 21 | + return 1; 22 | +#endif 23 | EVP_RAND_CTX *rand; 24 | #if !defined(OPENSSL_NO_DEPRECATED_3_0) && !defined(FIPS_MODULE) 25 | const RAND_METHOD *meth = RAND_get_rand_method(); -------------------------------------------------------------------------------- /host-apis/wasi-0.2.0/bindings/bindings_component_type.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bytecodealliance/StarlingMonkey/4051ee1e72b8c9ae49cc78140529fb6198992760/host-apis/wasi-0.2.0/bindings/bindings_component_type.o -------------------------------------------------------------------------------- /host-apis/wasi-0.2.0/host_api.cmake: -------------------------------------------------------------------------------- 1 | add_library(host_api STATIC 2 | ${HOST_API}/host_api.cpp 3 | ${HOST_API}/host_call.cpp 4 | ${HOST_API}/bindings/bindings.c 5 | ${HOST_API}/bindings/bindings_component_type.o 6 | ) 7 | 8 | target_link_libraries(host_api PRIVATE spidermonkey) 9 | target_include_directories(host_api PRIVATE include) 10 | target_include_directories(host_api PRIVATE ${HOST_API}) 11 | target_include_directories(host_api PUBLIC ${HOST_API}/include) 12 | 13 | if (CMAKE_BUILD_TYPE STREQUAL "Debug") 14 | set(ADAPTER "debug") 15 | else() 16 | set(ADAPTER "release") 17 | endif() 18 | set(ADAPTER "${HOST_API}/preview1-adapter-${ADAPTER}/wasi_snapshot_preview1.wasm") 19 | -------------------------------------------------------------------------------- /host-apis/wasi-0.2.0/host_call.cpp: -------------------------------------------------------------------------------- 1 | #include "host_api.h" 2 | 3 | namespace host_api { 4 | 5 | /* Returns false if an exception is set on `cx` and the caller should 6 | immediately return to propagate the exception. */ 7 | void handle_api_error(JSContext *cx, uint8_t err, int line, const char *func) { 8 | JS_ReportErrorUTF8(cx, "%s: An error occurred while using the host API.\n", func); 9 | } 10 | 11 | } // namespace host_api 12 | -------------------------------------------------------------------------------- /host-apis/wasi-0.2.0/include/exports.h: -------------------------------------------------------------------------------- 1 | #ifndef WASI_PREVIEW2_EXPORTS 2 | #define WASI_PREVIEW2_EXPORTS 3 | 4 | #define exports_wasi_http_incoming_handler exports_wasi_http_incoming_handler_handle 5 | #define exports_wasi_http_incoming_request \ 6 | exports_wasi_http_incoming_handler_own_incoming_request_t 7 | #define exports_wasi_http_response_outparam \ 8 | exports_wasi_http_incoming_handler_own_response_outparam_t 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /host-apis/wasi-0.2.0/preview1-adapter-debug/wasi_snapshot_preview1.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bytecodealliance/StarlingMonkey/4051ee1e72b8c9ae49cc78140529fb6198992760/host-apis/wasi-0.2.0/preview1-adapter-debug/wasi_snapshot_preview1.wasm -------------------------------------------------------------------------------- /host-apis/wasi-0.2.0/preview1-adapter-release/wasi_snapshot_preview1.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bytecodealliance/StarlingMonkey/4051ee1e72b8c9ae49cc78140529fb6198992760/host-apis/wasi-0.2.0/preview1-adapter-release/wasi_snapshot_preview1.wasm -------------------------------------------------------------------------------- /host-apis/wasi-0.2.0/wit/command-extended.wit: -------------------------------------------------------------------------------- 1 | // All of the same imports and exports available in the wasi:cli/command world 2 | // with addition of HTTP proxy related imports: 3 | world command-extended { 4 | include wasi:cli/command@0.2.0; 5 | import wasi:http/outgoing-handler@0.2.0; 6 | } 7 | -------------------------------------------------------------------------------- /host-apis/wasi-0.2.0/wit/deps/cli/command.wit: -------------------------------------------------------------------------------- 1 | package wasi:cli@0.2.0; 2 | 3 | world command { 4 | include imports; 5 | 6 | export run; 7 | } 8 | -------------------------------------------------------------------------------- /host-apis/wasi-0.2.0/wit/deps/cli/environment.wit: -------------------------------------------------------------------------------- 1 | interface environment { 2 | /// Get the POSIX-style environment variables. 3 | /// 4 | /// Each environment variable is provided as a pair of string variable names 5 | /// and string value. 6 | /// 7 | /// Morally, these are a value import, but until value imports are available 8 | /// in the component model, this import function should return the same 9 | /// values each time it is called. 10 | get-environment: func() -> list>; 11 | 12 | /// Get the POSIX-style arguments to the program. 13 | get-arguments: func() -> list; 14 | 15 | /// Return a path that programs should use as their initial current working 16 | /// directory, interpreting `.` as shorthand for this. 17 | initial-cwd: func() -> option; 18 | } 19 | -------------------------------------------------------------------------------- /host-apis/wasi-0.2.0/wit/deps/cli/exit.wit: -------------------------------------------------------------------------------- 1 | interface exit { 2 | /// Exit the current instance and any linked instances. 3 | exit: func(status: result); 4 | } 5 | -------------------------------------------------------------------------------- /host-apis/wasi-0.2.0/wit/deps/cli/imports.wit: -------------------------------------------------------------------------------- 1 | package wasi:cli@0.2.0; 2 | 3 | world imports { 4 | include wasi:clocks/imports@0.2.0; 5 | include wasi:filesystem/imports@0.2.0; 6 | include wasi:sockets/imports@0.2.0; 7 | include wasi:random/imports@0.2.0; 8 | include wasi:io/imports@0.2.0; 9 | 10 | import environment; 11 | import exit; 12 | import stdin; 13 | import stdout; 14 | import stderr; 15 | import terminal-input; 16 | import terminal-output; 17 | import terminal-stdin; 18 | import terminal-stdout; 19 | import terminal-stderr; 20 | } 21 | -------------------------------------------------------------------------------- /host-apis/wasi-0.2.0/wit/deps/cli/run.wit: -------------------------------------------------------------------------------- 1 | interface run { 2 | /// Run the program. 3 | run: func() -> result; 4 | } 5 | -------------------------------------------------------------------------------- /host-apis/wasi-0.2.0/wit/deps/cli/stdio.wit: -------------------------------------------------------------------------------- 1 | interface stdin { 2 | use wasi:io/streams@0.2.0.{input-stream}; 3 | 4 | get-stdin: func() -> input-stream; 5 | } 6 | 7 | interface stdout { 8 | use wasi:io/streams@0.2.0.{output-stream}; 9 | 10 | get-stdout: func() -> output-stream; 11 | } 12 | 13 | interface stderr { 14 | use wasi:io/streams@0.2.0.{output-stream}; 15 | 16 | get-stderr: func() -> output-stream; 17 | } 18 | -------------------------------------------------------------------------------- /host-apis/wasi-0.2.0/wit/deps/clocks/world.wit: -------------------------------------------------------------------------------- 1 | package wasi:clocks@0.2.0; 2 | 3 | world imports { 4 | import monotonic-clock; 5 | import wall-clock; 6 | } 7 | -------------------------------------------------------------------------------- /host-apis/wasi-0.2.0/wit/deps/filesystem/preopens.wit: -------------------------------------------------------------------------------- 1 | package wasi:filesystem@0.2.0; 2 | 3 | interface preopens { 4 | use types.{descriptor}; 5 | 6 | /// Return the set of preopened directories, and their path. 7 | get-directories: func() -> list>; 8 | } 9 | -------------------------------------------------------------------------------- /host-apis/wasi-0.2.0/wit/deps/filesystem/world.wit: -------------------------------------------------------------------------------- 1 | package wasi:filesystem@0.2.0; 2 | 3 | world imports { 4 | import types; 5 | import preopens; 6 | } 7 | -------------------------------------------------------------------------------- /host-apis/wasi-0.2.0/wit/deps/io/world.wit: -------------------------------------------------------------------------------- 1 | package wasi:io@0.2.0; 2 | 3 | world imports { 4 | import streams; 5 | import poll; 6 | } 7 | -------------------------------------------------------------------------------- /host-apis/wasi-0.2.0/wit/deps/random/insecure-seed.wit: -------------------------------------------------------------------------------- 1 | package wasi:random@0.2.0; 2 | /// The insecure-seed interface for seeding hash-map DoS resistance. 3 | /// 4 | /// It is intended to be portable at least between Unix-family platforms and 5 | /// Windows. 6 | interface insecure-seed { 7 | /// Return a 128-bit value that may contain a pseudo-random value. 8 | /// 9 | /// The returned value is not required to be computed from a CSPRNG, and may 10 | /// even be entirely deterministic. Host implementations are encouraged to 11 | /// provide pseudo-random values to any program exposed to 12 | /// attacker-controlled content, to enable DoS protection built into many 13 | /// languages' hash-map implementations. 14 | /// 15 | /// This function is intended to only be called once, by a source language 16 | /// to initialize Denial Of Service (DoS) protection in its hash-map 17 | /// implementation. 18 | /// 19 | /// # Expected future evolution 20 | /// 21 | /// This will likely be changed to a value import, to prevent it from being 22 | /// called multiple times and potentially used for purposes other than DoS 23 | /// protection. 24 | insecure-seed: func() -> tuple; 25 | } 26 | -------------------------------------------------------------------------------- /host-apis/wasi-0.2.0/wit/deps/random/insecure.wit: -------------------------------------------------------------------------------- 1 | package wasi:random@0.2.0; 2 | /// The insecure interface for insecure pseudo-random numbers. 3 | /// 4 | /// It is intended to be portable at least between Unix-family platforms and 5 | /// Windows. 6 | interface insecure { 7 | /// Return `len` insecure pseudo-random bytes. 8 | /// 9 | /// This function is not cryptographically secure. Do not use it for 10 | /// anything related to security. 11 | /// 12 | /// There are no requirements on the values of the returned bytes, however 13 | /// implementations are encouraged to return evenly distributed values with 14 | /// a long period. 15 | get-insecure-random-bytes: func(len: u64) -> list; 16 | 17 | /// Return an insecure pseudo-random `u64` value. 18 | /// 19 | /// This function returns the same type of pseudo-random data as 20 | /// `get-insecure-random-bytes`, represented as a `u64`. 21 | get-insecure-random-u64: func() -> u64; 22 | } 23 | -------------------------------------------------------------------------------- /host-apis/wasi-0.2.0/wit/deps/random/random.wit: -------------------------------------------------------------------------------- 1 | package wasi:random@0.2.0; 2 | /// WASI Random is a random data API. 3 | /// 4 | /// It is intended to be portable at least between Unix-family platforms and 5 | /// Windows. 6 | interface random { 7 | /// Return `len` cryptographically-secure random or pseudo-random bytes. 8 | /// 9 | /// This function must produce data at least as cryptographically secure and 10 | /// fast as an adequately seeded cryptographically-secure pseudo-random 11 | /// number generator (CSPRNG). It must not block, from the perspective of 12 | /// the calling program, under any circumstances, including on the first 13 | /// request and on requests for numbers of bytes. The returned data must 14 | /// always be unpredictable. 15 | /// 16 | /// This function must always return fresh data. Deterministic environments 17 | /// must omit this function, rather than implementing it with deterministic 18 | /// data. 19 | get-random-bytes: func(len: u64) -> list; 20 | 21 | /// Return a cryptographically-secure random or pseudo-random `u64` value. 22 | /// 23 | /// This function returns the same type of data as `get-random-bytes`, 24 | /// represented as a `u64`. 25 | get-random-u64: func() -> u64; 26 | } 27 | -------------------------------------------------------------------------------- /host-apis/wasi-0.2.0/wit/deps/random/world.wit: -------------------------------------------------------------------------------- 1 | package wasi:random@0.2.0; 2 | 3 | world imports { 4 | import random; 5 | import insecure; 6 | import insecure-seed; 7 | } 8 | -------------------------------------------------------------------------------- /host-apis/wasi-0.2.0/wit/deps/sockets/instance-network.wit: -------------------------------------------------------------------------------- 1 | 2 | /// This interface provides a value-export of the default network handle.. 3 | interface instance-network { 4 | use network.{network}; 5 | 6 | /// Get a handle to the default network. 7 | instance-network: func() -> network; 8 | 9 | } 10 | -------------------------------------------------------------------------------- /host-apis/wasi-0.2.0/wit/deps/sockets/world.wit: -------------------------------------------------------------------------------- 1 | package wasi:sockets@0.2.0; 2 | 3 | world imports { 4 | import instance-network; 5 | import network; 6 | import udp; 7 | import udp-create-socket; 8 | import tcp; 9 | import tcp-create-socket; 10 | import ip-name-lookup; 11 | } 12 | -------------------------------------------------------------------------------- /host-apis/wasi-0.2.0/wit/main.wit: -------------------------------------------------------------------------------- 1 | package local:bindings; 2 | 3 | world bindings { 4 | include wasi:cli/command@0.2.0; 5 | include wasi:http/proxy@0.2.0; 6 | } 7 | -------------------------------------------------------------------------------- /host-apis/wasi-0.2.2/bindings/bindings_component_type.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bytecodealliance/StarlingMonkey/4051ee1e72b8c9ae49cc78140529fb6198992760/host-apis/wasi-0.2.2/bindings/bindings_component_type.o -------------------------------------------------------------------------------- /host-apis/wasi-0.2.2/host_api.cmake: -------------------------------------------------------------------------------- 1 | set(WASI_0_2_0 "${HOST_API}/../wasi-0.2.0") 2 | 3 | add_library(host_api STATIC 4 | ${WASI_0_2_0}/host_api.cpp 5 | ${WASI_0_2_0}/host_call.cpp 6 | ${HOST_API}/bindings/bindings.c 7 | ${HOST_API}/bindings/bindings_component_type.o 8 | ) 9 | 10 | target_link_libraries(host_api PRIVATE spidermonkey) 11 | target_include_directories(host_api PRIVATE include) 12 | target_include_directories(host_api PRIVATE ${WASI_0_2_0}) 13 | target_include_directories(host_api PUBLIC ${WASI_0_2_0}/include) 14 | 15 | if (CMAKE_BUILD_TYPE STREQUAL "Debug") 16 | set(ADAPTER "debug") 17 | else() 18 | set(ADAPTER "release") 19 | endif() 20 | set(ADAPTER "${WASI_0_2_0}/preview1-adapter-${ADAPTER}/wasi_snapshot_preview1.wasm") 21 | -------------------------------------------------------------------------------- /host-apis/wasi-0.2.2/wit/command-extended.wit: -------------------------------------------------------------------------------- 1 | // All of the same imports and exports available in the wasi:cli/command world 2 | // with addition of HTTP proxy related imports: 3 | world command-extended { 4 | include wasi:cli/command@0.2.2; 5 | import wasi:http/outgoing-handler@0.2.2; 6 | } 7 | -------------------------------------------------------------------------------- /host-apis/wasi-0.2.2/wit/deps/cli/command.wit: -------------------------------------------------------------------------------- 1 | package wasi:cli@0.2.2; 2 | 3 | @since(version = 0.2.0) 4 | world command { 5 | @since(version = 0.2.0) 6 | include imports; 7 | 8 | @since(version = 0.2.0) 9 | export run; 10 | } 11 | -------------------------------------------------------------------------------- /host-apis/wasi-0.2.2/wit/deps/cli/environment.wit: -------------------------------------------------------------------------------- 1 | @since(version = 0.2.0) 2 | interface environment { 3 | /// Get the POSIX-style environment variables. 4 | /// 5 | /// Each environment variable is provided as a pair of string variable names 6 | /// and string value. 7 | /// 8 | /// Morally, these are a value import, but until value imports are available 9 | /// in the component model, this import function should return the same 10 | /// values each time it is called. 11 | @since(version = 0.2.0) 12 | get-environment: func() -> list>; 13 | 14 | /// Get the POSIX-style arguments to the program. 15 | @since(version = 0.2.0) 16 | get-arguments: func() -> list; 17 | 18 | /// Return a path that programs should use as their initial current working 19 | /// directory, interpreting `.` as shorthand for this. 20 | @since(version = 0.2.0) 21 | initial-cwd: func() -> option; 22 | } 23 | -------------------------------------------------------------------------------- /host-apis/wasi-0.2.2/wit/deps/cli/exit.wit: -------------------------------------------------------------------------------- 1 | @since(version = 0.2.0) 2 | interface exit { 3 | /// Exit the current instance and any linked instances. 4 | @since(version = 0.2.0) 5 | exit: func(status: result); 6 | 7 | /// Exit the current instance and any linked instances, reporting the 8 | /// specified status code to the host. 9 | /// 10 | /// The meaning of the code depends on the context, with 0 usually meaning 11 | /// "success", and other values indicating various types of failure. 12 | /// 13 | /// This function does not return; the effect is analogous to a trap, but 14 | /// without the connotation that something bad has happened. 15 | @unstable(feature = cli-exit-with-code) 16 | exit-with-code: func(status-code: u8); 17 | } 18 | -------------------------------------------------------------------------------- /host-apis/wasi-0.2.2/wit/deps/cli/imports.wit: -------------------------------------------------------------------------------- 1 | package wasi:cli@0.2.2; 2 | 3 | @since(version = 0.2.0) 4 | world imports { 5 | @since(version = 0.2.0) 6 | include wasi:clocks/imports@0.2.2; 7 | @since(version = 0.2.0) 8 | include wasi:filesystem/imports@0.2.2; 9 | @since(version = 0.2.0) 10 | include wasi:sockets/imports@0.2.2; 11 | @since(version = 0.2.0) 12 | include wasi:random/imports@0.2.2; 13 | @since(version = 0.2.0) 14 | include wasi:io/imports@0.2.2; 15 | 16 | @since(version = 0.2.0) 17 | import environment; 18 | @since(version = 0.2.0) 19 | import exit; 20 | @since(version = 0.2.0) 21 | import stdin; 22 | @since(version = 0.2.0) 23 | import stdout; 24 | @since(version = 0.2.0) 25 | import stderr; 26 | @since(version = 0.2.0) 27 | import terminal-input; 28 | @since(version = 0.2.0) 29 | import terminal-output; 30 | @since(version = 0.2.0) 31 | import terminal-stdin; 32 | @since(version = 0.2.0) 33 | import terminal-stdout; 34 | @since(version = 0.2.0) 35 | import terminal-stderr; 36 | } 37 | -------------------------------------------------------------------------------- /host-apis/wasi-0.2.2/wit/deps/cli/run.wit: -------------------------------------------------------------------------------- 1 | @since(version = 0.2.0) 2 | interface run { 3 | /// Run the program. 4 | @since(version = 0.2.0) 5 | run: func() -> result; 6 | } 7 | -------------------------------------------------------------------------------- /host-apis/wasi-0.2.2/wit/deps/cli/stdio.wit: -------------------------------------------------------------------------------- 1 | @since(version = 0.2.0) 2 | interface stdin { 3 | @since(version = 0.2.0) 4 | use wasi:io/streams@0.2.2.{input-stream}; 5 | 6 | @since(version = 0.2.0) 7 | get-stdin: func() -> input-stream; 8 | } 9 | 10 | @since(version = 0.2.0) 11 | interface stdout { 12 | @since(version = 0.2.0) 13 | use wasi:io/streams@0.2.2.{output-stream}; 14 | 15 | @since(version = 0.2.0) 16 | get-stdout: func() -> output-stream; 17 | } 18 | 19 | @since(version = 0.2.0) 20 | interface stderr { 21 | @since(version = 0.2.0) 22 | use wasi:io/streams@0.2.2.{output-stream}; 23 | 24 | @since(version = 0.2.0) 25 | get-stderr: func() -> output-stream; 26 | } 27 | -------------------------------------------------------------------------------- /host-apis/wasi-0.2.2/wit/deps/clocks/world.wit: -------------------------------------------------------------------------------- 1 | package wasi:clocks@0.2.2; 2 | 3 | @since(version = 0.2.0) 4 | world imports { 5 | @since(version = 0.2.0) 6 | import monotonic-clock; 7 | @since(version = 0.2.0) 8 | import wall-clock; 9 | @unstable(feature = clocks-timezone) 10 | import timezone; 11 | } 12 | -------------------------------------------------------------------------------- /host-apis/wasi-0.2.2/wit/deps/filesystem/preopens.wit: -------------------------------------------------------------------------------- 1 | package wasi:filesystem@0.2.2; 2 | 3 | @since(version = 0.2.0) 4 | interface preopens { 5 | @since(version = 0.2.0) 6 | use types.{descriptor}; 7 | 8 | /// Return the set of preopened directories, and their path. 9 | @since(version = 0.2.0) 10 | get-directories: func() -> list>; 11 | } 12 | -------------------------------------------------------------------------------- /host-apis/wasi-0.2.2/wit/deps/filesystem/world.wit: -------------------------------------------------------------------------------- 1 | package wasi:filesystem@0.2.2; 2 | 3 | @since(version = 0.2.0) 4 | world imports { 5 | @since(version = 0.2.0) 6 | import types; 7 | @since(version = 0.2.0) 8 | import preopens; 9 | } 10 | -------------------------------------------------------------------------------- /host-apis/wasi-0.2.2/wit/deps/io/world.wit: -------------------------------------------------------------------------------- 1 | package wasi:io@0.2.2; 2 | 3 | @since(version = 0.2.0) 4 | world imports { 5 | @since(version = 0.2.0) 6 | import streams; 7 | 8 | @since(version = 0.2.0) 9 | import poll; 10 | } 11 | -------------------------------------------------------------------------------- /host-apis/wasi-0.2.2/wit/deps/random/insecure-seed.wit: -------------------------------------------------------------------------------- 1 | package wasi:random@0.2.2; 2 | /// The insecure-seed interface for seeding hash-map DoS resistance. 3 | /// 4 | /// It is intended to be portable at least between Unix-family platforms and 5 | /// Windows. 6 | @since(version = 0.2.0) 7 | interface insecure-seed { 8 | /// Return a 128-bit value that may contain a pseudo-random value. 9 | /// 10 | /// The returned value is not required to be computed from a CSPRNG, and may 11 | /// even be entirely deterministic. Host implementations are encouraged to 12 | /// provide pseudo-random values to any program exposed to 13 | /// attacker-controlled content, to enable DoS protection built into many 14 | /// languages' hash-map implementations. 15 | /// 16 | /// This function is intended to only be called once, by a source language 17 | /// to initialize Denial Of Service (DoS) protection in its hash-map 18 | /// implementation. 19 | /// 20 | /// # Expected future evolution 21 | /// 22 | /// This will likely be changed to a value import, to prevent it from being 23 | /// called multiple times and potentially used for purposes other than DoS 24 | /// protection. 25 | @since(version = 0.2.0) 26 | insecure-seed: func() -> tuple; 27 | } 28 | -------------------------------------------------------------------------------- /host-apis/wasi-0.2.2/wit/deps/random/insecure.wit: -------------------------------------------------------------------------------- 1 | package wasi:random@0.2.2; 2 | /// The insecure interface for insecure pseudo-random numbers. 3 | /// 4 | /// It is intended to be portable at least between Unix-family platforms and 5 | /// Windows. 6 | @since(version = 0.2.0) 7 | interface insecure { 8 | /// Return `len` insecure pseudo-random bytes. 9 | /// 10 | /// This function is not cryptographically secure. Do not use it for 11 | /// anything related to security. 12 | /// 13 | /// There are no requirements on the values of the returned bytes, however 14 | /// implementations are encouraged to return evenly distributed values with 15 | /// a long period. 16 | @since(version = 0.2.0) 17 | get-insecure-random-bytes: func(len: u64) -> list; 18 | 19 | /// Return an insecure pseudo-random `u64` value. 20 | /// 21 | /// This function returns the same type of pseudo-random data as 22 | /// `get-insecure-random-bytes`, represented as a `u64`. 23 | @since(version = 0.2.0) 24 | get-insecure-random-u64: func() -> u64; 25 | } 26 | -------------------------------------------------------------------------------- /host-apis/wasi-0.2.2/wit/deps/random/random.wit: -------------------------------------------------------------------------------- 1 | package wasi:random@0.2.2; 2 | /// WASI Random is a random data API. 3 | /// 4 | /// It is intended to be portable at least between Unix-family platforms and 5 | /// Windows. 6 | @since(version = 0.2.0) 7 | interface random { 8 | /// Return `len` cryptographically-secure random or pseudo-random bytes. 9 | /// 10 | /// This function must produce data at least as cryptographically secure and 11 | /// fast as an adequately seeded cryptographically-secure pseudo-random 12 | /// number generator (CSPRNG). It must not block, from the perspective of 13 | /// the calling program, under any circumstances, including on the first 14 | /// request and on requests for numbers of bytes. The returned data must 15 | /// always be unpredictable. 16 | /// 17 | /// This function must always return fresh data. Deterministic environments 18 | /// must omit this function, rather than implementing it with deterministic 19 | /// data. 20 | @since(version = 0.2.0) 21 | get-random-bytes: func(len: u64) -> list; 22 | 23 | /// Return a cryptographically-secure random or pseudo-random `u64` value. 24 | /// 25 | /// This function returns the same type of data as `get-random-bytes`, 26 | /// represented as a `u64`. 27 | @since(version = 0.2.0) 28 | get-random-u64: func() -> u64; 29 | } 30 | -------------------------------------------------------------------------------- /host-apis/wasi-0.2.2/wit/deps/random/world.wit: -------------------------------------------------------------------------------- 1 | package wasi:random@0.2.2; 2 | 3 | @since(version = 0.2.0) 4 | world imports { 5 | @since(version = 0.2.0) 6 | import random; 7 | 8 | @since(version = 0.2.0) 9 | import insecure; 10 | 11 | @since(version = 0.2.0) 12 | import insecure-seed; 13 | } 14 | -------------------------------------------------------------------------------- /host-apis/wasi-0.2.2/wit/deps/sockets/instance-network.wit: -------------------------------------------------------------------------------- 1 | 2 | /// This interface provides a value-export of the default network handle.. 3 | @since(version = 0.2.0) 4 | interface instance-network { 5 | @since(version = 0.2.0) 6 | use network.{network}; 7 | 8 | /// Get a handle to the default network. 9 | @since(version = 0.2.0) 10 | instance-network: func() -> network; 11 | } 12 | -------------------------------------------------------------------------------- /host-apis/wasi-0.2.2/wit/deps/sockets/world.wit: -------------------------------------------------------------------------------- 1 | package wasi:sockets@0.2.2; 2 | 3 | @since(version = 0.2.0) 4 | world imports { 5 | @since(version = 0.2.0) 6 | import instance-network; 7 | @since(version = 0.2.0) 8 | import network; 9 | @since(version = 0.2.0) 10 | import udp; 11 | @since(version = 0.2.0) 12 | import udp-create-socket; 13 | @since(version = 0.2.0) 14 | import tcp; 15 | @since(version = 0.2.0) 16 | import tcp-create-socket; 17 | @since(version = 0.2.0) 18 | import ip-name-lookup; 19 | } 20 | -------------------------------------------------------------------------------- /host-apis/wasi-0.2.2/wit/main.wit: -------------------------------------------------------------------------------- 1 | package local:bindings; 2 | 3 | world bindings { 4 | include wasi:cli/command@0.2.2; 5 | include wasi:http/proxy@0.2.2; 6 | } 7 | -------------------------------------------------------------------------------- /host-apis/wasi-0.2.3/bindings/bindings_component_type.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bytecodealliance/StarlingMonkey/4051ee1e72b8c9ae49cc78140529fb6198992760/host-apis/wasi-0.2.3/bindings/bindings_component_type.o -------------------------------------------------------------------------------- /host-apis/wasi-0.2.3/host_api.cmake: -------------------------------------------------------------------------------- 1 | set(WASI_0_2_0 "${HOST_API}/../wasi-0.2.0") 2 | 3 | add_library(host_api STATIC 4 | ${WASI_0_2_0}/host_api.cpp 5 | ${WASI_0_2_0}/host_call.cpp 6 | ${HOST_API}/sockets.cpp 7 | ${HOST_API}/bindings/bindings.c 8 | ${HOST_API}/bindings/bindings_component_type.o 9 | ) 10 | 11 | target_link_libraries(host_api PRIVATE spidermonkey) 12 | target_include_directories(host_api PRIVATE include) 13 | target_include_directories(host_api PRIVATE ${WASI_0_2_0}) 14 | target_include_directories(host_api PUBLIC ${WASI_0_2_0}/include) 15 | target_include_directories(host_api PUBLIC ${HOST_API}/include) 16 | 17 | if (CMAKE_BUILD_TYPE STREQUAL "Debug") 18 | set(ADAPTER "debug") 19 | else() 20 | set(ADAPTER "release") 21 | endif() 22 | set(ADAPTER "${WASI_0_2_0}/preview1-adapter-${ADAPTER}/wasi_snapshot_preview1.wasm") 23 | -------------------------------------------------------------------------------- /host-apis/wasi-0.2.3/wit/command-extended.wit: -------------------------------------------------------------------------------- 1 | // All of the same imports and exports available in the wasi:cli/command world 2 | // with addition of HTTP proxy related imports: 3 | world command-extended { 4 | include wasi:cli/command@0.2.3; 5 | import wasi:http/outgoing-handler@0.2.3; 6 | } 7 | -------------------------------------------------------------------------------- /host-apis/wasi-0.2.3/wit/deps/wasi-clocks-0.2.3/package.wit: -------------------------------------------------------------------------------- 1 | package wasi:clocks@0.2.3; 2 | 3 | interface monotonic-clock { 4 | use wasi:io/poll@0.2.3.{pollable}; 5 | 6 | type instant = u64; 7 | 8 | type duration = u64; 9 | 10 | now: func() -> instant; 11 | 12 | resolution: func() -> duration; 13 | 14 | subscribe-instant: func(when: instant) -> pollable; 15 | 16 | subscribe-duration: func(when: duration) -> pollable; 17 | } 18 | 19 | interface wall-clock { 20 | record datetime { 21 | seconds: u64, 22 | nanoseconds: u32, 23 | } 24 | 25 | now: func() -> datetime; 26 | 27 | resolution: func() -> datetime; 28 | } 29 | 30 | -------------------------------------------------------------------------------- /host-apis/wasi-0.2.3/wit/deps/wasi-random-0.2.3/package.wit: -------------------------------------------------------------------------------- 1 | package wasi:random@0.2.3; 2 | 3 | interface random { 4 | get-random-bytes: func(len: u64) -> list; 5 | 6 | get-random-u64: func() -> u64; 7 | } 8 | 9 | interface insecure { 10 | get-insecure-random-bytes: func(len: u64) -> list; 11 | 12 | get-insecure-random-u64: func() -> u64; 13 | } 14 | 15 | interface insecure-seed { 16 | insecure-seed: func() -> tuple; 17 | } 18 | 19 | -------------------------------------------------------------------------------- /host-apis/wasi-0.2.3/wit/main.wit: -------------------------------------------------------------------------------- 1 | package local:bindings; 2 | 3 | world bindings { 4 | include wasi:cli/command@0.2.3; 5 | include wasi:http/proxy@0.2.3; 6 | } 7 | -------------------------------------------------------------------------------- /host-apis/wasi-0.2.3/wkg.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically generated. 2 | # It is not intended for manual editing. 3 | version = 1 4 | 5 | [[packages]] 6 | name = "wasi:cli" 7 | registry = "wasi.dev" 8 | 9 | [[packages.versions]] 10 | requirement = "=0.2.3" 11 | version = "0.2.3" 12 | digest = "sha256:8f97d837e1f856a225422869d5c34752204d1befb5a04d0cd80541aec17a20c1" 13 | 14 | [[packages]] 15 | name = "wasi:http" 16 | registry = "wasi.dev" 17 | 18 | [[packages.versions]] 19 | requirement = "=0.2.3" 20 | version = "0.2.3" 21 | digest = "sha256:e526c1586efc94cd148e33725139be05c4bb58ba20466d348282bd8dc3999f1d" 22 | -------------------------------------------------------------------------------- /runtime/allocator.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "allocator.h" 3 | 4 | JSContext *CONTEXT = nullptr; 5 | 6 | extern "C" { 7 | 8 | __attribute__((weak, export_name("cabi_realloc"))) void *cabi_realloc(void *ptr, size_t orig_size, 9 | size_t _align, size_t new_size) { 10 | if (new_size == orig_size) { 11 | return ptr; 12 | } 13 | return JS_realloc(CONTEXT, ptr, orig_size, new_size); 14 | } 15 | 16 | void cabi_free(void *ptr) { JS_free(CONTEXT, ptr); } 17 | } 18 | -------------------------------------------------------------------------------- /runtime/crates/staticlib-template/Cargo.toml.in: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "rust-staticlib" 3 | edition = "2021" 4 | resolver = "2" 5 | 6 | [lib] 7 | crate-type = ["staticlib"] 8 | path = "rust-staticlib.rs" 9 | 10 | # Prevent inclusion in top-level workspace of the CMake src directory. 11 | [workspace] 12 | 13 | [profile.release] 14 | lto = true 15 | panic = 'abort' 16 | 17 | [profile.dev] 18 | lto = true 19 | panic = 'abort' 20 | 21 | [dependencies] 22 | # Dependencies appended by the CMake build system below here: 23 | -------------------------------------------------------------------------------- /runtime/crates/staticlib-template/rust-staticlib.rs.in: -------------------------------------------------------------------------------- 1 | // Build-system generated use statements for all crates treated as dependencies by the CMake build 2 | // system. 3 | // Instead of compiling all of them to individual static libraries, we will compile them to a single 4 | // one, avoiding issues with duplicated symbols that arise from linking multiple static libraries 5 | // compiled from Rust. 6 | -------------------------------------------------------------------------------- /runtime/debugger.h: -------------------------------------------------------------------------------- 1 | #ifndef DEBUGGER_H 2 | #define DEBUGGER_H 3 | #include "extension-api.h" 4 | 5 | namespace content_debugger { 6 | /** 7 | * Establish a debug connection via a TCP socket and start debugging using a debugger script 8 | * received via the new connection. 9 | * Only active in builds with the `ENABLE_JS_DEBUGGER` CMake option set. 10 | * 11 | * @param content_already_initialized Whether the content script has already run 12 | * 13 | * For more detail on using the Debugger API, see 14 | * https://firefox-source-docs.mozilla.org/js/Debugger/index.html 15 | * 16 | * @return the global object that serves as the debugger 17 | */ 18 | void maybe_init_debugger(api::Engine *engine, bool content_already_initialized); 19 | 20 | /** 21 | * Get the path to a replacement script to evaluate instead of the content script. 22 | * Always returns `false` in builds without the `ENABLE_JS_DEBUGGER` CMake option set. 23 | * 24 | * @return the path to the replacement script, if any 25 | */ 26 | mozilla::Maybe replacement_script_path(); 27 | 28 | bool dbg_print(JSContext *cx, unsigned argc, Value *vp); 29 | } // namespace content_debugger 30 | 31 | #endif // DEBUGGER_H 32 | -------------------------------------------------------------------------------- /runtime/decode.cpp: -------------------------------------------------------------------------------- 1 | #include "encode.h" 2 | 3 | namespace core { 4 | 5 | JSString *decode(JSContext *cx, string_view str) { 6 | JS::UTF8Chars ret_chars(str.data(), str.length()); 7 | return JS_NewStringCopyUTF8N(cx, ret_chars); 8 | } 9 | 10 | JSString *decode_byte_string(JSContext *cx, string_view str) { 11 | JS::UniqueLatin1Chars chars( 12 | static_cast(std::memcpy(malloc(str.size()), str.data(), str.size()))); 13 | return JS_NewLatin1String(cx, std::move(chars), str.length()); 14 | } 15 | 16 | } // namespace core 17 | -------------------------------------------------------------------------------- /runtime/decode.h: -------------------------------------------------------------------------------- 1 | #ifndef JS_COMPUTE_RUNTIME_DECODE_H 2 | #define JS_COMPUTE_RUNTIME_DECODE_H 3 | 4 | namespace core { 5 | 6 | JSString* decode(JSContext *cx, std::string_view str); 7 | JSString* decode_byte_string(JSContext* cx, std::string_view str); 8 | 9 | } // namespace core 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /runtime/encode.h: -------------------------------------------------------------------------------- 1 | #ifndef JS_COMPUTE_RUNTIME_ENCODE_H 2 | #define JS_COMPUTE_RUNTIME_ENCODE_H 3 | 4 | #include "host_api.h" 5 | #include "builtin.h" 6 | 7 | namespace core { 8 | 9 | DEF_ERR(ByteStringEncodingError, JSEXN_TYPEERR, "Cannot convert JS string into byte string", 0) 10 | 11 | // TODO(performance): introduce a version that writes into an existing buffer, 12 | // and use that with the hostcall buffer where possible. 13 | // https://github.com/fastly/js-compute-runtime/issues/215 14 | host_api::HostString encode(JSContext *cx, JS::HandleString str); 15 | host_api::HostString encode(JSContext *cx, JS::HandleValue val); 16 | host_api::HostString encode_byte_string(JSContext *cx, JS::HandleValue val); 17 | 18 | jsurl::SpecString encode_spec_string(JSContext *cx, JS::HandleValue val); 19 | 20 | // Convert the given `value` to a string and ensure that it's a scalar value string 21 | // (https://infra.spec.whatwg.org/#scalar-value-string) 22 | template 23 | JSString* to_scalar_value_string(JSContext* cx, T value) { 24 | auto str = encode(cx, value); 25 | return str ? decode(cx, str) : nullptr; 26 | } 27 | 28 | } // namespace core 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /rust-toolchain.toml: -------------------------------------------------------------------------------- 1 | [toolchain] 2 | channel = "1.80.0" 3 | targets = [ "wasm32-wasip1" ] 4 | profile = "minimal" 5 | -------------------------------------------------------------------------------- /scripts/cxx-wrapper.in: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Clang doesn't support overriding where wasm-opt is found, and CMake doesn't allow overriding 4 | # $PATH for linker/compiler invocations. So we use this script to modify $PATH, and 5 | # scripts/wasm-opt to hide the real wasm-opt from clang. 6 | PATH="${CMAKE_CURRENT_SOURCE_DIR}/scripts:$PATH" ${CMAKE_CXX_COMPILER} "$@" 7 | -------------------------------------------------------------------------------- /scripts/wasm-opt: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # We use this script to hide wasm-opt from clang, which will unconditionally run 4 | # wasm-opt when linking if it's discovered in your path. We'd like tighter 5 | # control over if wasm-opt is run at all, and this script makes it a concrete 6 | # choice in our build system instead. 7 | -------------------------------------------------------------------------------- /tests/e2e/blob/blob.js: -------------------------------------------------------------------------------- 1 | import { strictEqual, throws } from "../../assert.js"; 2 | 3 | async function readAll(blob) { 4 | const reader = blob.stream().getReader(); 5 | let totalBytes = 0; 6 | 7 | while (true) { 8 | const { done, value } = await reader.read(); 9 | if (done) { 10 | break; 11 | } 12 | totalBytes += value.length; 13 | } 14 | 15 | strictEqual(totalBytes, blob.size, "size mismatch"); 16 | } 17 | 18 | addEventListener("fetch", (event) => 19 | event.respondWith( 20 | (async () => { 21 | try { 22 | const len = 10 * 1024 * 1024; // 10 MB 23 | let arr = new Uint8Array(len); 24 | 25 | arr.fill(42); 26 | const blob = new Blob([arr]); 27 | 28 | let counter = 0; 29 | const max = 5; 30 | 31 | const intervalPromise = new Promise((resolve) => { 32 | const intervalId = setInterval(() => { 33 | counter++; 34 | if (counter >= max) { 35 | clearInterval(intervalId); 36 | resolve(); 37 | } 38 | }, 1); 39 | }); 40 | 41 | await Promise.all([readAll(blob), intervalPromise]); 42 | 43 | console.log(`Counter: ${counter}`); 44 | console.log("Finished processing blob."); 45 | 46 | return new Response(`Large Blob`); 47 | } catch (e) { 48 | console.error(e); 49 | } 50 | })(), 51 | ), 52 | ); 53 | -------------------------------------------------------------------------------- /tests/e2e/blob/expect_serve_stdout.txt: -------------------------------------------------------------------------------- 1 | stdout [0] :: Log: Counter: 5 2 | stdout [0] :: Log: Finished processing blob. 3 | -------------------------------------------------------------------------------- /tests/e2e/eventloop-stall/eventloop-stall.js: -------------------------------------------------------------------------------- 1 | import { strictEqual, deepStrictEqual, throws } from "../../assert.js"; 2 | 3 | addEventListener("fetch", (evt) => 4 | evt.respondWith( 5 | (async () => { 6 | return new Response(new ReadableStream({ 7 | start(_controller) { 8 | // stall 9 | }, 10 | })); 11 | })() 12 | ) 13 | ); 14 | -------------------------------------------------------------------------------- /tests/e2e/eventloop-stall/expect_serve_stderr.txt: -------------------------------------------------------------------------------- 1 | stderr [0] :: Warning: JS event loop terminated without completing the request. 2 | -------------------------------------------------------------------------------- /tests/e2e/headers/expect_serve_body.txt: -------------------------------------------------------------------------------- 1 | test -------------------------------------------------------------------------------- /tests/e2e/headers/expect_serve_headers.txt: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | example-header: Header Value 3 | user-agent: test-agent 4 | content-length: 4 5 | content-type: text/plain;charset=UTF-8 6 | set-cookie: A 7 | set-cookie: B 8 | another: A, B 9 | -------------------------------------------------------------------------------- /tests/e2e/headers/expect_serve_stderr.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bytecodealliance/StarlingMonkey/4051ee1e72b8c9ae49cc78140529fb6198992760/tests/e2e/headers/expect_serve_stderr.txt -------------------------------------------------------------------------------- /tests/e2e/headers/headers.js: -------------------------------------------------------------------------------- 1 | import { strictEqual, deepStrictEqual, throws } from "../../assert.js"; 2 | 3 | addEventListener("fetch", (evt) => 4 | evt.respondWith( 5 | (async () => { 6 | strictEqual(evt.request.headers.get("EXAMPLE-HEADER"), "Header Value"); 7 | throws( 8 | () => { 9 | evt.request.headers.delete("user-agent"); 10 | }, 11 | TypeError, 12 | "Headers.delete: Headers are immutable" 13 | ); 14 | const response = new Response("test", { 15 | headers: [...evt.request.headers.entries()].filter( 16 | ([name]) => name !== "content-type" && name !== 'content-length' 17 | ), 18 | }); 19 | 20 | response.headers.append("Set-cookie", "A"); 21 | response.headers.append("Another", "A"); 22 | response.headers.append("set-cookie", "B"); 23 | response.headers.append("another", "B"); 24 | 25 | deepStrictEqual( 26 | [...response.headers], 27 | [ 28 | ["accept", "*/*"], 29 | ["another", "A, B"], 30 | ["content-length", "4"], 31 | ["content-type", "text/plain;charset=UTF-8"], 32 | ["example-header", "Header Value"], 33 | ["set-cookie", "A"], 34 | ["set-cookie", "B"], 35 | ["user-agent", "test-agent"], 36 | ] 37 | ); 38 | response.headers.delete("accept"); 39 | return response; 40 | })() 41 | ) 42 | ); 43 | -------------------------------------------------------------------------------- /tests/e2e/init-script/expect_serve_stdout.txt: -------------------------------------------------------------------------------- 1 | stdout [0] :: Log: foo 2 | -------------------------------------------------------------------------------- /tests/e2e/init-script/init-script.js: -------------------------------------------------------------------------------- 1 | import { func } from "builtinMod"; 2 | async function handle(event) { 3 | console.log(func()); 4 | return new Response(func()); 5 | } 6 | 7 | //@ts-ignore 8 | addEventListener('fetch', (event) => { event.respondWith(handle(event)) }); 9 | -------------------------------------------------------------------------------- /tests/e2e/init-script/init.js: -------------------------------------------------------------------------------- 1 | const builtinMod = { 2 | func() { 3 | return 'foo'; 4 | } 5 | } 6 | 7 | defineBuiltinModule('builtinMod', builtinMod); 8 | if (typeof print !== 'undefined') 9 | print("initialization done"); 10 | -------------------------------------------------------------------------------- /tests/e2e/multi-stream-forwarding/expect_serve_body.txt: -------------------------------------------------------------------------------- 1 | This sentence will be streamed in chunks. 2 | -------------------------------------------------------------------------------- /tests/e2e/runtime-err/expect_serve_status.txt: -------------------------------------------------------------------------------- 1 | 500 -------------------------------------------------------------------------------- /tests/e2e/runtime-err/expect_serve_stderr.txt: -------------------------------------------------------------------------------- 1 | stderr [0] :: Error while running request handler: runtime error 2 | stderr [0] :: Stack: 3 | stderr [0] :: @e2e/runtime-err/runtime-err.js:6:13 4 | stderr [0] :: @e2e/runtime-err/runtime-err.js:7:7 5 | stderr [0] :: 6 | stderr [0] :: Caused by: error cause 7 | stderr [0] :: Stack: 8 | stderr [0] :: @e2e/runtime-err/runtime-err.js:6:49 9 | stderr [0] :: @e2e/runtime-err/runtime-err.js:7:7 10 | stderr [0] :: 11 | -------------------------------------------------------------------------------- /tests/e2e/runtime-err/runtime-err.js: -------------------------------------------------------------------------------- 1 | import { strictEqual, deepStrictEqual, throws } from "../../assert.js"; 2 | 3 | addEventListener("fetch", (evt) => 4 | evt.respondWith( 5 | (async () => { 6 | throw new Error('runtime error', { cause: new Error('error cause') }); 7 | })() 8 | ) 9 | ); 10 | -------------------------------------------------------------------------------- /tests/e2e/smoke/expect_serve_stdout.txt: -------------------------------------------------------------------------------- 1 | stdout [0] :: Log: chaining to /chained 2 | stdout [1] :: Log: post resp [object Response] 3 | -------------------------------------------------------------------------------- /tests/e2e/smoke/nested-smoke-dependency.js: -------------------------------------------------------------------------------- 1 | console.log("nested-smoke-dependency.js loaded"); 2 | -------------------------------------------------------------------------------- /tests/e2e/smoke/smoke-dependency.js: -------------------------------------------------------------------------------- 1 | import "./nested-smoke-dependency"; 2 | 3 | console.log("smoke-dependency.js loaded"); 4 | 5 | export class Foo { 6 | constructor() { 7 | console.log("Foo constructor"); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/e2e/stream-forwarding/expect_serve_body.txt: -------------------------------------------------------------------------------- 1 | hello 2 | world 3 | -------------------------------------------------------------------------------- /tests/e2e/stream-forwarding/stream-forwarding.js: -------------------------------------------------------------------------------- 1 | addEventListener('fetch', async (event) => { 2 | try { 3 | if (event.request.url.endsWith('/nested')) { 4 | let encoder = new TextEncoder(); 5 | let body = new TransformStream({ 6 | start(controller) { 7 | }, 8 | transform(chunk, controller) { 9 | controller.enqueue(encoder.encode(chunk)); 10 | }, 11 | flush(controller) { 12 | } 13 | }); 14 | let writer = body.writable.getWriter(); 15 | event.respondWith(new Response(body.readable)); 16 | await writer.write('hello\n'); 17 | await writer.write('world\n'); 18 | writer.close(); 19 | return; 20 | } 21 | 22 | let resolve; 23 | event.respondWith(new Promise((r) => resolve = r)); 24 | let response = await fetch(event.request.url + 'nested'); 25 | resolve(new Response(response.body, response)); 26 | } catch (e) { 27 | console.error(e); 28 | } 29 | }); 30 | -------------------------------------------------------------------------------- /tests/e2e/syntax-err/expect_wizer_fail: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bytecodealliance/StarlingMonkey/4051ee1e72b8c9ae49cc78140529fb6198992760/tests/e2e/syntax-err/expect_wizer_fail -------------------------------------------------------------------------------- /tests/e2e/syntax-err/expect_wizer_stderr.txt: -------------------------------------------------------------------------------- 1 | Exception while evaluating top-level script 2 | e2e/syntax-err/syntax-err.js:2:1 SyntaxError: expected expression, got end of script 3 | -------------------------------------------------------------------------------- /tests/e2e/syntax-err/syntax-err.js: -------------------------------------------------------------------------------- 1 | a? 2 | -------------------------------------------------------------------------------- /tests/e2e/teed-stream-as-outgoing-body/expect_serve_body.txt: -------------------------------------------------------------------------------- 1 | Successfully forwarded 2 | -------------------------------------------------------------------------------- /tests/e2e/teed-stream-as-outgoing-body/expect_serve_stdout.txt: -------------------------------------------------------------------------------- 1 | stdout [1] :: Log: [forwarded]: Hello, World! 2 | stdout [0] :: Log: [tee]: Hello, World! 3 | -------------------------------------------------------------------------------- /tests/e2e/teed-stream-as-outgoing-body/teed-stream-as-outgoing-body.js: -------------------------------------------------------------------------------- 1 | addEventListener('fetch', async (event) => { 2 | event.respondWith(handleRequest(event)); 3 | }); 4 | 5 | async function handleRequest(event) { 6 | if (event.request.url.includes('/api/upstream')) { 7 | console.log(`[forwarded]: ${await event.request.text()}`) 8 | return new Response('Successfully forwarded\n'); 9 | } 10 | 11 | let controller; 12 | let stream = new ReadableStream({ 13 | start(c) { 14 | controller = c; 15 | }, 16 | }); 17 | const [forwardStream, logStream] = stream.tee(); 18 | 19 | const forwardRequest = new Request('/api/upstream', { body: forwardStream, method: "POST" }); 20 | 21 | let pending = fetch(forwardRequest); 22 | await controller.enqueue(new TextEncoder().encode("Hello, ")); 23 | await controller.enqueue(new TextEncoder().encode("World!")); 24 | await controller.close(); 25 | const response = await pending; 26 | await logRequestBody(logStream); 27 | return response; 28 | } 29 | 30 | async function logRequestBody(stream) { 31 | let text = ""; 32 | let decoder = new TextDecoder(); 33 | const reader = stream.getReader(); 34 | while (true) { 35 | const { done, value } = await reader.read(); 36 | if (done) break; 37 | text += decoder.decode(value, { stream: true }); 38 | } 39 | text += decoder.decode(new Uint8Array(), { stream: false }); 40 | console.log(`[tee]: ${text}`); 41 | } 42 | -------------------------------------------------------------------------------- /tests/e2e/tla-err/expect_wizer_fail: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bytecodealliance/StarlingMonkey/4051ee1e72b8c9ae49cc78140529fb6198992760/tests/e2e/tla-err/expect_wizer_fail -------------------------------------------------------------------------------- /tests/e2e/tla-err/expect_wizer_stderr.txt: -------------------------------------------------------------------------------- 1 | Exception while evaluating top-level script 2 | e2e/tla-err/tla-err.js:3:10 Error: blah 3 | -------------------------------------------------------------------------------- /tests/e2e/tla-err/tla-err.js: -------------------------------------------------------------------------------- 1 | let reject; 2 | Promise.resolve().then(() => { 3 | reject(new Error('blah')); 4 | }); 5 | 6 | await new Promise((_, _reject) => void (reject = _reject)); 7 | -------------------------------------------------------------------------------- /tests/e2e/tla-runtime-resolve/expect_serve_body.txt: -------------------------------------------------------------------------------- 1 | hello world -------------------------------------------------------------------------------- /tests/e2e/tla-runtime-resolve/expect_serve_stdout.txt: -------------------------------------------------------------------------------- 1 | stdout [0] :: Log: YO 2 | -------------------------------------------------------------------------------- /tests/e2e/tla-runtime-resolve/tla-runtime-resolve.js: -------------------------------------------------------------------------------- 1 | let resolve; 2 | Promise.resolve().then(() => { 3 | resolve(); 4 | }); 5 | 6 | await new Promise(_resolve => void (resolve = _resolve)); 7 | 8 | let runtimePromiseResolve; 9 | let runtimePromise = new Promise(resolve => runtimePromiseResolve = resolve); 10 | 11 | addEventListener('fetch', evt => evt.respondWith((async () => { 12 | runtimePromiseResolve(); 13 | return new Response(`hello world`, { headers: { hello: 'world' }}); 14 | })())); 15 | 16 | await runtimePromise; 17 | 18 | console.log('YO'); 19 | -------------------------------------------------------------------------------- /tests/e2e/tla/expect_serve_body.txt: -------------------------------------------------------------------------------- 1 | hello world -------------------------------------------------------------------------------- /tests/e2e/tla/tla.js: -------------------------------------------------------------------------------- 1 | let resolve; 2 | Promise.resolve().then(() => { 3 | resolve(); 4 | }); 5 | 6 | await new Promise(_resolve => void (resolve = _resolve)); 7 | 8 | addEventListener('fetch', evt => evt.respondWith((async () => { 9 | return new Response(`hello world`, { headers: { hello: 'world' }}); 10 | })())); 11 | -------------------------------------------------------------------------------- /tests/integration/handlers.js: -------------------------------------------------------------------------------- 1 | export { handler as blob } from './blob/blob.js'; 2 | export { handler as btoa } from './btoa/btoa.js'; 3 | export { handler as performance } from './performance/performance.js'; 4 | export { handler as crypto } from './crypto/crypto.js'; 5 | export { handler as timers } from './timers/timers.js'; 6 | export { handler as fetch } from './fetch/fetch.js'; 7 | -------------------------------------------------------------------------------- /tests/wpt-harness/build-wpt-runtime.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -euo pipefail 4 | 5 | componentize_flags="${COMPONENTIZE_FLAGS:-}" 6 | 7 | if [ -z "${WPT_ROOT:-}" ]; then 8 | echo "The WPT_ROOT environment variable is not set" 9 | exit 1 10 | fi 11 | 12 | script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" 13 | 14 | inputs=( 15 | "${script_dir}/pre-harness.js" 16 | "${WPT_ROOT}/resources/testharness.js" 17 | "${script_dir}/post-harness.js" 18 | ) 19 | 20 | cat "${inputs[@]}" > wpt-test-runner.js 21 | ./componentize.sh $componentize_flags --verbose --legacy-script wpt-test-runner.js wpt-runtime.wasm 22 | -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/FileAPI/blob/Blob-array-buffer.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Blob.arrayBuffer()": { 3 | "status": "PASS" 4 | }, 5 | "Blob.arrayBuffer() empty Blob data": { 6 | "status": "PASS" 7 | }, 8 | "Blob.arrayBuffer() non-ascii input": { 9 | "status": "PASS" 10 | }, 11 | "Blob.arrayBuffer() non-unicode input": { 12 | "status": "PASS" 13 | }, 14 | "Blob.arrayBuffer() concurrent reads": { 15 | "status": "PASS" 16 | } 17 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/FileAPI/blob/Blob-bytes.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Blob.bytes()": { 3 | "status": "PASS" 4 | }, 5 | "Blob.bytes() empty Blob data": { 6 | "status": "PASS" 7 | }, 8 | "Blob.bytes() non-ascii input": { 9 | "status": "PASS" 10 | }, 11 | "Blob.bytes() non-unicode input": { 12 | "status": "PASS" 13 | }, 14 | "Blob.bytes() concurrent reads": { 15 | "status": "PASS" 16 | } 17 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/FileAPI/blob/Blob-constructor-dom.window.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Passing platform objects for blobParts should throw a TypeError.": { 3 | "status": "FAIL" 4 | }, 5 | "A platform object that supports indexed properties should be treated as a sequence for the blobParts argument (overwritten 'length'.)": { 6 | "status": "FAIL" 7 | }, 8 | "Passing an platform object that supports indexed properties as the blobParts array should work (select).": { 9 | "status": "FAIL" 10 | }, 11 | "Passing an platform object that supports indexed properties as the blobParts array should work (attributes).": { 12 | "status": "FAIL" 13 | } 14 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/FileAPI/blob/Blob-slice-overflow.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "slice start is negative, relativeStart will be max((size + start), 0)": { 3 | "status": "PASS" 4 | }, 5 | "slice start is greater than blob size, relativeStart will be min(start, size)": { 6 | "status": "PASS" 7 | }, 8 | "slice end is negative, relativeEnd will be max((size + end), 0)": { 9 | "status": "PASS" 10 | }, 11 | "slice end is greater than blob size, relativeEnd will be min(end, size)": { 12 | "status": "PASS" 13 | } 14 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/FileAPI/blob/Blob-stream.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Blob.stream()": { 3 | "status": "PASS" 4 | }, 5 | "Blob.stream() empty Blob": { 6 | "status": "PASS" 7 | }, 8 | "Blob.stream() non-unicode input": { 9 | "status": "PASS" 10 | }, 11 | "Blob.stream() garbage collection of blob shouldn't break stream consumption": { 12 | "status": "PASS" 13 | }, 14 | "Blob.stream() garbage collection of stream shouldn't break stream consumption": { 15 | "status": "PASS" 16 | }, 17 | "Reading Blob.stream() with BYOB reader": { 18 | "status": "FAIL" 19 | } 20 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/FileAPI/blob/Blob-text.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Blob.text()": { 3 | "status": "PASS" 4 | }, 5 | "Blob.text() empty blob data": { 6 | "status": "PASS" 7 | }, 8 | "Blob.text() multi-element array in constructor": { 9 | "status": "PASS" 10 | }, 11 | "Blob.text() non-unicode": { 12 | "status": "PASS" 13 | }, 14 | "Blob.text() different charset param in type option": { 15 | "status": "PASS" 16 | }, 17 | "Blob.text() different charset param with non-ascii input": { 18 | "status": "PASS" 19 | }, 20 | "Blob.text() invalid utf-8 input": { 21 | "status": "PASS" 22 | }, 23 | "Blob.text() concurrent reads": { 24 | "status": "PASS" 25 | } 26 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/FileAPI/file/send-file-formdata-utf-8.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Upload file-for-upload-in-form.txt (ASCII) in fetch with FormData": { 3 | "status": "PASS" 4 | }, 5 | "Upload file-for-upload-in-form-.txt (x-user-defined) in fetch with FormData": { 6 | "status": "PASS" 7 | }, 8 | "Upload file-for-upload-in-form-☺😂.txt (windows-1252) in fetch with FormData": { 9 | "status": "PASS" 10 | }, 11 | "Upload file-for-upload-in-form-★星★.txt (JIS X 0201 and JIS X 0208) in fetch with FormData": { 12 | "status": "PASS" 13 | }, 14 | "Upload file-for-upload-in-form-☺😂.txt (Unicode) in fetch with FormData": { 15 | "status": "PASS" 16 | }, 17 | "Upload file-for-upload-in-form-ABC~‾¥≈¤・・•∙·☼★星🌟星★☼·∙•・・¤≈¥‾~XYZ.txt (Unicode) in fetch with FormData": { 18 | "status": "PASS" 19 | } 20 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/FileAPI/file/send-file-formdata.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Upload file-for-upload-in-form.txt (ASCII) in fetch with FormData": { 3 | "status": "PASS" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/WebCryptoAPI/randomUUID.https.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "namespace format": { 3 | "status": "PASS" 4 | }, 5 | "version set": { 6 | "status": "PASS" 7 | }, 8 | "variant set": { 9 | "status": "PASS" 10 | } 11 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/compression/compression-constructor-error.tentative.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "\"a\" should cause the constructor to throw": { 3 | "status": "PASS" 4 | }, 5 | "no input should cause the constructor to throw": { 6 | "status": "PASS" 7 | }, 8 | "non-string input should cause the constructor to throw": { 9 | "status": "PASS" 10 | } 11 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/compression/compression-including-empty-chunk.tentative.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "the result of compressing [,Hello,Hello] with deflate should be 'HelloHello'": { 3 | "status": "PASS" 4 | }, 5 | "the result of compressing [,Hello,Hello] with gzip should be 'HelloHello'": { 6 | "status": "PASS" 7 | }, 8 | "the result of compressing [,Hello,Hello] with deflate-raw should be 'HelloHello'": { 9 | "status": "PASS" 10 | }, 11 | "the result of compressing [Hello,,Hello] with deflate should be 'HelloHello'": { 12 | "status": "PASS" 13 | }, 14 | "the result of compressing [Hello,,Hello] with gzip should be 'HelloHello'": { 15 | "status": "PASS" 16 | }, 17 | "the result of compressing [Hello,,Hello] with deflate-raw should be 'HelloHello'": { 18 | "status": "PASS" 19 | }, 20 | "the result of compressing [Hello,Hello,] with deflate should be 'HelloHello'": { 21 | "status": "PASS" 22 | }, 23 | "the result of compressing [Hello,Hello,] with gzip should be 'HelloHello'": { 24 | "status": "PASS" 25 | }, 26 | "the result of compressing [Hello,Hello,] with deflate-raw should be 'HelloHello'": { 27 | "status": "PASS" 28 | } 29 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/compression/compression-large-flush-output.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "deflate compression with large flush output": { 3 | "status": "PASS" 4 | }, 5 | "gzip compression with large flush output": { 6 | "status": "PASS" 7 | }, 8 | "deflate-raw compression with large flush output": { 9 | "status": "PASS" 10 | } 11 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/compression/compression-output-length.tentative.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "the length of deflated data should be shorter than that of the original data": { 3 | "status": "PASS" 4 | }, 5 | "the length of gzipped data should be shorter than that of the original data": { 6 | "status": "PASS" 7 | }, 8 | "the length of deflated (with -raw) data should be shorter than that of the original data": { 9 | "status": "PASS" 10 | } 11 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/compression/compression-stream.tentative.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "CompressionStream constructor should throw on invalid format": { 3 | "status": "PASS" 4 | }, 5 | "deflated empty data should be reinflated back to its origin": { 6 | "status": "PASS" 7 | }, 8 | "deflated small amount data should be reinflated back to its origin": { 9 | "status": "PASS" 10 | }, 11 | "deflated large amount data should be reinflated back to its origin": { 12 | "status": "PASS" 13 | }, 14 | "gzipped empty data should be reinflated back to its origin": { 15 | "status": "PASS" 16 | }, 17 | "gzipped small amount data should be reinflated back to its origin": { 18 | "status": "PASS" 19 | }, 20 | "gzipped large amount data should be reinflated back to its origin": { 21 | "status": "PASS" 22 | } 23 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/compression/compression-with-detach.tentative.window.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "data should be correctly compressed even if input is detached partway": { 3 | "status": "PASS" 4 | } 5 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/compression/decompression-constructor-error.tentative.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "\"a\" should cause the constructor to throw": { 3 | "status": "PASS" 4 | }, 5 | "no input should cause the constructor to throw": { 6 | "status": "PASS" 7 | }, 8 | "non-string input should cause the constructor to throw": { 9 | "status": "PASS" 10 | } 11 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/compression/decompression-correct-input.tentative.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "decompressing deflated input should work": { 3 | "status": "PASS" 4 | }, 5 | "decompressing gzip input should work": { 6 | "status": "PASS" 7 | }, 8 | "decompressing deflated (with -raw) input should work": { 9 | "status": "PASS" 10 | } 11 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/compression/decompression-empty-input.tentative.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "decompressing gzip empty input should work": { 3 | "status": "PASS" 4 | }, 5 | "decompressing deflate empty input should work": { 6 | "status": "PASS" 7 | }, 8 | "decompressing deflate-raw empty input should work": { 9 | "status": "PASS" 10 | } 11 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/compression/decompression-uint8array-output.tentative.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "decompressing deflated output should give Uint8Array chunks": { 3 | "status": "PASS" 4 | }, 5 | "decompressing gzip output should give Uint8Array chunks": { 6 | "status": "PASS" 7 | } 8 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/compression/decompression-with-detach.tentative.window.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "data should be correctly decompressed even if input is detached partway": { 3 | "status": "PASS" 4 | } 5 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/console/console-is-a-namespace.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "console exists on the global object": { 3 | "status": "PASS" 4 | }, 5 | "console has the right property descriptors": { 6 | "status": "PASS" 7 | }, 8 | "Console (uppercase, as if it were an interface) must not exist": { 9 | "status": "PASS" 10 | }, 11 | "The prototype chain must be correct": { 12 | "status": "PASS" 13 | } 14 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/console/console-label-conversion.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "console.count()'s label gets converted to string via label.toString() when label is an object": { 3 | "status": "PASS" 4 | }, 5 | "console.count() throws exceptions generated by erroneous label.toString() conversion": { 6 | "status": "PASS" 7 | }, 8 | "console.countReset()'s label gets converted to string via label.toString() when label is an object": { 9 | "status": "PASS" 10 | }, 11 | "console.countReset() throws exceptions generated by erroneous label.toString() conversion": { 12 | "status": "PASS" 13 | }, 14 | "console.time()'s label gets converted to string via label.toString() when label is an object": { 15 | "status": "PASS" 16 | }, 17 | "console.time() throws exceptions generated by erroneous label.toString() conversion": { 18 | "status": "PASS" 19 | }, 20 | "console.timeLog()'s label gets converted to string via label.toString() when label is an object": { 21 | "status": "PASS" 22 | }, 23 | "console.timeLog() throws exceptions generated by erroneous label.toString() conversion": { 24 | "status": "PASS" 25 | }, 26 | "console.timeEnd()'s label gets converted to string via label.toString() when label is an object": { 27 | "status": "PASS" 28 | }, 29 | "console.timeEnd() throws exceptions generated by erroneous label.toString() conversion": { 30 | "status": "PASS" 31 | } 32 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/console/console-log-symbol.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging a symbol doesn't throw": { 3 | "status": "PASS" 4 | } 5 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/console/console-namespace-object-class-string.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "@@toStringTag exists on the namespace object with the appropriate descriptor": { 3 | "status": "PASS" 4 | }, 5 | "Object.prototype.toString applied to the namespace object": { 6 | "status": "PASS" 7 | }, 8 | "Object.prototype.toString applied after modifying the namespace object's @@toStringTag": { 9 | "status": "PASS" 10 | }, 11 | "Object.prototype.toString applied after deleting @@toStringTag": { 12 | "status": "PASS" 13 | } 14 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/console/console-tests-historical.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "'timeline' function should not exist on the console object": { 3 | "status": "PASS" 4 | }, 5 | "'timelineEnd' function should not exist on the console object": { 6 | "status": "PASS" 7 | }, 8 | "'markTimeline' function should not exist on the console object": { 9 | "status": "PASS" 10 | } 11 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/encoding/api-basics.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Default encodings": { 3 | "status": "PASS" 4 | }, 5 | "Default inputs": { 6 | "status": "PASS" 7 | }, 8 | "Encode/decode round trip: utf-8": { 9 | "status": "PASS" 10 | }, 11 | "Decode sample: utf-16le": { 12 | "status": "PASS" 13 | }, 14 | "Decode sample: utf-16be": { 15 | "status": "PASS" 16 | }, 17 | "Decode sample: utf-16": { 18 | "status": "PASS" 19 | } 20 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/encoding/api-replacement-encodings.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Label for \"replacement\" should be rejected by API: csiso2022kr": { 3 | "status": "PASS" 4 | }, 5 | "Label for \"replacement\" should be rejected by API: hz-gb-2312": { 6 | "status": "PASS" 7 | }, 8 | "Label for \"replacement\" should be rejected by API: iso-2022-cn": { 9 | "status": "PASS" 10 | }, 11 | "Label for \"replacement\" should be rejected by API: iso-2022-cn-ext": { 12 | "status": "PASS" 13 | }, 14 | "Label for \"replacement\" should be rejected by API: iso-2022-kr": { 15 | "status": "PASS" 16 | }, 17 | "Label for \"replacement\" should be rejected by API: replacement": { 18 | "status": "PASS" 19 | } 20 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/encoding/api-surrogates-utf8.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Invalid surrogates encoded into UTF-8: Sanity check": { 3 | "status": "PASS" 4 | }, 5 | "Invalid surrogates encoded into UTF-8: Surrogate half (low)": { 6 | "status": "PASS" 7 | }, 8 | "Invalid surrogates encoded into UTF-8: Surrogate half (high)": { 9 | "status": "PASS" 10 | }, 11 | "Invalid surrogates encoded into UTF-8: Surrogate half (low), in a string": { 12 | "status": "PASS" 13 | }, 14 | "Invalid surrogates encoded into UTF-8: Surrogate half (high), in a string": { 15 | "status": "PASS" 16 | }, 17 | "Invalid surrogates encoded into UTF-8: Wrong order": { 18 | "status": "PASS" 19 | } 20 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/encoding/replacement-encodings.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "csiso2022kr - non-empty input decodes to one replacement character.": { 3 | "status": "FAIL" 4 | }, 5 | "csiso2022kr - empty input decodes to empty output.": { 6 | "status": "FAIL" 7 | }, 8 | "hz-gb-2312 - non-empty input decodes to one replacement character.": { 9 | "status": "FAIL" 10 | }, 11 | "hz-gb-2312 - empty input decodes to empty output.": { 12 | "status": "FAIL" 13 | }, 14 | "iso-2022-cn - non-empty input decodes to one replacement character.": { 15 | "status": "FAIL" 16 | }, 17 | "iso-2022-cn - empty input decodes to empty output.": { 18 | "status": "FAIL" 19 | }, 20 | "iso-2022-cn-ext - non-empty input decodes to one replacement character.": { 21 | "status": "FAIL" 22 | }, 23 | "iso-2022-cn-ext - empty input decodes to empty output.": { 24 | "status": "FAIL" 25 | }, 26 | "iso-2022-kr - non-empty input decodes to one replacement character.": { 27 | "status": "FAIL" 28 | }, 29 | "iso-2022-kr - empty input decodes to empty output.": { 30 | "status": "FAIL" 31 | }, 32 | "replacement - non-empty input decodes to one replacement character.": { 33 | "status": "FAIL" 34 | }, 35 | "replacement - empty input decodes to empty output.": { 36 | "status": "FAIL" 37 | } 38 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/encoding/textdecoder-arguments.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "TextDecoder decode() with explicit undefined": { 3 | "status": "PASS" 4 | }, 5 | "TextDecoder decode() with undefined and undefined": { 6 | "status": "PASS" 7 | }, 8 | "TextDecoder decode() with undefined and options": { 9 | "status": "PASS" 10 | } 11 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/encoding/textdecoder-byte-order-marks.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Byte-order marks: utf-8": { 3 | "status": "PASS" 4 | }, 5 | "Byte-order marks: utf-16le": { 6 | "status": "PASS" 7 | }, 8 | "Byte-order marks: utf-16be": { 9 | "status": "PASS" 10 | } 11 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/encoding/textdecoder-copy.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Modify buffer after passing it in (ArrayBuffer)": { 3 | "status": "PASS" 4 | }, 5 | "Modify buffer after passing it in (SharedArrayBuffer)": { 6 | "status": "FAIL" 7 | } 8 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/encoding/textdecoder-eof.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "TextDecoder end-of-queue handling": { 3 | "status": "PASS" 4 | }, 5 | "TextDecoder end-of-queue handling using stream: true": { 6 | "status": "PASS" 7 | } 8 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/encoding/textdecoder-fatal-streaming.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Fatal flag, non-streaming cases": { 3 | "status": "PASS" 4 | }, 5 | "Fatal flag, streaming cases": { 6 | "status": "PASS" 7 | } 8 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/encoding/textdecoder-ignorebom.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "BOM is ignored if ignoreBOM option is specified: utf-8": { 3 | "status": "PASS" 4 | }, 5 | "BOM is ignored if ignoreBOM option is specified: utf-16le": { 6 | "status": "PASS" 7 | }, 8 | "BOM is ignored if ignoreBOM option is specified: utf-16be": { 9 | "status": "PASS" 10 | }, 11 | "The ignoreBOM attribute of TextDecoder": { 12 | "status": "PASS" 13 | } 14 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/encoding/textdecoder-utf16-surrogates.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "utf-16le - lone surrogate lead": { 3 | "status": "PASS" 4 | }, 5 | "utf-16le - lone surrogate lead (fatal flag set)": { 6 | "status": "PASS" 7 | }, 8 | "utf-16le - lone surrogate trail": { 9 | "status": "PASS" 10 | }, 11 | "utf-16le - lone surrogate trail (fatal flag set)": { 12 | "status": "PASS" 13 | }, 14 | "utf-16le - unmatched surrogate lead": { 15 | "status": "PASS" 16 | }, 17 | "utf-16le - unmatched surrogate lead (fatal flag set)": { 18 | "status": "PASS" 19 | }, 20 | "utf-16le - unmatched surrogate trail": { 21 | "status": "PASS" 22 | }, 23 | "utf-16le - unmatched surrogate trail (fatal flag set)": { 24 | "status": "PASS" 25 | }, 26 | "utf-16le - swapped surrogate pair": { 27 | "status": "PASS" 28 | }, 29 | "utf-16le - swapped surrogate pair (fatal flag set)": { 30 | "status": "PASS" 31 | } 32 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/encoding/textencoder-utf16-surrogates.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "USVString handling: lone surrogate lead": { 3 | "status": "PASS" 4 | }, 5 | "USVString handling: lone surrogate trail": { 6 | "status": "PASS" 7 | }, 8 | "USVString handling: unmatched surrogate lead": { 9 | "status": "PASS" 10 | }, 11 | "USVString handling: unmatched surrogate trail": { 12 | "status": "PASS" 13 | }, 14 | "USVString handling: swapped surrogate pair": { 15 | "status": "PASS" 16 | }, 17 | "USVString handling: properly encoded MUSICAL SYMBOL G CLEF (U+1D11E)": { 18 | "status": "PASS" 19 | }, 20 | "USVString default": { 21 | "status": "PASS" 22 | } 23 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/encoding/unsupported-encodings.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "UTF-7 should not be supported": { 3 | "status": "FAIL" 4 | }, 5 | "utf-7 should not be supported": { 6 | "status": "FAIL" 7 | }, 8 | "UTF-32 with BOM should decode as UTF-16LE": { 9 | "status": "FAIL" 10 | }, 11 | "UTF-32 with no BOM should decode as UTF-8": { 12 | "status": "FAIL" 13 | }, 14 | "utf-32 with BOM should decode as UTF-16LE": { 15 | "status": "FAIL" 16 | }, 17 | "utf-32 with no BOM should decode as UTF-8": { 18 | "status": "FAIL" 19 | }, 20 | "UTF-32LE with BOM should decode as UTF-16LE": { 21 | "status": "FAIL" 22 | }, 23 | "UTF-32LE with no BOM should decode as UTF-8": { 24 | "status": "FAIL" 25 | }, 26 | "utf-32le with BOM should decode as UTF-16LE": { 27 | "status": "FAIL" 28 | }, 29 | "utf-32le with no BOM should decode as UTF-8": { 30 | "status": "FAIL" 31 | }, 32 | "UTF-32be with no BOM should decode as UTF-8": { 33 | "status": "FAIL" 34 | }, 35 | "UTF-32be with BOM should decode as UTF-8": { 36 | "status": "FAIL" 37 | }, 38 | "utf-32be with no BOM should decode as UTF-8": { 39 | "status": "FAIL" 40 | }, 41 | "utf-32be with BOM should decode as UTF-8": { 42 | "status": "FAIL" 43 | } 44 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/fetch/api/basic/accept-header.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Request through fetch should have 'accept' header with value '*/*'": { 3 | "status": "FAIL" 4 | }, 5 | "Request through fetch should have 'accept' header with value 'custom/*'": { 6 | "status": "PASS" 7 | }, 8 | "Request through fetch should have a 'accept-language' header": { 9 | "status": "FAIL" 10 | }, 11 | "Request through fetch should have 'accept-language' header with value 'bzh'": { 12 | "status": "PASS" 13 | } 14 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/fetch/api/basic/conditional-get.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Testing conditional GET with ETags": { 3 | "status": "FAIL" 4 | } 5 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/fetch/api/basic/header-value-combining.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "response.headers.get('content-length') expects 0": { 3 | "status": "FAIL" 4 | }, 5 | "response.headers.get('content-length') expects 0, 0": { 6 | "status": "FAIL" 7 | }, 8 | "response.headers.get('double-trouble') expects , ": { 9 | "status": "FAIL" 10 | }, 11 | "response.headers.get('foo-test') expects 1, 2, 3": { 12 | "status": "FAIL" 13 | }, 14 | "response.headers.get('heya') expects , \u000b\f, 1, , , 2": { 15 | "status": "FAIL" 16 | }, 17 | "response.headers.get('www-authenticate') expects 1, 2, 3, 4": { 18 | "status": "FAIL" 19 | } 20 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/fetch/api/basic/header-value-null-byte.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Ensure fetch() rejects null bytes in headers": { 3 | "status": "PASS" 4 | } 5 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/fetch/api/basic/historical.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Headers object no longer has a getAll() method": { 3 | "status": "PASS" 4 | }, 5 | "'type' getter should not exist on Request objects": { 6 | "status": "PASS" 7 | }, 8 | "Response object no longer has a trailer getter": { 9 | "status": "PASS" 10 | } 11 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/fetch/api/basic/http-response-code.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Fetch on 425 response should not be retried for non TLS early data.": { 3 | "status": "PASS" 4 | } 5 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/fetch/api/basic/keepalive.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "[keepalive] simple GET request on 'load' [no payload]; setting up": { 3 | "status": "FAIL" 4 | }, 5 | "[keepalive] simple GET request on 'unload' [no payload]; setting up": { 6 | "status": "FAIL" 7 | }, 8 | "[keepalive] simple GET request on 'pagehide' [no payload]; setting up": { 9 | "status": "FAIL" 10 | }, 11 | "[keepalive] simple POST request on 'load' [no payload]; setting up": { 12 | "status": "FAIL" 13 | }, 14 | "[keepalive] simple POST request on 'unload' [no payload]; setting up": { 15 | "status": "FAIL" 16 | }, 17 | "[keepalive] simple POST request on 'pagehide' [no payload]; setting up": { 18 | "status": "FAIL" 19 | }, 20 | "simple keepalive test for web workers;": { 21 | "status": "FAIL" 22 | } 23 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/fetch/api/basic/mode-same-origin.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Fetch ../resources/top.txt with same-origin mode": { 3 | "status": "PASS" 4 | }, 5 | "Fetch http://web-platform.test:8000/fetch/api/resources/top.txt with same-origin mode": { 6 | "status": "PASS" 7 | }, 8 | "Fetch https://web-platform.test:8443/fetch/api/resources/top.txt with same-origin mode": { 9 | "status": "PASS" 10 | }, 11 | "Fetch http://www1.web-platform.test:8000/fetch/api/resources/top.txt with same-origin mode": { 12 | "status": "FAIL" 13 | }, 14 | "Fetch /fetch/api/basic/../resources/redirect.py?location=../resources/top.txt with same-origin mode": { 15 | "status": "FAIL" 16 | }, 17 | "Fetch /fetch/api/basic/../resources/redirect.py?location=http://web-platform.test:8000/fetch/api/resources/top.txt with same-origin mode": { 18 | "status": "FAIL" 19 | }, 20 | "Fetch /fetch/api/basic/../resources/redirect.py?location=https://web-platform.test:8443/fetch/api/resources/top.txt with same-origin mode": { 21 | "status": "FAIL" 22 | }, 23 | "Fetch /fetch/api/basic/../resources/redirect.py?location=http://www1.web-platform.test:8000/fetch/api/resources/top.txt with same-origin mode": { 24 | "status": "FAIL" 25 | } 26 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/fetch/api/basic/referrer.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "origin-when-cross-origin policy on a same-origin URL": { 3 | "status": "FAIL" 4 | }, 5 | "origin-when-cross-origin policy on a cross-origin URL": { 6 | "status": "FAIL" 7 | }, 8 | "origin-when-cross-origin policy on a cross-origin URL after same-origin redirection": { 9 | "status": "FAIL" 10 | }, 11 | "origin-when-cross-origin policy on a same-origin URL after cross-origin redirection": { 12 | "status": "FAIL" 13 | }, 14 | "Referrer with credentials should be stripped": { 15 | "status": "FAIL" 16 | }, 17 | "Referrer with fragment ID should be stripped": { 18 | "status": "FAIL" 19 | } 20 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/fetch/api/basic/request-head.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Fetch with HEAD with body": { 3 | "status": "PASS" 4 | } 5 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/fetch/api/basic/request-headers-case.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Multiple headers with the same name, different case (THIS-is-A-test first)": { 3 | "status": "FAIL" 4 | }, 5 | "Multiple headers with the same name, different case (THIS-IS-A-TEST first)": { 6 | "status": "FAIL" 7 | } 8 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/fetch/api/basic/request-headers-nonascii.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Non-ascii bytes in request headers": { 3 | "status": "PASS" 4 | } 5 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/fetch/api/basic/request-referrer.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "about:client referrer": { 3 | "status": "FAIL" 4 | }, 5 | "url referrer": { 6 | "status": "FAIL" 7 | } 8 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/fetch/api/basic/response-null-body.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Response.body is null for responses with status=204 (method=GET)": { 3 | "status": "PASS" 4 | }, 5 | "Response.body is null for responses with status=204 (method=POST)": { 6 | "status": "PASS" 7 | }, 8 | "Response.body is null for responses with status=204 (method=OPTIONS)": { 9 | "status": "PASS" 10 | }, 11 | "Response.body is null for responses with status=205 (method=GET)": { 12 | "status": "PASS" 13 | }, 14 | "Response.body is null for responses with status=205 (method=POST)": { 15 | "status": "PASS" 16 | }, 17 | "Response.body is null for responses with status=205 (method=OPTIONS)": { 18 | "status": "PASS" 19 | }, 20 | "Response.body is null for responses with status=304 (method=GET)": { 21 | "status": "PASS" 22 | }, 23 | "Response.body is null for responses with status=304 (method=POST)": { 24 | "status": "PASS" 25 | }, 26 | "Response.body is null for responses with status=304 (method=OPTIONS)": { 27 | "status": "PASS" 28 | }, 29 | "Response.body is null for responses with method=HEAD": { 30 | "status": "FAIL" 31 | }, 32 | "Null body status with subresource integrity should abort": { 33 | "status": "PASS" 34 | } 35 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/fetch/api/basic/response-url.sub.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Testing response url getter with http://web-platform.test:8000/ada": { 3 | "status": "PASS" 4 | }, 5 | "Testing response url getter with http://web-platform.test:8000/#": { 6 | "status": "FAIL" 7 | }, 8 | "Testing response url getter with http://web-platform.test:8000/#ada": { 9 | "status": "FAIL" 10 | }, 11 | "Testing response url getter with http://web-platform.test:8000#ada": { 12 | "status": "FAIL" 13 | } 14 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/fetch/api/basic/scheme-about.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Fetching about:blank with method GET is KO": { 3 | "status": "FAIL" 4 | }, 5 | "Fetching about:blank with method PUT is KO": { 6 | "status": "FAIL" 7 | }, 8 | "Fetching about:blank with method POST is KO": { 9 | "status": "FAIL" 10 | }, 11 | "Fetching about:invalid.com with method GET is KO": { 12 | "status": "FAIL" 13 | }, 14 | "Fetching about:config with method GET is KO": { 15 | "status": "FAIL" 16 | }, 17 | "Fetching about:unicorn with method GET is KO": { 18 | "status": "FAIL" 19 | }, 20 | "Fetching about:blank with range header does not affect behavior": { 21 | "status": "FAIL" 22 | } 23 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/fetch/api/basic/scheme-data.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Fetching data:,response%27s%20body is OK": { 3 | "status": "FAIL" 4 | }, 5 | "Fetching data:,response%27s%20body is OK (same-origin)": { 6 | "status": "FAIL" 7 | }, 8 | "Fetching data:,response%27s%20body is OK (cors)": { 9 | "status": "FAIL" 10 | }, 11 | "Fetching data:text/plain;base64,cmVzcG9uc2UncyBib[...] is OK": { 12 | "status": "FAIL" 13 | }, 14 | "Fetching data:image/png;base64,cmVzcG9uc2UncyBib2[...] is OK": { 15 | "status": "FAIL" 16 | }, 17 | "Fetching [POST] data:,response%27s%20body is OK": { 18 | "status": "FAIL" 19 | }, 20 | "Fetching [HEAD] data:,response%27s%20body is OK": { 21 | "status": "FAIL" 22 | }, 23 | "Fetching [GET] data:notAdataUrl.com is KO": { 24 | "status": "FAIL" 25 | } 26 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/fetch/api/basic/status.h2.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "statusText over H2 for status 200 should be the empty string": { 3 | "status": "FAIL" 4 | }, 5 | "statusText over H2 for status 210 should be the empty string": { 6 | "status": "PASS" 7 | }, 8 | "statusText over H2 for status 400 should be the empty string": { 9 | "status": "FAIL" 10 | }, 11 | "statusText over H2 for status 404 should be the empty string": { 12 | "status": "FAIL" 13 | }, 14 | "statusText over H2 for status 410 should be the empty string": { 15 | "status": "FAIL" 16 | }, 17 | "statusText over H2 for status 500 should be the empty string": { 18 | "status": "FAIL" 19 | }, 20 | "statusText over H2 for status 502 should be the empty string": { 21 | "status": "FAIL" 22 | } 23 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/fetch/api/basic/stream-response.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Stream response's body when content-type is present": { 3 | "status": "PASS" 4 | }, 5 | "Stream response's body when content-type is not present": { 6 | "status": "PASS" 7 | } 8 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/fetch/api/body/cloned-any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "FormData is cloned": { 3 | "status": "FAIL" 4 | }, 5 | "URLSearchParams is cloned": { 6 | "status": "FAIL" 7 | }, 8 | "TypedArray is cloned": { 9 | "status": "PASS" 10 | }, 11 | "ArrayBuffer is cloned": { 12 | "status": "PASS" 13 | }, 14 | "Blob is cloned": { 15 | "status": "PASS" 16 | } 17 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/fetch/api/body/formdata.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Consume empty response.formData() as FormData": { 3 | "status": "PASS" 4 | }, 5 | "Consume empty request.formData() as FormData": { 6 | "status": "PASS" 7 | }, 8 | "Consume multipart/form-data headers case-insensitively": { 9 | "status": "FAIL" 10 | } 11 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/fetch/api/headers/header-values.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "fetch() with value x%00x needs to throw": { 3 | "status": "PASS" 4 | }, 5 | "fetch() with value x%0Ax needs to throw": { 6 | "status": "PASS" 7 | }, 8 | "fetch() with value x%0Dx needs to throw": { 9 | "status": "PASS" 10 | }, 11 | "fetch() with all valid values": { 12 | "status": "FAIL" 13 | } 14 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/fetch/api/headers/headers-casing.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Create headers, names use characters with different case": { 3 | "status": "PASS" 4 | }, 5 | "Check append method, names use characters with different case": { 6 | "status": "PASS" 7 | }, 8 | "Check set method, names use characters with different case": { 9 | "status": "PASS" 10 | }, 11 | "Check delete method, names use characters with different case": { 12 | "status": "PASS" 13 | } 14 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/fetch/api/headers/headers-combine.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Create headers using same name for different values": { 3 | "status": "PASS" 4 | }, 5 | "Check delete and has methods when using same name for different values": { 6 | "status": "PASS" 7 | }, 8 | "Check set methods when called with already used name": { 9 | "status": "PASS" 10 | }, 11 | "Check append methods when called with already used name": { 12 | "status": "PASS" 13 | }, 14 | "Iterate combined values": { 15 | "status": "PASS" 16 | }, 17 | "Iterate combined values in sorted order": { 18 | "status": "PASS" 19 | } 20 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/fetch/api/headers/headers-normalize.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Create headers with not normalized values": { 3 | "status": "PASS" 4 | }, 5 | "Check append method with not normalized values": { 6 | "status": "PASS" 7 | }, 8 | "Check set method with not normalized values": { 9 | "status": "PASS" 10 | } 11 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/fetch/api/headers/headers-record.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Passing nothing to Headers constructor": { 3 | "status": "PASS" 4 | }, 5 | "Passing undefined to Headers constructor": { 6 | "status": "PASS" 7 | }, 8 | "Passing null to Headers constructor": { 9 | "status": "PASS" 10 | }, 11 | "Basic operation with one property": { 12 | "status": "PASS" 13 | }, 14 | "Basic operation with one property and a proto": { 15 | "status": "PASS" 16 | }, 17 | "Correct operation ordering with two properties": { 18 | "status": "PASS" 19 | }, 20 | "Correct operation ordering with two properties one of which has an invalid name": { 21 | "status": "PASS" 22 | }, 23 | "Correct operation ordering with two properties one of which has an invalid value": { 24 | "status": "PASS" 25 | }, 26 | "Correct operation ordering with non-enumerable properties": { 27 | "status": "PASS" 28 | }, 29 | "Correct operation ordering with undefined descriptors": { 30 | "status": "PASS" 31 | }, 32 | "Correct operation ordering with repeated keys": { 33 | "status": "PASS" 34 | }, 35 | "Basic operation with Symbol keys": { 36 | "status": "PASS" 37 | }, 38 | "Operation with non-enumerable Symbol keys": { 39 | "status": "PASS" 40 | } 41 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/fetch/api/headers/headers-structure.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Headers has append method": { 3 | "status": "PASS" 4 | }, 5 | "Headers has delete method": { 6 | "status": "PASS" 7 | }, 8 | "Headers has get method": { 9 | "status": "PASS" 10 | }, 11 | "Headers has has method": { 12 | "status": "PASS" 13 | }, 14 | "Headers has set method": { 15 | "status": "PASS" 16 | }, 17 | "Headers has entries method": { 18 | "status": "PASS" 19 | }, 20 | "Headers has keys method": { 21 | "status": "PASS" 22 | }, 23 | "Headers has values method": { 24 | "status": "PASS" 25 | } 26 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/fetch/api/redirect/redirect-back-to-original-origin.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "original => remote => original with mode: \"no-cors\"": { 3 | "status": "FAIL" 4 | }, 5 | "original => remote => original with mode: \"cors\"": { 6 | "status": "FAIL" 7 | } 8 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/fetch/api/redirect/redirect-count.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Redirect 301 20 times": { 3 | "status": "FAIL" 4 | }, 5 | "Redirect 301 21 times": { 6 | "status": "FAIL" 7 | }, 8 | "Redirect 302 20 times": { 9 | "status": "FAIL" 10 | }, 11 | "Redirect 302 21 times": { 12 | "status": "FAIL" 13 | }, 14 | "Redirect 303 20 times": { 15 | "status": "FAIL" 16 | }, 17 | "Redirect 303 21 times": { 18 | "status": "FAIL" 19 | }, 20 | "Redirect 307 20 times": { 21 | "status": "FAIL" 22 | }, 23 | "Redirect 307 21 times": { 24 | "status": "FAIL" 25 | }, 26 | "Redirect 308 20 times": { 27 | "status": "FAIL" 28 | }, 29 | "Redirect 308 21 times": { 30 | "status": "FAIL" 31 | } 32 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/fetch/api/redirect/redirect-empty-location.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "redirect response with empty Location, follow mode": { 3 | "status": "FAIL" 4 | }, 5 | "redirect response with empty Location, manual mode": { 6 | "status": "FAIL" 7 | } 8 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/fetch/api/redirect/redirect-keepalive.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "[keepalive][new window][unload] same-origin redirect; setting up": { 3 | "status": "FAIL" 4 | }, 5 | "[keepalive][new window][unload] same-origin redirect + preflight; setting up": { 6 | "status": "FAIL" 7 | }, 8 | "[keepalive][new window][unload] cross-origin redirect; setting up": { 9 | "status": "FAIL" 10 | }, 11 | "[keepalive][new window][unload] cross-origin redirect + preflight; setting up": { 12 | "status": "FAIL" 13 | }, 14 | "[keepalive][new window][unload] redirect to file URL; setting up": { 15 | "status": "FAIL" 16 | }, 17 | "[keepalive][new window][unload] redirect to data URL; setting up": { 18 | "status": "FAIL" 19 | } 20 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/fetch/api/redirect/redirect-keepalive.https.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "[keepalive][iframe][load] mixed content redirect; setting up": { 3 | "status": "FAIL" 4 | } 5 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/fetch/api/redirect/redirect-location-escape.tentative.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Redirect to escaped UTF-8": { 3 | "status": "FAIL" 4 | }, 5 | "Redirect to unescaped UTF-8": { 6 | "status": "FAIL" 7 | }, 8 | "Redirect to escaped and unescaped UTF-8": { 9 | "status": "FAIL" 10 | }, 11 | "Escaping produces double-percent": { 12 | "status": "FAIL" 13 | }, 14 | "Redirect to invalid UTF-8": { 15 | "status": "FAIL" 16 | } 17 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/fetch/api/redirect/redirect-method.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Response.redirected should be false on not-redirected responses": { 3 | "status": "PASS" 4 | }, 5 | "Redirect 301 with GET": { 6 | "status": "FAIL" 7 | }, 8 | "Redirect 301 with POST": { 9 | "status": "FAIL" 10 | }, 11 | "Redirect 301 with HEAD": { 12 | "status": "FAIL" 13 | }, 14 | "Redirect 302 with GET": { 15 | "status": "FAIL" 16 | }, 17 | "Redirect 302 with POST": { 18 | "status": "FAIL" 19 | }, 20 | "Redirect 302 with HEAD": { 21 | "status": "FAIL" 22 | }, 23 | "Redirect 303 with GET": { 24 | "status": "FAIL" 25 | }, 26 | "Redirect 303 with POST": { 27 | "status": "FAIL" 28 | }, 29 | "Redirect 303 with HEAD": { 30 | "status": "FAIL" 31 | }, 32 | "Redirect 303 with TESTING": { 33 | "status": "FAIL" 34 | }, 35 | "Redirect 307 with GET": { 36 | "status": "FAIL" 37 | }, 38 | "Redirect 307 with POST (string body)": { 39 | "status": "FAIL" 40 | }, 41 | "Redirect 307 with POST (blob body)": { 42 | "status": "FAIL" 43 | }, 44 | "Redirect 307 with HEAD": { 45 | "status": "FAIL" 46 | } 47 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/fetch/api/redirect/redirect-schemes.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "redirect-schemes": { 3 | "status": "FAIL" 4 | }, 5 | "redirect-schemes 1": { 6 | "status": "FAIL" 7 | }, 8 | "redirect-schemes 2": { 9 | "status": "FAIL" 10 | }, 11 | "redirect-schemes 3": { 12 | "status": "FAIL" 13 | }, 14 | "redirect-schemes 4": { 15 | "status": "FAIL" 16 | }, 17 | "redirect-schemes 5": { 18 | "status": "FAIL" 19 | } 20 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/fetch/api/redirect/redirect-to-dataurl.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Testing data URL loading after same-origin redirection (cors mode)": { 3 | "status": "FAIL" 4 | }, 5 | "Testing data URL loading after same-origin redirection (no-cors mode)": { 6 | "status": "FAIL" 7 | }, 8 | "Testing data URL loading after same-origin redirection (same-origin mode)": { 9 | "status": "FAIL" 10 | }, 11 | "Testing data URL loading after cross-origin redirection (cors mode)": { 12 | "status": "FAIL" 13 | }, 14 | "Testing data URL loading after cross-origin redirection (no-cors mode)": { 15 | "status": "FAIL" 16 | } 17 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/fetch/api/redirect/redirect-upload.h2.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Fetch upload streaming should be accepted on 303": { 3 | "status": "FAIL" 4 | }, 5 | "Fetch upload streaming should fail on 301": { 6 | "status": "FAIL" 7 | }, 8 | "Fetch upload streaming should fail on 302": { 9 | "status": "FAIL" 10 | }, 11 | "Fetch upload streaming should fail on 307": { 12 | "status": "FAIL" 13 | }, 14 | "Fetch upload streaming should fail on 308": { 15 | "status": "FAIL" 16 | } 17 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/fetch/api/request/forbidden-method.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Request() with a forbidden method CONNECT must throw.": { 3 | "status": "FAIL" 4 | }, 5 | "Request() with a forbidden method TRACE must throw.": { 6 | "status": "FAIL" 7 | }, 8 | "Request() with a forbidden method TRACK must throw.": { 9 | "status": "FAIL" 10 | }, 11 | "Request() with a forbidden method connect must throw.": { 12 | "status": "FAIL" 13 | }, 14 | "Request() with a forbidden method trace must throw.": { 15 | "status": "FAIL" 16 | }, 17 | "Request() with a forbidden method track must throw.": { 18 | "status": "FAIL" 19 | } 20 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/fetch/api/request/request-cache-no-cache.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "RequestCache \"no-cache\" mode revalidates stale responses found in the cache with Etag and stale response": { 3 | "status": "PASS" 4 | }, 5 | "RequestCache \"no-cache\" mode revalidates stale responses found in the cache with Last-Modified and stale response": { 6 | "status": "PASS" 7 | }, 8 | "RequestCache \"no-cache\" mode revalidates fresh responses found in the cache with Etag and fresh response": { 9 | "status": "PASS" 10 | }, 11 | "RequestCache \"no-cache\" mode revalidates fresh responses found in the cache with Last-Modified and fresh response": { 12 | "status": "PASS" 13 | } 14 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/fetch/api/request/request-constructor-init-body-override.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Check that the body of a new request can be overridden when created from an existing Request object": { 3 | "status": "PASS" 4 | }, 5 | "Check that the body of a new request can be duplicated from an existing Request object": { 6 | "status": "PASS" 7 | } 8 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/fetch/api/request/request-consume-empty.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Consume request's body as text": { 3 | "status": "PASS" 4 | }, 5 | "Consume request's body as blob": { 6 | "status": "PASS" 7 | }, 8 | "Consume request's body as arrayBuffer": { 9 | "status": "PASS" 10 | }, 11 | "Consume request's body as json (error case)": { 12 | "status": "PASS" 13 | }, 14 | "Consume request's body as formData with correct multipart type (error case)": { 15 | "status": "FAIL" 16 | }, 17 | "Consume request's body as formData with correct urlencoded type": { 18 | "status": "PASS" 19 | }, 20 | "Consume request's body as formData without correct type (error case)": { 21 | "status": "PASS" 22 | }, 23 | "Consume empty blob request body as arrayBuffer": { 24 | "status": "PASS" 25 | }, 26 | "Consume empty text request body as arrayBuffer": { 27 | "status": "PASS" 28 | }, 29 | "Consume empty blob request body as text": { 30 | "status": "PASS" 31 | }, 32 | "Consume empty text request body as text": { 33 | "status": "PASS" 34 | }, 35 | "Consume empty URLSearchParams request body as text": { 36 | "status": "PASS" 37 | }, 38 | "Consume empty FormData request body as text": { 39 | "status": "PASS" 40 | }, 41 | "Consume empty ArrayBuffer request body as text": { 42 | "status": "PASS" 43 | } 44 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/fetch/api/request/request-disturbed.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Request's body: initial state": { 3 | "status": "PASS" 4 | }, 5 | "Request without body cannot be disturbed": { 6 | "status": "PASS" 7 | }, 8 | "Check cloning a disturbed request": { 9 | "status": "FAIL" 10 | }, 11 | "Check creating a new request from a disturbed request": { 12 | "status": "PASS" 13 | }, 14 | "Check creating a new request with a new body from a disturbed request": { 15 | "status": "PASS" 16 | }, 17 | "Input request used for creating new request became disturbed": { 18 | "status": "FAIL" 19 | }, 20 | "Input request used for creating new request became disturbed even if body is not used": { 21 | "status": "FAIL" 22 | }, 23 | "Check consuming a disturbed request": { 24 | "status": "PASS" 25 | }, 26 | "Request construction failure should not set \"bodyUsed\"": { 27 | "status": "FAIL" 28 | } 29 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/fetch/api/request/request-init-002.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Initialize Request with headers values": { 3 | "status": "PASS" 4 | }, 5 | "Initialize Request's body with \"undefined\", undefined": { 6 | "status": "PASS" 7 | }, 8 | "Initialize Request's body with \"null\", null": { 9 | "status": "PASS" 10 | }, 11 | "Initialize Request's body with \"[object Blob]\", application/octet-binary": { 12 | "status": "PASS" 13 | }, 14 | "Initialize Request's body with \"[object Object]\", multipart/form-data": { 15 | "status": "PASS" 16 | }, 17 | "Initialize Request's body with \"This is a USVString\", text/plain;charset=UTF-8": { 18 | "status": "PASS" 19 | }, 20 | "Initialize Request's body with \"hi!\", text/plain;charset=UTF-8": { 21 | "status": "PASS" 22 | }, 23 | "Initialize Request's body with \"name=value\", application/x-www-form-urlencoded;charset=UTF-8": { 24 | "status": "PASS" 25 | } 26 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/fetch/api/request/request-init-priority.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "new Request() with a 'high' priority does not throw an error": { 3 | "status": "PASS" 4 | }, 5 | "new Request() with a 'low' priority does not throw an error": { 6 | "status": "PASS" 7 | }, 8 | "new Request() with a 'auto' priority does not throw an error": { 9 | "status": "PASS" 10 | }, 11 | "new Request() throws a TypeError if any of RequestInit's members' values are invalid": { 12 | "status": "FAIL" 13 | }, 14 | "fetch() with a 'high' priority completes successfully": { 15 | "status": "PASS" 16 | }, 17 | "fetch() with a 'low' priority completes successfully": { 18 | "status": "PASS" 19 | }, 20 | "fetch() with a 'auto' priority completes successfully": { 21 | "status": "PASS" 22 | }, 23 | "fetch() with an invalid priority returns a rejected promise with a TypeError": { 24 | "status": "FAIL" 25 | } 26 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/fetch/api/request/request-keepalive.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "keepalive flag": { 3 | "status": "FAIL" 4 | }, 5 | "keepalive flag with stream body": { 6 | "status": "FAIL" 7 | } 8 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/fetch/api/response/json.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Ensure the correct JSON parser is used": { 3 | "status": "FAIL" 4 | }, 5 | "Ensure UTF-16 results in an error": { 6 | "status": "FAIL" 7 | } 8 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/fetch/api/response/response-blob-realm.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "realm of the Uint8Array from Response bytes()": { 3 | "status": "FAIL" 4 | } 5 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/fetch/api/response/response-cancel-stream.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Cancelling a starting blob Response stream": { 3 | "status": "PASS" 4 | }, 5 | "Cancelling a loading blob Response stream": { 6 | "status": "PASS" 7 | }, 8 | "Cancelling a closed blob Response stream": { 9 | "status": "PASS" 10 | }, 11 | "Cancelling a starting Response stream": { 12 | "status": "PASS" 13 | }, 14 | "Cancelling a loading Response stream": { 15 | "status": "PASS" 16 | }, 17 | "Cancelling a closed Response stream": { 18 | "status": "PASS" 19 | }, 20 | "Accessing .body after canceling it": { 21 | "status": "PASS" 22 | } 23 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/fetch/api/response/response-consume-empty.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Consume response's body as text": { 3 | "status": "PASS" 4 | }, 5 | "Consume response's body as blob": { 6 | "status": "PASS" 7 | }, 8 | "Consume response's body as arrayBuffer": { 9 | "status": "PASS" 10 | }, 11 | "Consume response's body as json (error case)": { 12 | "status": "PASS" 13 | }, 14 | "Consume response's body as formData with correct multipart type (error case)": { 15 | "status": "FAIL" 16 | }, 17 | "Consume response's body as formData with correct urlencoded type": { 18 | "status": "PASS" 19 | }, 20 | "Consume response's body as formData without correct type (error case)": { 21 | "status": "PASS" 22 | }, 23 | "Consume empty blob response body as arrayBuffer": { 24 | "status": "PASS" 25 | }, 26 | "Consume empty text response body as arrayBuffer": { 27 | "status": "PASS" 28 | }, 29 | "Consume empty blob response body as text": { 30 | "status": "PASS" 31 | }, 32 | "Consume empty text response body as text": { 33 | "status": "PASS" 34 | }, 35 | "Consume empty URLSearchParams response body as text": { 36 | "status": "PASS" 37 | }, 38 | "Consume empty FormData response body as text": { 39 | "status": "PASS" 40 | }, 41 | "Consume empty ArrayBuffer response body as text": { 42 | "status": "PASS" 43 | } 44 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/fetch/api/response/response-error.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Throws RangeError when responseInit's status is 0": { 3 | "status": "PASS" 4 | }, 5 | "Throws RangeError when responseInit's status is 100": { 6 | "status": "PASS" 7 | }, 8 | "Throws RangeError when responseInit's status is 199": { 9 | "status": "PASS" 10 | }, 11 | "Throws RangeError when responseInit's status is 600": { 12 | "status": "PASS" 13 | }, 14 | "Throws RangeError when responseInit's status is 1000": { 15 | "status": "PASS" 16 | }, 17 | "Throws TypeError when responseInit's statusText is \n": { 18 | "status": "FAIL" 19 | }, 20 | "Throws TypeError when responseInit's statusText is Ā": { 21 | "status": "FAIL" 22 | }, 23 | "Throws TypeError when building a response with body and a body status of 204": { 24 | "status": "PASS" 25 | }, 26 | "Throws TypeError when building a response with body and a body status of 205": { 27 | "status": "PASS" 28 | }, 29 | "Throws TypeError when building a response with body and a body status of 304": { 30 | "status": "PASS" 31 | } 32 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/fetch/api/response/response-from-stream.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Constructing a Response with a stream on which getReader() is called": { 3 | "status": "PASS" 4 | }, 5 | "Constructing a Response with a stream on which read() is called": { 6 | "status": "PASS" 7 | }, 8 | "Constructing a Response with a stream on which read() and releaseLock() are called": { 9 | "status": "PASS" 10 | } 11 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/fetch/api/response/response-headers-guard.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Ensure response headers are immutable": { 3 | "status": "PASS" 4 | } 5 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/fetch/api/response/response-init-001.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Check default value for type attribute": { 3 | "status": "PASS" 4 | }, 5 | "Check default value for url attribute": { 6 | "status": "PASS" 7 | }, 8 | "Check default value for ok attribute": { 9 | "status": "PASS" 10 | }, 11 | "Check default value for status attribute": { 12 | "status": "PASS" 13 | }, 14 | "Check default value for statusText attribute": { 15 | "status": "PASS" 16 | }, 17 | "Check default value for body attribute": { 18 | "status": "PASS" 19 | }, 20 | "Check status init values and associated getter": { 21 | "status": "PASS" 22 | }, 23 | "Check statusText init values and associated getter": { 24 | "status": "PASS" 25 | }, 26 | "Test that Response.headers has the [SameObject] extended attribute": { 27 | "status": "PASS" 28 | } 29 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/fetch/api/response/response-init-002.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Initialize Response with headers values": { 3 | "status": "PASS" 4 | }, 5 | "Initialize Response's body with application/octet-binary": { 6 | "status": "PASS" 7 | }, 8 | "Initialize Response's body with multipart/form-data": { 9 | "status": "PASS" 10 | }, 11 | "Initialize Response's body with application/x-www-form-urlencoded;charset=UTF-8": { 12 | "status": "PASS" 13 | }, 14 | "Initialize Response's body with text/plain;charset=UTF-8": { 15 | "status": "PASS" 16 | }, 17 | "Read Response's body as readableStream": { 18 | "status": "PASS" 19 | }, 20 | "Testing empty Response Content-Type header": { 21 | "status": "PASS" 22 | }, 23 | "Testing null Response body": { 24 | "status": "PASS" 25 | } 26 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/fetch/api/response/response-static-error.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Check response returned by static method error()": { 3 | "status": "FAIL" 4 | }, 5 | "the 'guard' of the Headers instance should be immutable": { 6 | "status": "FAIL" 7 | } 8 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/fetch/api/response/response-static-redirect.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Check default redirect response": { 3 | "status": "PASS" 4 | }, 5 | "Check response returned by static method redirect(), status = 301": { 6 | "status": "PASS" 7 | }, 8 | "Check response returned by static method redirect(), status = 302": { 9 | "status": "PASS" 10 | }, 11 | "Check response returned by static method redirect(), status = 303": { 12 | "status": "PASS" 13 | }, 14 | "Check response returned by static method redirect(), status = 307": { 15 | "status": "PASS" 16 | }, 17 | "Check response returned by static method redirect(), status = 308": { 18 | "status": "PASS" 19 | }, 20 | "Check error returned when giving invalid url to redirect()": { 21 | "status": "PASS" 22 | }, 23 | "Check error returned when giving invalid status to redirect(), status = 200": { 24 | "status": "PASS" 25 | }, 26 | "Check error returned when giving invalid status to redirect(), status = 309": { 27 | "status": "PASS" 28 | }, 29 | "Check error returned when giving invalid status to redirect(), status = 400": { 30 | "status": "PASS" 31 | }, 32 | "Check error returned when giving invalid status to redirect(), status = 500": { 33 | "status": "PASS" 34 | } 35 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/fetch/api/response/response-stream-bad-chunk.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "ReadableStream with non-Uint8Array chunk passed to Response.arrayBuffer() causes TypeError": { 3 | "status": "PASS" 4 | }, 5 | "ReadableStream with non-Uint8Array chunk passed to Response.blob() causes TypeError": { 6 | "status": "PASS" 7 | }, 8 | "ReadableStream with non-Uint8Array chunk passed to Response.bytes() causes TypeError": { 9 | "status": "FAIL" 10 | }, 11 | "ReadableStream with non-Uint8Array chunk passed to Response.formData() causes TypeError": { 12 | "status": "PASS" 13 | }, 14 | "ReadableStream with non-Uint8Array chunk passed to Response.json() causes TypeError": { 15 | "status": "PASS" 16 | }, 17 | "ReadableStream with non-Uint8Array chunk passed to Response.text() causes TypeError": { 18 | "status": "PASS" 19 | } 20 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/fetch/api/response/response-stream-disturbed-3.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Getting blob after reading the Response body (body source: fetch)": { 3 | "status": "PASS" 4 | }, 5 | "Getting text after reading the Response body (body source: fetch)": { 6 | "status": "PASS" 7 | }, 8 | "Getting json after reading the Response body (body source: fetch)": { 9 | "status": "PASS" 10 | }, 11 | "Getting arrayBuffer after reading the Response body (body source: fetch)": { 12 | "status": "PASS" 13 | }, 14 | "Getting blob after reading the Response body (body source: stream)": { 15 | "status": "PASS" 16 | }, 17 | "Getting text after reading the Response body (body source: stream)": { 18 | "status": "PASS" 19 | }, 20 | "Getting json after reading the Response body (body source: stream)": { 21 | "status": "PASS" 22 | }, 23 | "Getting arrayBuffer after reading the Response body (body source: stream)": { 24 | "status": "PASS" 25 | }, 26 | "Getting blob after reading the Response body (body source: string)": { 27 | "status": "PASS" 28 | }, 29 | "Getting text after reading the Response body (body source: string)": { 30 | "status": "PASS" 31 | }, 32 | "Getting json after reading the Response body (body source: string)": { 33 | "status": "PASS" 34 | }, 35 | "Getting arrayBuffer after reading the Response body (body source: string)": { 36 | "status": "PASS" 37 | } 38 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/fetch/api/response/response-stream-disturbed-5.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Getting a body reader after consuming as blob (body source: fetch)": { 3 | "status": "FAIL" 4 | }, 5 | "Getting a body reader after consuming as text (body source: fetch)": { 6 | "status": "FAIL" 7 | }, 8 | "Getting a body reader after consuming as json (body source: fetch)": { 9 | "status": "FAIL" 10 | }, 11 | "Getting a body reader after consuming as arrayBuffer (body source: fetch)": { 12 | "status": "FAIL" 13 | }, 14 | "Getting a body reader after consuming as blob (body source: stream)": { 15 | "status": "FAIL" 16 | }, 17 | "Getting a body reader after consuming as text (body source: stream)": { 18 | "status": "FAIL" 19 | }, 20 | "Getting a body reader after consuming as json (body source: stream)": { 21 | "status": "FAIL" 22 | }, 23 | "Getting a body reader after consuming as arrayBuffer (body source: stream)": { 24 | "status": "FAIL" 25 | }, 26 | "Getting a body reader after consuming as blob (body source: string)": { 27 | "status": "FAIL" 28 | }, 29 | "Getting a body reader after consuming as text (body source: string)": { 30 | "status": "FAIL" 31 | }, 32 | "Getting a body reader after consuming as json (body source: string)": { 33 | "status": "FAIL" 34 | }, 35 | "Getting a body reader after consuming as arrayBuffer (body source: string)": { 36 | "status": "FAIL" 37 | } 38 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/fetch/api/response/response-stream-disturbed-6.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "A non-closed stream on which read() has been called": { 3 | "status": "FAIL" 4 | }, 5 | "A non-closed stream on which cancel() has been called": { 6 | "status": "FAIL" 7 | }, 8 | "A closed stream on which read() has been called": { 9 | "status": "FAIL" 10 | }, 11 | "An errored stream on which read() has been called": { 12 | "status": "FAIL" 13 | }, 14 | "An errored stream on which cancel() has been called": { 15 | "status": "FAIL" 16 | } 17 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/fetch/api/response/response-stream-disturbed-by-pipe.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "using pipeTo on Response body should disturb it synchronously": { 3 | "status": "FAIL" 4 | }, 5 | "using pipeThrough on Response body should disturb it synchronously": { 6 | "status": "FAIL" 7 | } 8 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/fetch/api/response/response-stream-with-broken-then.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Attempt to inject {done: false, value: bye} via Object.prototype.then.": { 3 | "status": "PASS" 4 | }, 5 | "Attempt to inject value: undefined via Object.prototype.then.": { 6 | "status": "PASS" 7 | }, 8 | "Attempt to inject undefined via Object.prototype.then.": { 9 | "status": "PASS" 10 | }, 11 | "Attempt to inject 8.2 via Object.prototype.then.": { 12 | "status": "PASS" 13 | }, 14 | "intercepting arraybuffer to text conversion via Object.prototype.then should not be possible": { 15 | "status": "PASS" 16 | }, 17 | "intercepting arraybuffer to body readable stream conversion via Object.prototype.then should not be possible": { 18 | "status": "PASS" 19 | } 20 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/fetch/content-type/multipart-malformed.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Invalid form data should not crash the browser": { 3 | "status": "PASS" 4 | } 5 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/fetch/content-type/multipart.window.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "multipart": { 3 | "status": "PASS" 4 | } 5 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/hr-time/basic.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "self.performance.now() is a function that returns a number": { 3 | "status": "PASS" 4 | }, 5 | "self.performance.now() returns a positive number": { 6 | "status": "PASS" 7 | }, 8 | "self.performance.now() difference is not negative": { 9 | "status": "PASS" 10 | }, 11 | "High resolution time has approximately the right relative magnitude": { 12 | "status": "PASS" 13 | }, 14 | "Performance interface extends EventTarget.": { 15 | "status": "FAIL" 16 | } 17 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/hr-time/monotonic-clock.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "self.performance.now() returns a positive number": { 3 | "status": "PASS" 4 | }, 5 | "self.performance.now() difference is not negative": { 6 | "status": "PASS" 7 | } 8 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/html/webappapis/timers/clearinterval-from-callback.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Clearing an interval from the callback should still clear it.": { 3 | "status": "PASS" 4 | } 5 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/html/webappapis/timers/cleartimeout-clearinterval.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Clear timeout with clearInterval": { 3 | "status": "PASS" 4 | }, 5 | "Clear interval with clearTimeout": { 6 | "status": "PASS" 7 | } 8 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/html/webappapis/timers/missing-timeout-setinterval.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Calling setInterval with no interval should be the same as if called with 0 interval": { 3 | "status": "PASS" 4 | }, 5 | "Calling setInterval with undefined interval should be the same as if called with 0 interval": { 6 | "status": "PASS" 7 | } 8 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/html/webappapis/timers/negative-setinterval.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "negative-setinterval": { 3 | "status": "PASS" 4 | } 5 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/html/webappapis/timers/negative-settimeout.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "negative-settimeout": { 3 | "status": "PASS" 4 | } 5 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/html/webappapis/timers/type-long-setinterval.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "type-long-setinterval": { 3 | "status": "PASS" 4 | } 5 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/html/webappapis/timers/type-long-settimeout.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "type-long-settimeout": { 3 | "status": "PASS" 4 | } 5 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/streams/piping/flow-control.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Piping from a non-empty ReadableStream into a WritableStream that does not desire chunks": { 3 | "status": "PASS" 4 | }, 5 | "Piping from a non-empty ReadableStream into a WritableStream that does not desire chunks, but then does": { 6 | "status": "PASS" 7 | }, 8 | "Piping from an empty ReadableStream into a WritableStream that does not desire chunks, but then the readable stream becomes non-empty and the writable stream starts desiring chunks": { 9 | "status": "PASS" 10 | }, 11 | "Piping from a ReadableStream to a WritableStream that desires more chunks before finishing with previous ones": { 12 | "status": "PASS" 13 | }, 14 | "Piping to a WritableStream that does not consume the writes fast enough exerts backpressure on the ReadableStream": { 15 | "status": "PASS" 16 | } 17 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/streams/piping/general-addition.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "enqueue() must not synchronously call write algorithm": { 3 | "status": "PASS" 4 | } 5 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/streams/piping/multiple-propagation.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Piping from an errored readable stream to an erroring writable stream": { 3 | "status": "PASS" 4 | }, 5 | "Piping from an errored readable stream to an errored writable stream": { 6 | "status": "PASS" 7 | }, 8 | "Piping from an errored readable stream to an erroring writable stream; preventAbort = true": { 9 | "status": "PASS" 10 | }, 11 | "Piping from an errored readable stream to an errored writable stream; preventAbort = true": { 12 | "status": "PASS" 13 | }, 14 | "Piping from an errored readable stream to a closing writable stream": { 15 | "status": "PASS" 16 | }, 17 | "Piping from an errored readable stream to a closed writable stream": { 18 | "status": "PASS" 19 | }, 20 | "Piping from a closed readable stream to an erroring writable stream": { 21 | "status": "PASS" 22 | }, 23 | "Piping from a closed readable stream to an errored writable stream": { 24 | "status": "PASS" 25 | }, 26 | "Piping from a closed readable stream to a closed writable stream": { 27 | "status": "PASS" 28 | } 29 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/streams/piping/then-interception.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "piping should not be observable": { 3 | "status": "PASS" 4 | }, 5 | "tee should not be observable": { 6 | "status": "PASS" 7 | } 8 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/streams/piping/throwing-options.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "pipeTo should stop after getting preventAbort throws": { 3 | "status": "FAIL" 4 | }, 5 | "pipeThrough should stop after getting preventAbort throws": { 6 | "status": "FAIL" 7 | }, 8 | "pipeTo should stop after getting preventCancel throws": { 9 | "status": "FAIL" 10 | }, 11 | "pipeThrough should stop after getting preventCancel throws": { 12 | "status": "FAIL" 13 | }, 14 | "pipeTo should stop after getting preventClose throws": { 15 | "status": "FAIL" 16 | }, 17 | "pipeThrough should stop after getting preventClose throws": { 18 | "status": "FAIL" 19 | }, 20 | "pipeTo should stop after getting signal throws": { 21 | "status": "FAIL" 22 | }, 23 | "pipeThrough should stop after getting signal throws": { 24 | "status": "FAIL" 25 | } 26 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/streams/piping/transform-streams.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Piping through an identity transform stream should close the destination when the source closes": { 3 | "status": "PASS" 4 | } 5 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/streams/readable-byte-streams/enqueue-with-detached-buffer.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "enqueue after detaching byobRequest.view.buffer should throw": { 3 | "status": "PASS" 4 | } 5 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/streams/readable-byte-streams/non-transferable-buffers.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "ReadableStream with byte source: read() with a non-transferable buffer": { 3 | "status": "FAIL" 4 | }, 5 | "ReadableStream with byte source: fill() with a non-transferable buffer": { 6 | "status": "FAIL" 7 | }, 8 | "ReadableStream with byte source: enqueue() with a non-transferable buffer": { 9 | "status": "FAIL" 10 | }, 11 | "ReadableStream with byte source: respondWithNewView() with a non-transferable buffer": { 12 | "status": "FAIL" 13 | } 14 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/streams/readable-byte-streams/respond-after-enqueue.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "byobRequest.respond() after enqueue() should not crash": { 3 | "status": "PASS" 4 | }, 5 | "byobRequest.respond() with cached byobRequest after enqueue() should not crash": { 6 | "status": "PASS" 7 | }, 8 | "byobRequest.respond() after enqueue() with double read should not crash": { 9 | "status": "PASS" 10 | } 11 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/streams/readable-streams/bad-strategies.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Readable stream: throwing strategy.size getter": { 3 | "status": "PASS" 4 | }, 5 | "Readable stream: strategy.size errors the stream and then throws": { 6 | "status": "PASS" 7 | }, 8 | "Readable stream: strategy.size errors the stream and then returns Infinity": { 9 | "status": "PASS" 10 | }, 11 | "Readable stream: throwing strategy.size method": { 12 | "status": "PASS" 13 | }, 14 | "Readable stream: throwing strategy.highWaterMark getter": { 15 | "status": "PASS" 16 | }, 17 | "Readable stream: invalid strategy.highWaterMark": { 18 | "status": "PASS" 19 | }, 20 | "Readable stream: invalid strategy.size return value": { 21 | "status": "PASS" 22 | }, 23 | "Readable stream: invalid strategy.size return value when pulling": { 24 | "status": "PASS" 25 | } 26 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/streams/readable-streams/constructor.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "underlyingSource argument should be converted after queuingStrategy argument": { 3 | "status": "PASS" 4 | } 5 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/streams/readable-streams/count-queuing-strategy-integration.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Can construct a readable stream with a valid CountQueuingStrategy": { 3 | "status": "PASS" 4 | }, 5 | "Correctly governs a ReadableStreamController's desiredSize property (HWM = 0)": { 6 | "status": "PASS" 7 | }, 8 | "Correctly governs a ReadableStreamController's desiredSize property (HWM = 1)": { 9 | "status": "PASS" 10 | }, 11 | "Correctly governs a ReadableStreamController's desiredSize property (HWM = 4)": { 12 | "status": "PASS" 13 | } 14 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/streams/readable-streams/floating-point-total-queue-size.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Floating point arithmetic must manifest near NUMBER.MAX_SAFE_INTEGER (total ends up positive)": { 3 | "status": "PASS" 4 | }, 5 | "Floating point arithmetic must manifest near 0 (total ends up positive, but clamped)": { 6 | "status": "PASS" 7 | }, 8 | "Floating point arithmetic must manifest near 0 (total ends up positive, and not clamped)": { 9 | "status": "PASS" 10 | }, 11 | "Floating point arithmetic must manifest near 0 (total ends up zero)": { 12 | "status": "PASS" 13 | } 14 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/streams/readable-streams/garbage-collection.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "ReadableStreamController methods should continue working properly when scripts lose their reference to the readable stream": { 3 | "status": "PASS" 4 | }, 5 | "ReadableStream closed promise should fulfill even if the stream and reader JS references are lost": { 6 | "status": "PASS" 7 | }, 8 | "ReadableStream closed promise should reject even if stream and reader JS references are lost": { 9 | "status": "PASS" 10 | }, 11 | "Garbage-collecting a ReadableStreamDefaultReader should not unlock its stream": { 12 | "status": "PASS" 13 | } 14 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/streams/readable-streams/owning-type-message-port.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Transferred MessageChannel works as expected": { 3 | "status": "FAIL" 4 | }, 5 | "Second branch of owning ReadableStream tee should end up into errors with transfer only values": { 6 | "status": "FAIL" 7 | } 8 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/streams/readable-streams/owning-type-video-frame.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "ReadableStream of type owning should close serialized chunks": { 3 | "status": "FAIL" 4 | }, 5 | "ReadableStream of type owning should transfer JS chunks with transferred values": { 6 | "status": "FAIL" 7 | }, 8 | "ReadableStream of type owning should error when trying to enqueue not serializable values": { 9 | "status": "FAIL" 10 | }, 11 | "ReadableStream of type owning should clone serializable objects when teeing": { 12 | "status": "FAIL" 13 | }, 14 | "ReadableStream of type owning should clone JS Objects with serializables when teeing": { 15 | "status": "FAIL" 16 | } 17 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/streams/readable-streams/owning-type.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "ReadableStream can be constructed with owning type": { 3 | "status": "FAIL" 4 | }, 5 | "ReadableStream of type owning should call start with a ReadableStreamDefaultController": { 6 | "status": "FAIL" 7 | }, 8 | "ReadableStream should be able to call enqueue with an empty transfer list": { 9 | "status": "FAIL" 10 | }, 11 | "ReadableStream should check transfer parameter": { 12 | "status": "FAIL" 13 | }, 14 | "ReadableStream of type owning should transfer enqueued chunks": { 15 | "status": "FAIL" 16 | } 17 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/streams/readable-streams/patched-global.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "ReadableStream tee() should not touch Object.prototype properties": { 3 | "status": "PASS" 4 | }, 5 | "ReadableStream tee() should not call the global ReadableStream": { 6 | "status": "PASS" 7 | }, 8 | "ReadableStream async iterator should use the original values of getReader() and ReadableStreamDefaultReader methods": { 9 | "status": "FAIL" 10 | }, 11 | "tee() should not call Promise.prototype.then()": { 12 | "status": "PASS" 13 | }, 14 | "pipeTo() should not call Promise.prototype.then()": { 15 | "status": "PASS" 16 | } 17 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/streams/readable-streams/reentrant-strategies.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "enqueue() inside size() should work": { 3 | "status": "PASS" 4 | }, 5 | "close() inside size() should not crash": { 6 | "status": "PASS" 7 | }, 8 | "close request inside size() should work": { 9 | "status": "PASS" 10 | }, 11 | "error() inside size() should work": { 12 | "status": "PASS" 13 | }, 14 | "desiredSize inside size() should work": { 15 | "status": "PASS" 16 | }, 17 | "cancel() inside size() should work": { 18 | "status": "PASS" 19 | }, 20 | "pipeTo() inside size() should behave as expected": { 21 | "status": "PASS" 22 | }, 23 | "read() inside of size() should behave as expected": { 24 | "status": "PASS" 25 | }, 26 | "getReader() inside size() should work": { 27 | "status": "PASS" 28 | }, 29 | "tee() inside size() should work": { 30 | "status": "PASS" 31 | } 32 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/streams/transform-streams/cancel.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "cancelling the readable side should call transformer.cancel()": { 3 | "status": "FAIL" 4 | }, 5 | "cancelling the readable side should reject if transformer.cancel() throws": { 6 | "status": "FAIL" 7 | }, 8 | "aborting the writable side should call transformer.abort()": { 9 | "status": "FAIL" 10 | }, 11 | "aborting the writable side should reject if transformer.cancel() throws": { 12 | "status": "FAIL" 13 | }, 14 | "closing the writable side should reject if a parallel transformer.cancel() throws": { 15 | "status": "FAIL" 16 | }, 17 | "readable.cancel() and a parallel writable.close() should reject if a transformer.cancel() calls controller.error()": { 18 | "status": "FAIL" 19 | }, 20 | "writable.abort() and readable.cancel() should reject if a transformer.cancel() calls controller.error()": { 21 | "status": "FAIL" 22 | } 23 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/streams/transform-streams/flush.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "TransformStream flush is called immediately when the writable is closed, if no writes are queued": { 3 | "status": "PASS" 4 | }, 5 | "TransformStream flush is called after all queued writes finish, once the writable is closed": { 6 | "status": "PASS" 7 | }, 8 | "TransformStream flush gets a chance to enqueue more into the readable": { 9 | "status": "PASS" 10 | }, 11 | "TransformStream flush gets a chance to enqueue more into the readable, and can then async close": { 12 | "status": "PASS" 13 | }, 14 | "error() during flush should cause writer.close() to reject": { 15 | "status": "PASS" 16 | }, 17 | "closing the writable side should call transformer.flush() and a parallel readable.cancel() should not reject": { 18 | "status": "PASS" 19 | } 20 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/streams/transform-streams/patched-global.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "TransformStream constructor should not call setters for highWaterMark or size": { 3 | "status": "PASS" 4 | }, 5 | "TransformStream should use the original value of ReadableStream and WritableStream": { 6 | "status": "PASS" 7 | } 8 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/streams/transform-streams/properties.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "transformer method start should be called with the right number of arguments": { 3 | "status": "PASS" 4 | }, 5 | "transformer method start should be called even when it's located on the prototype chain": { 6 | "status": "PASS" 7 | }, 8 | "transformer method transform should be called with the right number of arguments": { 9 | "status": "PASS" 10 | }, 11 | "transformer method transform should be called even when it's located on the prototype chain": { 12 | "status": "PASS" 13 | }, 14 | "transformer method flush should be called with the right number of arguments": { 15 | "status": "PASS" 16 | }, 17 | "transformer method flush should be called even when it's located on the prototype chain": { 18 | "status": "PASS" 19 | } 20 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/streams/transform-streams/reentrant-strategies.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "enqueue() inside size() should work": { 3 | "status": "PASS" 4 | }, 5 | "terminate() inside size() should work": { 6 | "status": "PASS" 7 | }, 8 | "error() inside size() should work": { 9 | "status": "PASS" 10 | }, 11 | "desiredSize inside size() should work": { 12 | "status": "PASS" 13 | }, 14 | "readable cancel() inside size() should work": { 15 | "status": "PASS" 16 | }, 17 | "pipeTo() inside size() should work": { 18 | "status": "PASS" 19 | }, 20 | "read() inside of size() should work": { 21 | "status": "PASS" 22 | }, 23 | "writer.write() inside size() should work": { 24 | "status": "PASS" 25 | }, 26 | "synchronous writer.write() inside size() should work": { 27 | "status": "PASS" 28 | }, 29 | "writer.close() inside size() should work": { 30 | "status": "PASS" 31 | }, 32 | "writer.abort() inside size() should work": { 33 | "status": "FAIL" 34 | } 35 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/streams/transform-streams/strategies.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "writableStrategy highWaterMark should work": { 3 | "status": "PASS" 4 | }, 5 | "readableStrategy highWaterMark should work": { 6 | "status": "PASS" 7 | }, 8 | "writable should have the correct size() function": { 9 | "status": "PASS" 10 | }, 11 | "default writable strategy should be equivalent to { highWaterMark: 1 }": { 12 | "status": "PASS" 13 | }, 14 | "default readable strategy should be equivalent to { highWaterMark: 0 }": { 15 | "status": "PASS" 16 | }, 17 | "a RangeError should be thrown for an invalid highWaterMark": { 18 | "status": "FAIL" 19 | }, 20 | "writableStrategy highWaterMark should be converted to a number": { 21 | "status": "PASS" 22 | }, 23 | "readableStrategy highWaterMark should be converted to a number": { 24 | "status": "PASS" 25 | }, 26 | "a bad readableStrategy size function should cause writer.write() to reject on an identity transform": { 27 | "status": "PASS" 28 | }, 29 | "a bad readableStrategy size function should error the stream on enqueue even when transformer.transform() catches the exception": { 30 | "status": "PASS" 31 | } 32 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/streams/transform-streams/terminate.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "controller.terminate() should error pipeTo()": { 3 | "status": "PASS" 4 | }, 5 | "controller.terminate() should prevent remaining chunks from being processed": { 6 | "status": "PASS" 7 | }, 8 | "controller.enqueue() should throw after controller.terminate()": { 9 | "status": "PASS" 10 | }, 11 | "controller.error() after controller.terminate() with queued chunk should error the readable": { 12 | "status": "PASS" 13 | }, 14 | "controller.error() after controller.terminate() without queued chunk should do nothing": { 15 | "status": "PASS" 16 | }, 17 | "controller.terminate() inside flush() should not prevent writer.close() from succeeding": { 18 | "status": "PASS" 19 | } 20 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/streams/writable-streams/bad-strategies.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Writable stream: throwing strategy.size getter": { 3 | "status": "PASS" 4 | }, 5 | "reject any non-function value for strategy.size": { 6 | "status": "PASS" 7 | }, 8 | "Writable stream: throwing strategy.highWaterMark getter": { 9 | "status": "PASS" 10 | }, 11 | "Writable stream: invalid strategy.highWaterMark": { 12 | "status": "PASS" 13 | }, 14 | "Writable stream: throwing strategy.size method": { 15 | "status": "PASS" 16 | }, 17 | "Writable stream: invalid strategy.size return value": { 18 | "status": "PASS" 19 | }, 20 | "Writable stream: invalid size beats invalid highWaterMark": { 21 | "status": "PASS" 22 | } 23 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/streams/writable-streams/byte-length-queuing-strategy.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Closing a writable stream with in-flight writes below the high water mark delays the close call properly": { 3 | "status": "PASS" 4 | } 5 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/streams/writable-streams/constructor.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "controller argument should be passed to start method": { 3 | "status": "PASS" 4 | }, 5 | "controller argument should be passed to write method": { 6 | "status": "PASS" 7 | }, 8 | "controller argument should not be passed to close method": { 9 | "status": "PASS" 10 | }, 11 | "highWaterMark should be reflected to desiredSize": { 12 | "status": "PASS" 13 | }, 14 | "WritableStream should be writable and ready should fulfill immediately if the strategy does not apply backpressure": { 15 | "status": "PASS" 16 | }, 17 | "WritableStream should be constructible with no arguments": { 18 | "status": "PASS" 19 | }, 20 | "underlyingSink argument should be converted after queuingStrategy argument": { 21 | "status": "PASS" 22 | }, 23 | "WritableStream instances should have standard methods and properties": { 24 | "status": "PASS" 25 | }, 26 | "WritableStreamDefaultController constructor should throw": { 27 | "status": "PASS" 28 | }, 29 | "WritableStreamDefaultController constructor should throw when passed an initialised WritableStream": { 30 | "status": "PASS" 31 | }, 32 | "WritableStreamDefaultWriter should throw unless passed a WritableStream": { 33 | "status": "PASS" 34 | }, 35 | "WritableStreamDefaultWriter constructor should throw when stream argument is locked": { 36 | "status": "PASS" 37 | } 38 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/streams/writable-streams/count-queuing-strategy.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Can construct a writable stream with a valid CountQueuingStrategy": { 3 | "status": "PASS" 4 | }, 5 | "Correctly governs the value of a WritableStream's state property (HWM = 0)": { 6 | "status": "PASS" 7 | }, 8 | "Correctly governs the value of a WritableStream's state property (HWM = 4)": { 9 | "status": "PASS" 10 | } 11 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/streams/writable-streams/error.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "controller.error() should error the stream": { 3 | "status": "PASS" 4 | }, 5 | "controller.error() on erroring stream should not throw": { 6 | "status": "PASS" 7 | }, 8 | "surplus calls to controller.error() should be a no-op": { 9 | "status": "PASS" 10 | }, 11 | "controller.error() on errored stream should not throw": { 12 | "status": "PASS" 13 | }, 14 | "controller.error() on closed stream should not throw": { 15 | "status": "PASS" 16 | } 17 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/streams/writable-streams/floating-point-total-queue-size.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Floating point arithmetic must manifest near NUMBER.MAX_SAFE_INTEGER (total ends up positive)": { 3 | "status": "PASS" 4 | }, 5 | "Floating point arithmetic must manifest near 0 (total ends up positive, but clamped)": { 6 | "status": "PASS" 7 | }, 8 | "Floating point arithmetic must manifest near 0 (total ends up positive, and not clamped)": { 9 | "status": "PASS" 10 | }, 11 | "Floating point arithmetic must manifest near 0 (total ends up zero)": { 12 | "status": "PASS" 13 | } 14 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/streams/writable-streams/properties.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "sink method start should be called with the right number of arguments": { 3 | "status": "PASS" 4 | }, 5 | "sink method start should be called even when it's located on the prototype chain": { 6 | "status": "PASS" 7 | }, 8 | "sink method write should be called with the right number of arguments": { 9 | "status": "PASS" 10 | }, 11 | "sink method write should be called even when it's located on the prototype chain": { 12 | "status": "PASS" 13 | }, 14 | "sink method close should be called with the right number of arguments": { 15 | "status": "PASS" 16 | }, 17 | "sink method close should be called even when it's located on the prototype chain": { 18 | "status": "PASS" 19 | }, 20 | "sink method abort should be called with the right number of arguments": { 21 | "status": "PASS" 22 | }, 23 | "sink method abort should be called even when it's located on the prototype chain": { 24 | "status": "PASS" 25 | } 26 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/streams/writable-streams/reentrant-strategy.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "writes should be written in the standard order": { 3 | "status": "PASS" 4 | }, 5 | "writer.write() promises should resolve in the standard order": { 6 | "status": "PASS" 7 | }, 8 | "controller.error() should work when called from within strategy.size()": { 9 | "status": "PASS" 10 | }, 11 | "close() should work when called from within strategy.size()": { 12 | "status": "PASS" 13 | }, 14 | "abort() should work when called from within strategy.size()": { 15 | "status": "PASS" 16 | }, 17 | "releaseLock() should abort the write() when called within strategy.size()": { 18 | "status": "PASS" 19 | }, 20 | "original reader should error when new reader is created within strategy.size()": { 21 | "status": "PASS" 22 | } 23 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/streams/writable-streams/start.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "underlying sink's write should not be called until start finishes": { 3 | "status": "PASS" 4 | }, 5 | "underlying sink's close should not be called until start finishes": { 6 | "status": "PASS" 7 | }, 8 | "underlying sink's write or close should not be called if start throws": { 9 | "status": "PASS" 10 | }, 11 | "underlying sink's write or close should not be invoked if the promise returned by start is rejected": { 12 | "status": "PASS" 13 | }, 14 | "returning a thenable from start() should work": { 15 | "status": "PASS" 16 | }, 17 | "controller.error() during start should cause writes to fail": { 18 | "status": "PASS" 19 | }, 20 | "controller.error() during async start should cause existing writes to fail": { 21 | "status": "PASS" 22 | }, 23 | "when start() rejects, writer promises should reject in standard order": { 24 | "status": "PASS" 25 | } 26 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/url/historical.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "searchParams on location object": { 3 | "status": "FAIL" 4 | }, 5 | "Setting URL's href attribute and base URLs": { 6 | "status": "FAIL" 7 | }, 8 | "URL.domainToASCII should be undefined": { 9 | "status": "PASS" 10 | }, 11 | "URL.domainToUnicode should be undefined": { 12 | "status": "PASS" 13 | }, 14 | "URL: no structured serialize/deserialize support": { 15 | "status": "PASS" 16 | }, 17 | "URLSearchParams: no structured serialize/deserialize support": { 18 | "status": "FAIL" 19 | }, 20 | "Constructor only takes strings": { 21 | "status": "FAIL" 22 | } 23 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/url/url-searchparams.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "URL.searchParams getter": { 3 | "status": "PASS" 4 | }, 5 | "URL.searchParams updating, clearing": { 6 | "status": "PASS" 7 | }, 8 | "URL.searchParams setter, invalid values": { 9 | "status": "PASS" 10 | }, 11 | "URL.searchParams and URL.search setters, update propagation": { 12 | "status": "FAIL" 13 | } 14 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/url/url-statics-canparse.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "URL.canParse(undefined, undefined)": { 3 | "status": "FAIL" 4 | }, 5 | "URL.canParse(aaa:b, undefined)": { 6 | "status": "FAIL" 7 | }, 8 | "URL.canParse(undefined, aaa:b)": { 9 | "status": "FAIL" 10 | }, 11 | "URL.canParse(aaa:/b, undefined)": { 12 | "status": "FAIL" 13 | }, 14 | "URL.canParse(undefined, aaa:/b)": { 15 | "status": "FAIL" 16 | }, 17 | "URL.canParse(https://test:test, undefined)": { 18 | "status": "FAIL" 19 | }, 20 | "URL.canParse(a, https://b/)": { 21 | "status": "FAIL" 22 | } 23 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/url/url-statics-parse.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "URL.parse(undefined, undefined)": { 3 | "status": "FAIL" 4 | }, 5 | "URL.parse(aaa:b, undefined)": { 6 | "status": "FAIL" 7 | }, 8 | "URL.parse(undefined, aaa:b)": { 9 | "status": "FAIL" 10 | }, 11 | "URL.parse(aaa:/b, undefined)": { 12 | "status": "FAIL" 13 | }, 14 | "URL.parse(undefined, aaa:/b)": { 15 | "status": "FAIL" 16 | }, 17 | "URL.parse(https://test:test, undefined)": { 18 | "status": "FAIL" 19 | }, 20 | "URL.parse(a, https://b/)": { 21 | "status": "FAIL" 22 | }, 23 | "URL.parse() should return a unique object": { 24 | "status": "FAIL" 25 | } 26 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/url/url-tojson.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "url-tojson": { 3 | "status": "PASS" 4 | } 5 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/url/urlsearchparams-append.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Append same name": { 3 | "status": "PASS" 4 | }, 5 | "Append empty strings": { 6 | "status": "PASS" 7 | }, 8 | "Append null": { 9 | "status": "PASS" 10 | }, 11 | "Append multiple": { 12 | "status": "FAIL" 13 | } 14 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/url/urlsearchparams-delete.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Delete basics": { 3 | "status": "PASS" 4 | }, 5 | "Deleting appended multiple": { 6 | "status": "PASS" 7 | }, 8 | "Deleting all params removes ? from URL": { 9 | "status": "PASS" 10 | }, 11 | "Removing non-existent param removes ? from URL": { 12 | "status": "PASS" 13 | }, 14 | "Changing the query of a URL with an opaque path can impact the path": { 15 | "status": "PASS" 16 | }, 17 | "Changing the query of a URL with an opaque path can impact the path if the URL has no fragment": { 18 | "status": "PASS" 19 | }, 20 | "Two-argument delete()": { 21 | "status": "PASS" 22 | }, 23 | "Two-argument delete() respects undefined as second arg": { 24 | "status": "PASS" 25 | } 26 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/url/urlsearchparams-foreach.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "ForEach Check": { 3 | "status": "PASS" 4 | }, 5 | "For-of Check": { 6 | "status": "PASS" 7 | }, 8 | "empty": { 9 | "status": "PASS" 10 | }, 11 | "delete next param during iteration": { 12 | "status": "PASS" 13 | }, 14 | "delete current param during iteration": { 15 | "status": "PASS" 16 | }, 17 | "delete every param seen during iteration": { 18 | "status": "PASS" 19 | } 20 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/url/urlsearchparams-get.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Get basics": { 3 | "status": "FAIL" 4 | }, 5 | "More get() basics": { 6 | "status": "FAIL" 7 | } 8 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/url/urlsearchparams-getall.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "getAll() basics": { 3 | "status": "PASS" 4 | }, 5 | "getAll() multiples": { 6 | "status": "PASS" 7 | } 8 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/url/urlsearchparams-has.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Has basics": { 3 | "status": "PASS" 4 | }, 5 | "has() following delete()": { 6 | "status": "PASS" 7 | }, 8 | "Two-argument has()": { 9 | "status": "PASS" 10 | }, 11 | "Two-argument has() respects undefined as second arg": { 12 | "status": "PASS" 13 | } 14 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/url/urlsearchparams-set.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Set basics": { 3 | "status": "PASS" 4 | }, 5 | "URLSearchParams.set": { 6 | "status": "PASS" 7 | } 8 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/url/urlsearchparams-size.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "URLSearchParams's size and deletion": { 3 | "status": "FAIL" 4 | }, 5 | "URLSearchParams's size and addition": { 6 | "status": "FAIL" 7 | }, 8 | "URLSearchParams's size when obtained from a URL": { 9 | "status": "FAIL" 10 | }, 11 | "URLSearchParams's size when obtained from a URL and using .search": { 12 | "status": "FAIL" 13 | } 14 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/url/urlsearchparams-sort.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Parse and sort: z=b&a=b&z=a&a=a": { 3 | "status": "PASS" 4 | }, 5 | "URL parse and sort: z=b&a=b&z=a&a=a": { 6 | "status": "PASS" 7 | }, 8 | "Parse and sort: �=x&&�=a": { 9 | "status": "PASS" 10 | }, 11 | "URL parse and sort: �=x&&�=a": { 12 | "status": "PASS" 13 | }, 14 | "Parse and sort: ffi&🌈": { 15 | "status": "PASS" 16 | }, 17 | "URL parse and sort: ffi&🌈": { 18 | "status": "PASS" 19 | }, 20 | "Parse and sort: é&e�&é": { 21 | "status": "PASS" 22 | }, 23 | "URL parse and sort: é&e�&é": { 24 | "status": "PASS" 25 | }, 26 | "Parse and sort: z=z&a=a&z=y&a=b&z=x&a=c&z=w&a=d&z=v&a=e&z=u&a=f&z=t&a=g": { 27 | "status": "PASS" 28 | }, 29 | "URL parse and sort: z=z&a=a&z=y&a=b&z=x&a=c&z=w&a=d&z=v&a=e&z=u&a=f&z=t&a=g": { 30 | "status": "PASS" 31 | }, 32 | "Parse and sort: bbb&bb&aaa&aa=x&aa=y": { 33 | "status": "PASS" 34 | }, 35 | "URL parse and sort: bbb&bb&aaa&aa=x&aa=y": { 36 | "status": "PASS" 37 | }, 38 | "Parse and sort: z=z&=f&=t&=x": { 39 | "status": "PASS" 40 | }, 41 | "URL parse and sort: z=z&=f&=t&=x": { 42 | "status": "PASS" 43 | }, 44 | "Parse and sort: a🌈&a💩": { 45 | "status": "PASS" 46 | }, 47 | "URL parse and sort: a🌈&a💩": { 48 | "status": "PASS" 49 | }, 50 | "Sorting non-existent params removes ? from URL": { 51 | "status": "PASS" 52 | } 53 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/url/urlsearchparams-stringifier.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Serialize space": { 3 | "status": "PASS" 4 | }, 5 | "Serialize empty value": { 6 | "status": "PASS" 7 | }, 8 | "Serialize empty name": { 9 | "status": "PASS" 10 | }, 11 | "Serialize empty name and value": { 12 | "status": "PASS" 13 | }, 14 | "Serialize +": { 15 | "status": "PASS" 16 | }, 17 | "Serialize =": { 18 | "status": "PASS" 19 | }, 20 | "Serialize &": { 21 | "status": "PASS" 22 | }, 23 | "Serialize *-._": { 24 | "status": "PASS" 25 | }, 26 | "Serialize %": { 27 | "status": "PASS" 28 | }, 29 | "Serialize \\0": { 30 | "status": "PASS" 31 | }, 32 | "Serialize 💩": { 33 | "status": "PASS" 34 | }, 35 | "URLSearchParams.toString": { 36 | "status": "PASS" 37 | }, 38 | "URLSearchParams connected to URL": { 39 | "status": "FAIL" 40 | }, 41 | "URLSearchParams must not do newline normalization": { 42 | "status": "PASS" 43 | } 44 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/webidl/ecmascript-binding/es-exceptions/DOMException-constructor-and-prototype.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "existence and property descriptor of DOMException": { 3 | "status": "PASS" 4 | }, 5 | "existence and property descriptor of DOMException.prototype": { 6 | "status": "PASS" 7 | }, 8 | "existence and property descriptor of DOMException.prototype.constructor": { 9 | "status": "PASS" 10 | } 11 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/xhr/formdata/append.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "testFormDataAppend1": { 3 | "status": "PASS" 4 | }, 5 | "testFormDataAppend2": { 6 | "status": "PASS" 7 | }, 8 | "testFormDataAppendUndefined1": { 9 | "status": "PASS" 10 | }, 11 | "testFormDataAppendUndefined2": { 12 | "status": "PASS" 13 | }, 14 | "testFormDataAppendNull1": { 15 | "status": "PASS" 16 | }, 17 | "testFormDataAppendNull2": { 18 | "status": "PASS" 19 | }, 20 | "testFormDataAppendEmptyBlob": { 21 | "status": "PASS" 22 | } 23 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/xhr/formdata/constructor.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Constructors should throw a type error": { 3 | "status": "PASS" 4 | } 5 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/xhr/formdata/delete.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "testFormDataDelete": { 3 | "status": "PASS" 4 | }, 5 | "testFormDataDeleteNonExistentKey": { 6 | "status": "PASS" 7 | }, 8 | "testFormDataDeleteOtherKey": { 9 | "status": "PASS" 10 | } 11 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/xhr/formdata/foreach.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Iterator should return duplicate keys and non-deleted values": { 3 | "status": "PASS" 4 | }, 5 | "Entries iterator should return duplicate keys and non-deleted values": { 6 | "status": "PASS" 7 | }, 8 | "Keys iterator should return duplicates": { 9 | "status": "PASS" 10 | }, 11 | "Values iterator should return non-deleted values": { 12 | "status": "PASS" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/xhr/formdata/get.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "testFormDataGet": { 3 | "status": "PASS" 4 | }, 5 | "testFormDataGetNull1": { 6 | "status": "PASS" 7 | }, 8 | "testFormDataGetNull2": { 9 | "status": "PASS" 10 | }, 11 | "testFormDataGetAll": { 12 | "status": "PASS" 13 | }, 14 | "testFormDataGetAllEmpty1": { 15 | "status": "PASS" 16 | }, 17 | "testFormDataGetAllEmpty2": { 18 | "status": "PASS" 19 | } 20 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/xhr/formdata/has.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "testFormDataHas": { 3 | "status": "PASS" 4 | }, 5 | "testFormDataHasEmpty1": { 6 | "status": "PASS" 7 | }, 8 | "testFormDataHasEmpty2": { 9 | "status": "PASS" 10 | } 11 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/xhr/formdata/iteration.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "Iteration skips elements removed while iterating": { 3 | "status": "PASS" 4 | }, 5 | "Removing elements already iterated over causes an element to be skipped during iteration": { 6 | "status": "PASS" 7 | }, 8 | "Appending a value pair during iteration causes it to be reached during iteration": { 9 | "status": "PASS" 10 | } 11 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/xhr/formdata/set-blob.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "blob without type": { 3 | "status": "PASS" 4 | }, 5 | "blob with type": { 6 | "status": "PASS" 7 | }, 8 | "blob with custom name": { 9 | "status": "PASS" 10 | }, 11 | "file without lastModified or custom name": { 12 | "status": "PASS" 13 | }, 14 | "file with lastModified and custom name": { 15 | "status": "PASS" 16 | } 17 | } -------------------------------------------------------------------------------- /tests/wpt-harness/expectations/xhr/formdata/set.any.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "testFormDataSet1": { 3 | "status": "PASS" 4 | }, 5 | "testFormDataSet2": { 6 | "status": "PASS" 7 | }, 8 | "testFormDataSetUndefined1": { 9 | "status": "PASS" 10 | }, 11 | "testFormDataSetUndefined2": { 12 | "status": "PASS" 13 | }, 14 | "testFormDataSetNull1": { 15 | "status": "PASS" 16 | }, 17 | "testFormDataSetNull2": { 18 | "status": "PASS" 19 | }, 20 | "testFormDataSetEmptyBlob": { 21 | "status": "PASS" 22 | } 23 | } -------------------------------------------------------------------------------- /tests/wpt-harness/pre-harness.js: -------------------------------------------------------------------------------- 1 | globalThis.GLOBAL = { 2 | isWindow: function() { return false; }, 3 | isWorker: function() { return true; }, 4 | isShadowRealm: function() { return false; }, 5 | }; 6 | 7 | globalThis.window=self; 8 | globalThis.Window={ 9 | prototype: {} 10 | }; 11 | 12 | { 13 | let originalAEL = addEventListener; 14 | let o_clearTimeout = clearTimeout; 15 | clearTimeout = function(id) { 16 | if (id === null) { 17 | return; 18 | } 19 | return o_clearTimeout(id); 20 | } 21 | addEventListener = function addEventListener_wpt(type, handler) { 22 | if (type == "fetch") { 23 | originalAEL(type, handler); 24 | } else { 25 | console.log(`Ignoring handler for event ${type}`); 26 | } 27 | } 28 | } 29 | 30 | globalThis.crypto.subtle.generateKey = function () {return Promise.reject(new Error('globalThis.crypto.subtle.generateKey unimplemented'))} 31 | globalThis.SharedArrayBuffer = class SharedArrayBuffer{}; 32 | globalThis.MessageChannel = class MessageChannel{}; 33 | ; 34 | -------------------------------------------------------------------------------- /tests/wpt-harness/results-section-error.template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | ${prefix}${title}
4 |
Details 5 |

Message:

${message}

6 |

Stack:

${stack}

7 |

8 | 9 | 10 | -------------------------------------------------------------------------------- /tests/wpt-harness/results-section.template.html: -------------------------------------------------------------------------------- 1 | 2 | ${prefix}${title} 3 | ${pass} / ${total}duration: ${duration}ms 4 | ${info} 5 | 6 | ${rows} 7 | --------------------------------------------------------------------------------