├── .gitmodules
├── version.txt
├── docs
├── .gitignore
├── src
│ ├── README.md
│ ├── ADOPTERS.md
│ ├── CODE_OF_CONDUCT.md
│ ├── developer
│ │ ├── debugging.md
│ │ └── builtins-rust.md
│ └── SUMMARY.md
└── book.toml
├── crates
├── rust-url
│ ├── .gitignore
│ ├── Cargo.toml
│ └── cbindgen.toml
├── rust-multipart
│ ├── .gitignore
│ ├── fuzz
│ │ ├── .gitignore
│ │ ├── corpus
│ │ │ └── fuzz_multipart
│ │ │ │ ├── simple.seed
│ │ │ │ └── multi.seed
│ │ ├── Cargo.toml
│ │ └── fuzz_targets
│ │ │ └── fuzz_multipart.rs
│ ├── Cargo.toml
│ ├── cbindgen.toml
│ └── src
│ │ └── error.rs
├── rust-encoding
│ ├── src
│ │ └── lib.rs
│ └── Cargo.toml
└── rust-hooks
│ ├── Cargo.toml
│ └── src
│ └── wrappers.cpp
├── tests
├── e2e
│ ├── syntax-err
│ │ ├── expect_wizer_fail
│ │ ├── syntax-err.js
│ │ └── expect_wizer_stderr.txt
│ ├── tla-err
│ │ ├── expect_wizer_fail
│ │ ├── expect_wizer_stderr.txt
│ │ └── tla-err.js
│ ├── headers
│ │ ├── expect_serve_body.txt
│ │ ├── expect_serve_stderr.txt
│ │ └── expect_serve_headers.txt
│ ├── no-init-location
│ │ ├── expect_wizer_fail
│ │ ├── no-init-location.js
│ │ └── expect_wizer_stderr.txt
│ ├── runtime-err
│ │ ├── expect_serve_status.txt
│ │ ├── runtime-err.js
│ │ └── expect_serve_stderr.txt
│ ├── tla
│ │ ├── expect_serve_body.txt
│ │ └── tla.js
│ ├── tla-runtime-resolve
│ │ ├── expect_serve_body.txt
│ │ ├── expect_serve_stdout.txt
│ │ └── tla-runtime-resolve.js
│ ├── init-location
│ │ ├── runtime-args
│ │ ├── expect_serve_stdout.txt
│ │ ├── expect_wizer_stdout.txt
│ │ └── init-location.js
│ ├── init-script
│ │ ├── expect_serve_stdout.txt
│ │ ├── init.js
│ │ └── init-script.js
│ ├── stream-forwarding
│ │ ├── expect_serve_body.txt
│ │ └── stream-forwarding.js
│ ├── teed-stream-as-outgoing-body
│ │ ├── expect_serve_body.txt
│ │ └── expect_serve_stdout.txt
│ ├── smoke
│ │ ├── nested-smoke-dependency.js
│ │ ├── expect_serve_stdout.txt
│ │ └── smoke-dependency.js
│ ├── multi-stream-forwarding
│ │ └── expect_serve_body.txt
│ ├── blob
│ │ └── expect_serve_stdout.txt
│ └── eventloop-stall
│ │ ├── expect_serve_stderr.txt
│ │ └── eventloop-stall.js
├── wpt-harness
│ ├── expectations
│ │ ├── url
│ │ │ ├── url-tojson.any.js.json
│ │ │ ├── urlsearchparams-get.any.js.json
│ │ │ ├── urlsearchparams-set.any.js.json
│ │ │ ├── urlsearchparams-getall.any.js.json
│ │ │ ├── urlsearchparams-append.any.js.json
│ │ │ ├── urlsearchparams-has.any.js.json
│ │ │ ├── url-searchparams.any.js.json
│ │ │ ├── urlsearchparams-size.any.js.json
│ │ │ ├── urlsearchparams-foreach.any.js.json
│ │ │ ├── url-statics-canparse.any.js.json
│ │ │ ├── historical.any.js.json
│ │ │ ├── url-statics-parse.any.js.json
│ │ │ ├── urlsearchparams-delete.any.js.json
│ │ │ └── urlsearchparams-stringifier.any.js.json
│ │ ├── fetch
│ │ │ ├── content-type
│ │ │ │ ├── multipart.window.js.json
│ │ │ │ └── multipart-malformed.any.js.json
│ │ │ └── api
│ │ │ │ ├── basic
│ │ │ │ ├── request-head.any.js.json
│ │ │ │ ├── conditional-get.any.js.json
│ │ │ │ ├── request-headers-nonascii.any.js.json
│ │ │ │ ├── header-value-null-byte.any.js.json
│ │ │ │ ├── http-response-code.any.js.json
│ │ │ │ ├── request-referrer.any.js.json
│ │ │ │ ├── stream-response.any.js.json
│ │ │ │ ├── request-headers-case.any.js.json
│ │ │ │ ├── historical.any.js.json
│ │ │ │ ├── response-url.sub.any.js.json
│ │ │ │ ├── accept-header.any.js.json
│ │ │ │ ├── mode-no-cors.sub.any.js.json
│ │ │ │ ├── header-value-combining.any.js.json
│ │ │ │ ├── referrer.any.js.json
│ │ │ │ ├── scheme-about.any.js.json
│ │ │ │ ├── status.h2.any.js.json
│ │ │ │ ├── keepalive.any.js.json
│ │ │ │ ├── scheme-data.any.js.json
│ │ │ │ ├── mode-same-origin.any.js.json
│ │ │ │ └── response-null-body.any.js.json
│ │ │ │ ├── response
│ │ │ │ ├── response-headers-guard.any.js.json
│ │ │ │ ├── response-blob-realm.any.js.json
│ │ │ │ ├── json.any.js.json
│ │ │ │ ├── response-static-error.any.js.json
│ │ │ │ ├── response-stream-disturbed-by-pipe.any.js.json
│ │ │ │ ├── response-from-stream.any.js.json
│ │ │ │ ├── response-stream-disturbed-6.any.js.json
│ │ │ │ ├── response-cancel-stream.any.js.json
│ │ │ │ ├── response-stream-with-broken-then.any.js.json
│ │ │ │ ├── response-init-002.any.js.json
│ │ │ │ ├── response-stream-bad-chunk.any.js.json
│ │ │ │ ├── response-init-001.any.js.json
│ │ │ │ └── response-error.any.js.json
│ │ │ │ ├── redirect
│ │ │ │ ├── redirect-keepalive.https.any.js.json
│ │ │ │ ├── redirect-empty-location.any.js.json
│ │ │ │ ├── redirect-back-to-original-origin.any.js.json
│ │ │ │ ├── redirect-schemes.any.js.json
│ │ │ │ ├── redirect-location-escape.tentative.any.js.json
│ │ │ │ ├── redirect-upload.h2.any.js.json
│ │ │ │ ├── redirect-to-dataurl.any.js.json
│ │ │ │ ├── redirect-count.any.js.json
│ │ │ │ ├── redirect-keepalive.any.js.json
│ │ │ │ └── redirect-method.any.js.json
│ │ │ │ ├── request
│ │ │ │ ├── request-keepalive.any.js.json
│ │ │ │ ├── request-constructor-init-body-override.any.js.json
│ │ │ │ ├── forbidden-method.any.js.json
│ │ │ │ ├── request-cache-no-cache.any.js.json
│ │ │ │ ├── request-init-priority.any.js.json
│ │ │ │ ├── request-disturbed.any.js.json
│ │ │ │ └── request-init-002.any.js.json
│ │ │ │ ├── abort
│ │ │ │ └── cache.https.any.js.json
│ │ │ │ ├── headers
│ │ │ │ ├── headers-normalize.any.js.json
│ │ │ │ ├── header-values.any.js.json
│ │ │ │ ├── headers-casing.any.js.json
│ │ │ │ ├── headers-combine.any.js.json
│ │ │ │ └── headers-structure.any.js.json
│ │ │ │ └── body
│ │ │ │ ├── formdata.any.js.json
│ │ │ │ └── cloned-any.js.json
│ │ ├── console
│ │ │ ├── console-log-symbol.any.js.json
│ │ │ ├── console-tests-historical.any.js.json
│ │ │ ├── console-is-a-namespace.any.js.json
│ │ │ └── console-namespace-object-class-string.any.js.json
│ │ ├── html
│ │ │ └── webappapis
│ │ │ │ └── timers
│ │ │ │ ├── negative-setinterval.any.js.json
│ │ │ │ ├── negative-settimeout.any.js.json
│ │ │ │ ├── type-long-settimeout.any.js.json
│ │ │ │ ├── type-long-setinterval.any.js.json
│ │ │ │ ├── clearinterval-from-callback.any.js.json
│ │ │ │ ├── cleartimeout-clearinterval.any.js.json
│ │ │ │ └── missing-timeout-setinterval.any.js.json
│ │ ├── xhr
│ │ │ └── formdata
│ │ │ │ ├── constructor.any.js.json
│ │ │ │ ├── has.any.js.json
│ │ │ │ ├── delete.any.js.json
│ │ │ │ ├── iteration.any.js.json
│ │ │ │ ├── set-blob.any.js.json
│ │ │ │ ├── get.any.js.json
│ │ │ │ ├── foreach.any.js.json
│ │ │ │ ├── set.any.js.json
│ │ │ │ └── append.any.js.json
│ │ ├── dom
│ │ │ └── events
│ │ │ │ ├── EventTarget-addEventListener.any.js.json
│ │ │ │ ├── EventTarget-removeEventListener.any.js.json
│ │ │ │ ├── EventTarget-add-remove-listener.any.js.json
│ │ │ │ ├── EventTarget-constructible.any.js.json
│ │ │ │ ├── AddEventListenerOptions-once.any.js.json
│ │ │ │ ├── AddEventListenerOptions-passive.any.js.json
│ │ │ │ └── Event-constructors.any.js.json
│ │ ├── streams
│ │ │ ├── piping
│ │ │ │ ├── general-addition.any.js.json
│ │ │ │ ├── transform-streams.any.js.json
│ │ │ │ ├── then-interception.any.js.json
│ │ │ │ ├── throwing-options.any.js.json
│ │ │ │ ├── flow-control.any.js.json
│ │ │ │ └── multiple-propagation.any.js.json
│ │ │ ├── readable-streams
│ │ │ │ ├── constructor.any.js.json
│ │ │ │ ├── owning-type-message-port.any.js.json
│ │ │ │ ├── count-queuing-strategy-integration.any.js.json
│ │ │ │ ├── floating-point-total-queue-size.any.js.json
│ │ │ │ ├── owning-type.any.js.json
│ │ │ │ ├── patched-global.any.js.json
│ │ │ │ ├── garbage-collection.any.js.json
│ │ │ │ ├── owning-type-video-frame.any.js.json
│ │ │ │ ├── bad-strategies.any.js.json
│ │ │ │ └── reentrant-strategies.any.js.json
│ │ │ ├── readable-byte-streams
│ │ │ │ ├── enqueue-with-detached-buffer.any.js.json
│ │ │ │ ├── respond-after-enqueue.any.js.json
│ │ │ │ └── non-transferable-buffers.any.js.json
│ │ │ ├── writable-streams
│ │ │ │ ├── byte-length-queuing-strategy.any.js.json
│ │ │ │ ├── count-queuing-strategy.any.js.json
│ │ │ │ ├── error.any.js.json
│ │ │ │ ├── floating-point-total-queue-size.any.js.json
│ │ │ │ ├── bad-strategies.any.js.json
│ │ │ │ ├── reentrant-strategy.any.js.json
│ │ │ │ ├── start.any.js.json
│ │ │ │ └── properties.any.js.json
│ │ │ └── transform-streams
│ │ │ │ ├── patched-global.any.js.json
│ │ │ │ ├── terminate.any.js.json
│ │ │ │ ├── properties.any.js.json
│ │ │ │ ├── flush.any.js.json
│ │ │ │ ├── cancel.any.js.json
│ │ │ │ ├── reentrant-strategies.any.js.json
│ │ │ │ └── strategies.any.js.json
│ │ ├── FileAPI
│ │ │ ├── file
│ │ │ │ ├── send-file-formdata.any.js.json
│ │ │ │ └── send-file-formdata-utf-8.any.js.json
│ │ │ └── blob
│ │ │ │ ├── Blob-bytes.any.js.json
│ │ │ │ ├── Blob-array-buffer.any.js.json
│ │ │ │ ├── Blob-slice-overflow.any.js.json
│ │ │ │ ├── Blob-stream.any.js.json
│ │ │ │ ├── Blob-constructor-dom.window.js.json
│ │ │ │ └── Blob-text.any.js.json
│ │ ├── compression
│ │ │ ├── compression-with-detach.tentative.window.js.json
│ │ │ ├── decompression-with-detach.tentative.window.js.json
│ │ │ ├── decompression-uint8array-output.tentative.any.js.json
│ │ │ ├── compression-large-flush-output.any.js.json
│ │ │ ├── decompression-correct-input.tentative.any.js.json
│ │ │ ├── decompression-empty-input.tentative.any.js.json
│ │ │ ├── compression-constructor-error.tentative.any.js.json
│ │ │ ├── decompression-constructor-error.tentative.any.js.json
│ │ │ ├── compression-output-length.tentative.any.js.json
│ │ │ ├── compression-stream.tentative.any.js.json
│ │ │ └── compression-including-empty-chunk.tentative.any.js.json
│ │ ├── encoding
│ │ │ ├── textdecoder-fatal-streaming.any.js.json
│ │ │ ├── textdecoder-eof.any.js.json
│ │ │ ├── textdecoder-copy.any.js.json
│ │ │ ├── textdecoder-byte-order-marks.any.js.json
│ │ │ ├── textdecoder-arguments.any.js.json
│ │ │ ├── textdecoder-ignorebom.any.js.json
│ │ │ ├── api-basics.any.js.json
│ │ │ ├── textencoder-utf16-surrogates.any.js.json
│ │ │ ├── api-surrogates-utf8.any.js.json
│ │ │ ├── api-replacement-encodings.any.js.json
│ │ │ ├── textdecoder-utf16-surrogates.any.js.json
│ │ │ └── unsupported-encodings.any.js.json
│ │ ├── hr-time
│ │ │ ├── monotonic-clock.any.js.json
│ │ │ └── basic.any.js.json
│ │ ├── WebCryptoAPI
│ │ │ └── randomUUID.https.any.js.json
│ │ └── webidl
│ │ │ └── ecmascript-binding
│ │ │ └── es-exceptions
│ │ │ └── DOMException-constructor-and-prototype.any.js.json
│ ├── results-section.template.html
│ ├── results-section-error.template.html
│ ├── build-wpt-runtime.sh
│ └── pre-harness.js
└── integration
│ └── handlers.js
├── debugger
└── vscode-dap-extension
│ ├── tests
│ ├── js
│ │ ├── .gitignore
│ │ ├── build.sh
│ │ ├── main.js
│ │ └── .vscode
│ │ │ └── launch.json
│ └── ts
│ │ ├── .gitignore
│ │ ├── package.json
│ │ ├── tsconfig.json
│ │ ├── .vscode
│ │ └── launch.json
│ │ └── src
│ │ └── main2.ts
│ ├── images
│ └── starlingmonkey-logo.png
│ ├── .gitignore
│ ├── .vscode
│ ├── settings.json
│ └── tasks.json
│ ├── src
│ ├── sourcemaps
│ │ ├── README.md
│ │ └── LICENSE.txt
│ ├── extension.ts
│ └── signals.ts
│ ├── .vscodeignore
│ ├── tsconfig.json
│ ├── CHANGELOG.md
│ └── eslint.config.mjs
├── .release-please-manifest.json
├── rust-toolchain.toml
├── host-apis
├── wasi-0.2.0
│ ├── wit
│ │ ├── deps
│ │ │ ├── cli
│ │ │ │ ├── run.wit
│ │ │ │ ├── command.wit
│ │ │ │ ├── exit.wit
│ │ │ │ ├── stdio.wit
│ │ │ │ ├── imports.wit
│ │ │ │ └── environment.wit
│ │ │ ├── io
│ │ │ │ └── world.wit
│ │ │ ├── filesystem
│ │ │ │ ├── world.wit
│ │ │ │ └── preopens.wit
│ │ │ ├── clocks
│ │ │ │ └── world.wit
│ │ │ ├── random
│ │ │ │ ├── world.wit
│ │ │ │ ├── insecure.wit
│ │ │ │ ├── insecure-seed.wit
│ │ │ │ └── random.wit
│ │ │ └── sockets
│ │ │ │ ├── world.wit
│ │ │ │ └── instance-network.wit
│ │ ├── main.wit
│ │ └── command-extended.wit
│ ├── bindings
│ │ └── bindings_component_type.o
│ ├── preview1-adapter-debug
│ │ └── wasi_snapshot_preview1.wasm
│ ├── preview1-adapter-release
│ │ └── wasi_snapshot_preview1.wasm
│ ├── host_call.cpp
│ ├── include
│ │ └── exports.h
│ └── host_api.cmake
├── wasi-0.2.2
│ ├── wit
│ │ ├── main.wit
│ │ ├── deps
│ │ │ ├── cli
│ │ │ │ ├── run.wit
│ │ │ │ ├── command.wit
│ │ │ │ ├── stdio.wit
│ │ │ │ ├── exit.wit
│ │ │ │ ├── environment.wit
│ │ │ │ └── imports.wit
│ │ │ ├── io
│ │ │ │ └── world.wit
│ │ │ ├── filesystem
│ │ │ │ ├── world.wit
│ │ │ │ └── preopens.wit
│ │ │ ├── random
│ │ │ │ ├── world.wit
│ │ │ │ └── insecure.wit
│ │ │ ├── clocks
│ │ │ │ └── world.wit
│ │ │ └── sockets
│ │ │ │ ├── instance-network.wit
│ │ │ │ └── world.wit
│ │ └── command-extended.wit
│ ├── bindings
│ │ └── bindings_component_type.o
│ └── host_api.cmake
└── wasi-0.2.3
│ ├── wit
│ ├── main.wit
│ ├── command-extended.wit
│ └── deps
│ │ ├── wasi-random-0.2.3
│ │ └── package.wit
│ │ └── wasi-clocks-0.2.3
│ │ └── package.wit
│ ├── bindings
│ └── bindings_component_type.o
│ ├── wkg.lock
│ └── host_api.cmake
├── clang-format.ignore
├── builtins
├── web
│ ├── global_self.h
│ ├── text-codec
│ │ ├── text-codec.h
│ │ ├── text-codec.cpp
│ │ ├── text-codec-errors.h
│ │ └── text-encoder.h
│ ├── streams
│ │ ├── streams.h
│ │ └── streams.cpp
│ ├── fetch
│ │ └── fetch-api.h
│ ├── queue-microtask.h
│ ├── structured-clone.h
│ ├── event
│ │ ├── global-event-target.h
│ │ └── custom-event.h
│ ├── timers.h
│ ├── console.h
│ ├── base64.h
│ ├── form-data
│ │ └── form-data-parser.h
│ ├── crypto
│ │ ├── uuid.h
│ │ ├── crypto-key-ec-components.cpp
│ │ ├── crypto-key-ec-components.h
│ │ └── crypto.h
│ ├── worker-location.h
│ ├── performance.h
│ ├── abort
│ │ ├── abort-controller.h
│ │ └── weak-index-set.h
│ └── global_self.cpp
└── install_builtins.cpp
├── cmake
├── toolchain.cmake
├── weval.cmake
├── wasmtime.cmake
├── wizer.cmake
├── wasi-sdk.cmake
├── wasm-tools.cmake
├── add_as_subproject.cmake
├── cbindgen.cmake
├── binaryen.cmake
├── init-corrosion.cmake
├── CPM.cmake
└── compile-flags.cmake
├── AUTHORS.md
├── runtime
├── decode.h
├── crates
│ └── staticlib-template
│ │ ├── rust-staticlib.rs.in
│ │ └── Cargo.toml.in
├── allocator.cpp
├── decode.cpp
├── allocator.h
├── encode.h
└── debugger.h
├── scripts
├── wasm-opt
└── cxx-wrapper.in
├── deps
└── patches
│ ├── getuid.patch
│ └── rand.patch
├── .gitignore
└── release-please-config.json
/.gitmodules:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/version.txt:
--------------------------------------------------------------------------------
1 | 0.2.1
2 |
--------------------------------------------------------------------------------
/docs/.gitignore:
--------------------------------------------------------------------------------
1 | book
2 |
--------------------------------------------------------------------------------
/docs/src/README.md:
--------------------------------------------------------------------------------
1 | ../../README.md
--------------------------------------------------------------------------------
/crates/rust-url/.gitignore:
--------------------------------------------------------------------------------
1 | target
2 |
--------------------------------------------------------------------------------
/docs/src/ADOPTERS.md:
--------------------------------------------------------------------------------
1 | ../../ADOPTERS.md
--------------------------------------------------------------------------------
/tests/e2e/syntax-err/expect_wizer_fail:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/tests/e2e/tla-err/expect_wizer_fail:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/tests/e2e/headers/expect_serve_body.txt:
--------------------------------------------------------------------------------
1 | test
--------------------------------------------------------------------------------
/tests/e2e/headers/expect_serve_stderr.txt:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/tests/e2e/syntax-err/syntax-err.js:
--------------------------------------------------------------------------------
1 | a?
2 |
--------------------------------------------------------------------------------
/tests/e2e/no-init-location/expect_wizer_fail:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/tests/e2e/runtime-err/expect_serve_status.txt:
--------------------------------------------------------------------------------
1 | 500
--------------------------------------------------------------------------------
/tests/e2e/tla/expect_serve_body.txt:
--------------------------------------------------------------------------------
1 | hello world
--------------------------------------------------------------------------------
/docs/src/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | ../../CODE_OF_CONDUCT.md
--------------------------------------------------------------------------------
/crates/rust-multipart/.gitignore:
--------------------------------------------------------------------------------
1 | /target
2 | Cargo.lock
3 |
--------------------------------------------------------------------------------
/debugger/vscode-dap-extension/tests/js/.gitignore:
--------------------------------------------------------------------------------
1 | main.wasm
2 |
--------------------------------------------------------------------------------
/debugger/vscode-dap-extension/tests/ts/.gitignore:
--------------------------------------------------------------------------------
1 | main.wasm
2 |
--------------------------------------------------------------------------------
/tests/e2e/tla-runtime-resolve/expect_serve_body.txt:
--------------------------------------------------------------------------------
1 | hello world
--------------------------------------------------------------------------------
/tests/e2e/init-location/runtime-args:
--------------------------------------------------------------------------------
1 | --init-location http://foo.bar/
2 |
--------------------------------------------------------------------------------
/tests/e2e/init-script/expect_serve_stdout.txt:
--------------------------------------------------------------------------------
1 | stdout [0] :: Log: foo
2 |
--------------------------------------------------------------------------------
/tests/e2e/stream-forwarding/expect_serve_body.txt:
--------------------------------------------------------------------------------
1 | hello
2 | world
3 |
--------------------------------------------------------------------------------
/tests/e2e/no-init-location/no-init-location.js:
--------------------------------------------------------------------------------
1 | console.log(self.location);
2 |
--------------------------------------------------------------------------------
/tests/e2e/init-location/expect_serve_stdout.txt:
--------------------------------------------------------------------------------
1 | stdout [0] :: Log: localhost
2 |
--------------------------------------------------------------------------------
/tests/e2e/tla-runtime-resolve/expect_serve_stdout.txt:
--------------------------------------------------------------------------------
1 | stdout [0] :: Log: YO
2 |
--------------------------------------------------------------------------------
/docs/src/developer/debugging.md:
--------------------------------------------------------------------------------
1 | # Debugging StarlingMonkey application
2 |
3 | TODO
4 |
--------------------------------------------------------------------------------
/tests/e2e/teed-stream-as-outgoing-body/expect_serve_body.txt:
--------------------------------------------------------------------------------
1 | Successfully forwarded
2 |
--------------------------------------------------------------------------------
/tests/e2e/smoke/nested-smoke-dependency.js:
--------------------------------------------------------------------------------
1 | console.log("nested-smoke-dependency.js loaded");
2 |
--------------------------------------------------------------------------------
/crates/rust-multipart/fuzz/.gitignore:
--------------------------------------------------------------------------------
1 | target
2 | corpus/*/*
3 | artifacts
4 | !*.seed
5 | coverage
6 |
--------------------------------------------------------------------------------
/tests/e2e/multi-stream-forwarding/expect_serve_body.txt:
--------------------------------------------------------------------------------
1 | This sentence will be streamed in chunks.
2 |
--------------------------------------------------------------------------------
/.release-please-manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | ".": "0.2.1",
3 | "debugger/vscode-dap-extension": "0.2.1"
4 | }
5 |
--------------------------------------------------------------------------------
/rust-toolchain.toml:
--------------------------------------------------------------------------------
1 | [toolchain]
2 | channel = "1.88.0"
3 | targets = [ "wasm32-wasip1" ]
4 | profile = "minimal"
5 |
--------------------------------------------------------------------------------
/host-apis/wasi-0.2.0/wit/deps/cli/run.wit:
--------------------------------------------------------------------------------
1 | interface run {
2 | /// Run the program.
3 | run: func() -> result;
4 | }
5 |
--------------------------------------------------------------------------------
/tests/e2e/blob/expect_serve_stdout.txt:
--------------------------------------------------------------------------------
1 | stdout [0] :: Log: Counter: 5
2 | stdout [0] :: Log: Finished processing blob.
3 |
--------------------------------------------------------------------------------
/tests/wpt-harness/expectations/url/url-tojson.any.js.json:
--------------------------------------------------------------------------------
1 | {
2 | "url-tojson": {
3 | "status": "PASS"
4 | }
5 | }
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/tests/e2e/eventloop-stall/expect_serve_stderr.txt:
--------------------------------------------------------------------------------
1 | stderr [0] :: Warning: JS event loop terminated without completing the request.
2 |
--------------------------------------------------------------------------------
/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/smoke/expect_serve_stdout.txt:
--------------------------------------------------------------------------------
1 | stdout [0] :: Log: chaining to /chained
2 | stdout [1] :: Log: post resp [object Response]
3 |
--------------------------------------------------------------------------------
/tests/wpt-harness/expectations/fetch/content-type/multipart.window.js.json:
--------------------------------------------------------------------------------
1 | {
2 | "multipart": {
3 | "status": "PASS"
4 | }
5 | }
--------------------------------------------------------------------------------
/debugger/vscode-dap-extension/tests/js/build.sh:
--------------------------------------------------------------------------------
1 | componentize-js --wit world.wit -o main.wasm --runtime-args "--enable-script-debugging" main.js
2 |
--------------------------------------------------------------------------------
/docs/src/developer/builtins-rust.md:
--------------------------------------------------------------------------------
1 | # Devoloping Builtins in Rust
2 |
3 | [TODO]: https://github.com/bytecodealliance/StarlingMonkey/pull/103
4 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/tests/wpt-harness/expectations/fetch/api/basic/request-head.any.js.json:
--------------------------------------------------------------------------------
1 | {
2 | "Fetch with HEAD with body": {
3 | "status": "PASS"
4 | }
5 | }
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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/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/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-settimeout.any.js.json:
--------------------------------------------------------------------------------
1 | {
2 | "type-long-settimeout": {
3 | "status": "PASS"
4 | }
5 | }
--------------------------------------------------------------------------------
/tests/wpt-harness/expectations/xhr/formdata/constructor.any.js.json:
--------------------------------------------------------------------------------
1 | {
2 | "Constructors should throw a type error": {
3 | "status": "PASS"
4 | }
5 | }
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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/html/webappapis/timers/type-long-setinterval.any.js.json:
--------------------------------------------------------------------------------
1 | {
2 | "type-long-setinterval": {
3 | "status": "PASS"
4 | }
5 | }
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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/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/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/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/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 |
--------------------------------------------------------------------------------
/tests/e2e/init-location/expect_wizer_stdout.txt:
--------------------------------------------------------------------------------
1 | Componentizing e2e/init-location/init-location.js into e2e/init-location/init-location.wasm
2 | Log: http://foo.bar/
3 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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/response/response-headers-guard.any.js.json:
--------------------------------------------------------------------------------
1 | {
2 | "Ensure response headers are immutable": {
3 | "status": "PASS"
4 | }
5 | }
--------------------------------------------------------------------------------
/host-apis/wasi-0.2.0/bindings/bindings_component_type.o:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bytecodealliance/StarlingMonkey/HEAD/host-apis/wasi-0.2.0/bindings/bindings_component_type.o
--------------------------------------------------------------------------------
/host-apis/wasi-0.2.2/bindings/bindings_component_type.o:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bytecodealliance/StarlingMonkey/HEAD/host-apis/wasi-0.2.2/bindings/bindings_component_type.o
--------------------------------------------------------------------------------
/host-apis/wasi-0.2.3/bindings/bindings_component_type.o:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bytecodealliance/StarlingMonkey/HEAD/host-apis/wasi-0.2.3/bindings/bindings_component_type.o
--------------------------------------------------------------------------------
/tests/wpt-harness/expectations/dom/events/EventTarget-addEventListener.any.js.json:
--------------------------------------------------------------------------------
1 | {
2 | "Adding a null event listener should succeed": {
3 | "status": "PASS"
4 | }
5 | }
--------------------------------------------------------------------------------
/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/response/response-blob-realm.any.js.json:
--------------------------------------------------------------------------------
1 | {
2 | "realm of the Uint8Array from Response bytes()": {
3 | "status": "FAIL"
4 | }
5 | }
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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/wpt-harness/expectations/dom/events/EventTarget-removeEventListener.any.js.json:
--------------------------------------------------------------------------------
1 | {
2 | "removing a null event listener should succeed": {
3 | "status": "PASS"
4 | }
5 | }
--------------------------------------------------------------------------------
/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/streams/piping/general-addition.any.js.json:
--------------------------------------------------------------------------------
1 | {
2 | "enqueue() must not synchronously call write algorithm": {
3 | "status": "PASS"
4 | }
5 | }
--------------------------------------------------------------------------------
/debugger/vscode-dap-extension/images/starlingmonkey-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bytecodealliance/StarlingMonkey/HEAD/debugger/vscode-dap-extension/images/starlingmonkey-logo.png
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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/wpt-harness/expectations/url/urlsearchparams-get.any.js.json:
--------------------------------------------------------------------------------
1 | {
2 | "Get basics": {
3 | "status": "PASS"
4 | },
5 | "More get() basics": {
6 | "status": "PASS"
7 | }
8 | }
--------------------------------------------------------------------------------
/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/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/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/redirect/redirect-keepalive.https.any.js.json:
--------------------------------------------------------------------------------
1 | {
2 | "[keepalive][iframe][load] mixed content redirect; setting up": {
3 | "status": "FAIL"
4 | }
5 | }
--------------------------------------------------------------------------------
/debugger/vscode-dap-extension/.gitignore:
--------------------------------------------------------------------------------
1 | out
2 | dist
3 | node_modules
4 | .vscode-test/
5 | npm-debug.log
6 | *.vsix
7 | .DS_Store
8 | sampleWorkspace/out
9 | sampleWorkspace/main.wasm
10 |
--------------------------------------------------------------------------------
/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/dom/events/EventTarget-add-remove-listener.any.js.json:
--------------------------------------------------------------------------------
1 | {
2 | "Removing an event listener without explicit capture arg should succeed": {
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/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/streams/readable-streams/constructor.any.js.json:
--------------------------------------------------------------------------------
1 | {
2 | "underlyingSource argument should be converted after queuingStrategy argument": {
3 | "status": "PASS"
4 | }
5 | }
--------------------------------------------------------------------------------
/host-apis/wasi-0.2.0/preview1-adapter-debug/wasi_snapshot_preview1.wasm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bytecodealliance/StarlingMonkey/HEAD/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/HEAD/host-apis/wasi-0.2.0/preview1-adapter-release/wasi_snapshot_preview1.wasm
--------------------------------------------------------------------------------
/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/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/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/e2e/init-location/init-location.js:
--------------------------------------------------------------------------------
1 | console.log(self.location.href);
2 |
3 | addEventListener("fetch", (event) => {
4 | console.log(self.location.hostname);
5 | event.respondWith(new Response("ok"));
6 | });
7 |
--------------------------------------------------------------------------------
/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/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/results-section.template.html:
--------------------------------------------------------------------------------
1 |
2 | | ${prefix}${title} |
3 | ${pass} / ${total} | duration: ${duration}ms |
4 | ${info}
5 |
6 | ${rows}
7 |
--------------------------------------------------------------------------------
/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/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/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/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 |
--------------------------------------------------------------------------------
/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/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 |
--------------------------------------------------------------------------------
/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/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/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/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/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/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 | }
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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/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/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 | }
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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/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/wpt-harness/expectations/fetch/api/abort/cache.https.any.js.json:
--------------------------------------------------------------------------------
1 | {
2 | "Signals are not stored in the cache API": {
3 | "status": "FAIL"
4 | },
5 | "Signals are not stored in the cache API, even if they're already aborted": {
6 | "status": "FAIL"
7 | }
8 | }
--------------------------------------------------------------------------------
/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 | }
--------------------------------------------------------------------------------
/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/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 |
7 |
8 | namespace builtins::web::text_codec {
9 | bool install(api::Engine *engine);
10 | }
11 |
12 |
13 |
14 | #endif
15 |
--------------------------------------------------------------------------------
/tests/e2e/no-init-location/expect_wizer_stderr.txt:
--------------------------------------------------------------------------------
1 | Exception while evaluating top-level script
2 | e2e/no-init-location/no-init-location.js:1:9 TypeError: location.href can only be used during request handling, or if an initialization-time location was set using `--init-location`
3 |
--------------------------------------------------------------------------------
/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 | }
--------------------------------------------------------------------------------
/debugger/vscode-dap-extension/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "search.exclude": {
3 | "out": true
4 | },
5 | "typescript.tsc.autoDetect": "off",
6 |
7 | "git.branchProtection": ["main"],
8 | "git.branchProtectionPrompt": "alwaysCommitToNewBranch"
9 | }
10 |
--------------------------------------------------------------------------------
/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 | }
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 | }
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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.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.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 |
--------------------------------------------------------------------------------
/builtins/web/streams/streams.h:
--------------------------------------------------------------------------------
1 | #ifndef BUILTINS_WEB_STREAMS_H
2 | #define BUILTINS_WEB_STREAMS_H
3 |
4 | #include "builtin.h"
5 |
6 |
7 |
8 | namespace builtins::web::streams {
9 | bool install(api::Engine *engine);
10 | } // namespace builtins::web::streams
11 |
12 |
13 |
14 | #endif
15 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/debugger/vscode-dap-extension/src/sourcemaps/README.md:
--------------------------------------------------------------------------------
1 | # Source Maps processing support
2 |
3 | This code was imported from Microsoft's (archived) [vscode-node-debug](https://github.com/microsoft/vscode-node-debug) project. It has been lightly modified to suite the needs of StarlingMonkey's debugger.
4 |
--------------------------------------------------------------------------------
/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 | }
--------------------------------------------------------------------------------
/AUTHORS.md:
--------------------------------------------------------------------------------
1 | The portions of this code found in the initial commit are Copyright © 2021-2023 Fastly Inc. and
2 | contributors to Fastly's
3 | [js-compute-runtime project](https://github.com/fastly/js-compute-runtime/).
4 |
5 | Changes following that initial commit are Copyright © the respective contributors.
6 |
--------------------------------------------------------------------------------
/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 | }
--------------------------------------------------------------------------------
/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 |
7 |
8 | namespace builtins::web::fetch {
9 |
10 | bool install(api::Engine *engine);
11 |
12 | } // namespace builtins::web::fetch
13 |
14 |
15 |
16 | #endif
17 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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/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/results-section-error.template.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | ${prefix}${title}
4 | Details
5 | Message: ${message}
6 | Stack:
${stack}
7 |
8 | |
9 |
10 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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/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 | }
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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/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": "PASS"
13 | }
14 | }
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 | }
--------------------------------------------------------------------------------
/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 |
7 |
8 | namespace builtins::web::queue_microtask {
9 |
10 | bool install(api::Engine *engine);
11 |
12 | } // namespace builtins::web::queue_microtask
13 |
14 |
15 |
16 | #endif
17 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/debugger/vscode-dap-extension/.vscodeignore:
--------------------------------------------------------------------------------
1 | .vscode/**/*
2 | .gitignore
3 | **/*.js.map
4 | build
5 | sampleWorkspace
6 | sampleWorkspace/out
7 | node_modules
8 | tsconfig.json
9 | out
10 | src
11 | tests
12 | **/*.ts
13 | !node_modules/source-map/**/*.js
14 | !node_modules/source-map/**/*.wasm
15 | !node_modules/source-map/package.json
16 |
--------------------------------------------------------------------------------
/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/dom/events/EventTarget-constructible.any.js.json:
--------------------------------------------------------------------------------
1 | {
2 | "A constructed EventTarget can be used as expected": {
3 | "status": "PASS"
4 | },
5 | "A constructed EventTarget implements dispatch correctly": {
6 | "status": "PASS"
7 | },
8 | "EventTarget can be subclassed": {
9 | "status": "PASS"
10 | }
11 | }
--------------------------------------------------------------------------------
/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/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/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/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/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/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/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 | }
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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/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/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/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 | }
--------------------------------------------------------------------------------
/cmake/weval.cmake:
--------------------------------------------------------------------------------
1 | set(WEVAL_VERSION v0.3.4)
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 |
--------------------------------------------------------------------------------
/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 | }
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 | }
--------------------------------------------------------------------------------
/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 |
9 |
10 | namespace builtins::web::structured_clone {
11 |
12 | bool install(api::Engine *engine);
13 |
14 | } // namespace builtins::web::structured_clone
15 |
16 |
17 |
18 | #endif
19 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 | }
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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": "PASS"
13 | }
14 | }
--------------------------------------------------------------------------------
/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 | }
--------------------------------------------------------------------------------
/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/wizer.cmake:
--------------------------------------------------------------------------------
1 | set(WIZER_VERSION v9.0.0 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 |
--------------------------------------------------------------------------------
/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 | }
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 | export { handler as event } from './event/event.js';
8 |
--------------------------------------------------------------------------------
/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/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 | }
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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/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/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 | }
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/debugger/vscode-dap-extension/tests/ts/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "main2",
3 | "version": "0.0.1",
4 | "scripts": {
5 | "compile": "mkdirp out && tsc && componentize-js --wit world.wit -o out/main2.wasm --runtime-args \"--enable-script-debugging\" dist/main2.js"
6 | },
7 | "devDependencies": {
8 | "mkdirp": "^3.0.1",
9 | "ts-loader": "^9.4.1",
10 | "typescript": "^4.8.4"
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/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/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 | }
--------------------------------------------------------------------------------
/cmake/wasi-sdk.cmake:
--------------------------------------------------------------------------------
1 | set(WASI_SDK_VERSION 25 CACHE STRING "Version of wasi-sdk to use" FORCE)
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_CPU}-${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 ${WASI_SDK_PREFIX}/share/cmake/wasi-sdk.cmake)
7 |
--------------------------------------------------------------------------------
/tests/wpt-harness/expectations/url/urlsearchparams-size.any.js.json:
--------------------------------------------------------------------------------
1 | {
2 | "URLSearchParams's size and deletion": {
3 | "status": "PASS"
4 | },
5 | "URLSearchParams's size and addition": {
6 | "status": "PASS"
7 | },
8 | "URLSearchParams's size when obtained from a URL": {
9 | "status": "PASS"
10 | },
11 | "URLSearchParams's size when obtained from a URL and using .search": {
12 | "status": "PASS"
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/builtins/web/event/global-event-target.h:
--------------------------------------------------------------------------------
1 | #ifndef BUILTINS_WEB_GLOBAL_EVENT_TARGET_H_
2 | #define BUILTINS_WEB_GLOBAL_EVENT_TARGET_H_
3 |
4 | #include "builtin.h"
5 |
6 |
7 |
8 | namespace builtins::web::event {
9 |
10 | JSObject *global_event_target();
11 |
12 | bool global_event_target_init(JSContext *cx, HandleObject global);
13 |
14 | } // namespace builtins::web::event
15 |
16 |
17 |
18 | #endif // BUILTINS_WEB_GLOBAL_EVENT_TARGET_H_
19 |
--------------------------------------------------------------------------------
/cmake/wasm-tools.cmake:
--------------------------------------------------------------------------------
1 | set(WASM_TOOLS_VERSION 1.235.0)
2 |
3 | set(WASM_TOOLS_URL https://github.com/bytecodealliance/wasm-tools/releases/download/v${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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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/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/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/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/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/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/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/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/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/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/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 | }
--------------------------------------------------------------------------------
/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::web::text_codec {
6 |
7 | bool install(api::Engine *engine) {
8 | if (!TextEncoder::init_class(engine->cx(), engine->global())) {
9 | return false;
10 | }
11 | if (!TextDecoder::init_class(engine->cx(), engine->global())) {
12 | return false;
13 | }
14 | return true;
15 | }
16 |
17 | } // namespace builtins::web::text_codec
18 |
19 |
20 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/debugger/vscode-dap-extension/src/extension.ts:
--------------------------------------------------------------------------------
1 | import {
2 | ExtensionContext,
3 | } from "vscode";
4 | import {
5 | activateStarlingMonkeyDebug,
6 | } from "./activateStarlingMonkeyDebugger.js";
7 |
8 | const runMode = "inline" as const; // TODO: bring back 'server' option
9 |
10 | export function activate(context: ExtensionContext) {
11 | switch (runMode) {
12 | case "inline":
13 | activateStarlingMonkeyDebug(context);
14 | break;
15 | }
16 | }
17 |
18 | export function deactivate() {}
19 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/tests/wpt-harness/expectations/dom/events/AddEventListenerOptions-once.any.js.json:
--------------------------------------------------------------------------------
1 | {
2 | "Once listener should be invoked only once": {
3 | "status": "PASS"
4 | },
5 | "Once listener should be invoked only once even if the event is nested": {
6 | "status": "PASS"
7 | },
8 | "Once listener should be added / removed like normal listeners": {
9 | "status": "PASS"
10 | },
11 | "Multiple once listeners should be invoked even if the stopImmediatePropagation is set": {
12 | "status": "PASS"
13 | }
14 | }
--------------------------------------------------------------------------------
/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/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/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/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/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 | }
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/tests/wpt-harness/expectations/fetch/api/basic/mode-no-cors.sub.any.js.json:
--------------------------------------------------------------------------------
1 | {
2 | "Fetch ../resources/top.txt with no-cors mode": {
3 | "status": "PASS"
4 | },
5 | "Fetch http://web-platform.test:8000/fetch/api/resources/top.txt with no-cors mode": {
6 | "status": "PASS"
7 | },
8 | "Fetch https://web-platform.test:8443/fetch/api/resources/top.txt with no-cors mode": {
9 | "status": "FAIL"
10 | },
11 | "Fetch http://web-platform.test:47413/fetch/api/resources/top.txt with no-cors mode": {
12 | "status": "FAIL"
13 | }
14 | }
--------------------------------------------------------------------------------
/runtime/allocator.cpp:
--------------------------------------------------------------------------------
1 | #include "allocator.h"
2 | #include "js/MemoryFunctions.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/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(js_malloc(str.size()), str.data(), str.size())));
13 | return JS_NewLatin1String(cx, std::move(chars), str.length());
14 | }
15 |
16 | } // namespace core
17 |
--------------------------------------------------------------------------------
/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/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 | }
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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/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/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 | }
--------------------------------------------------------------------------------
/debugger/vscode-dap-extension/tests/js/main.js:
--------------------------------------------------------------------------------
1 | var v = "bar";
2 | console.log("hello.");
3 | addEventListener('fetch', (event) => {
4 | foo(event);
5 | });
6 |
7 | function foo(ev) {
8 | let arrrr = [1, 2, 3];
9 | let obj = {
10 | a: 1,
11 | b: 2,
12 | c: 3
13 | };
14 | let re = /a/;
15 | barrrrrr(ev, obj);
16 | console.log("hello from foo");
17 | }
18 |
19 | function barrrrrr(evt, o) {
20 | let body = `Hello from content! ${o.b}`;
21 | let resp = new Response(body);
22 | evt.respondWith(resp);
23 | }
24 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 | }
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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-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 | }
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/debugger/vscode-dap-extension/tests/ts/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "outDir": "./dist/",
4 | "sourceMap": true,
5 | "noImplicitAny": true,
6 | "module": "es6",
7 | "target": "es2020",
8 | "jsx": "react",
9 | "skipLibCheck": true,
10 | "lib": [
11 | "ES2020",
12 | "WebWorker"
13 | ],
14 | "allowJs": true,
15 | "strict": true,
16 | "noImplicitReturns": true,
17 | "moduleResolution": "node"
18 | },
19 | "include": [
20 | "src/**/*"
21 | ]
22 | }
23 |
--------------------------------------------------------------------------------
/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 | }
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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/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/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/dom/events/AddEventListenerOptions-passive.any.js.json:
--------------------------------------------------------------------------------
1 | {
2 | "Supports passive option on addEventListener only": {
3 | "status": "PASS"
4 | },
5 | "preventDefault should be ignored if-and-only-if the passive option is true": {
6 | "status": "PASS"
7 | },
8 | "returnValue should be ignored if-and-only-if the passive option is true": {
9 | "status": "PASS"
10 | },
11 | "passive behavior of one listener should be unaffected by the presence of other listeners": {
12 | "status": "PASS"
13 | },
14 | "Equivalence of option values": {
15 | "status": "PASS"
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 | }
--------------------------------------------------------------------------------
/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 set_timeout(JSContext *cx, HandleObject handler, JS::HandleValueVector args, int32_t delay_ms,
9 | int32_t *timer_id);
10 |
11 | bool set_interval(JSContext *cx, HandleObject handler, JS::HandleValueVector args, int32_t delay_ms,
12 | int32_t *timer_id);
13 |
14 | void clear_timeout_or_interval(int32_t timer_id);
15 |
16 | bool install(api::Engine *engine);
17 |
18 | } // namespace builtins::web::timers
19 |
20 | #endif
21 |
--------------------------------------------------------------------------------
/debugger/vscode-dap-extension/tests/js/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | // Use IntelliSense to learn about possible attributes.
3 | // Hover to view descriptions of existing attributes.
4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5 | "version": "0.2.0",
6 | "configurations": [
7 | {
8 | "type": "starlingmonkey",
9 | "request": "launch",
10 | "name": "Debug StarlingMonkey component",
11 | "component": "${workspaceFolder}/main.wasm",
12 | "program": "${workspaceFolder}/main.js",
13 | "stopOnEntry": false,
14 | "trace": true
15 | }
16 | ]
17 | }
18 |
--------------------------------------------------------------------------------
/.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 | /deps/*.lock
32 | /deps/*-source
33 |
--------------------------------------------------------------------------------
/debugger/vscode-dap-extension/tests/ts/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | // Use IntelliSense to learn about possible attributes.
3 | // Hover to view descriptions of existing attributes.
4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5 | "version": "0.2.0",
6 | "configurations": [
7 | {
8 | "type": "starlingmonkey",
9 | "request": "launch",
10 | "name": "Debug StarlingMonkey component",
11 | "component": "${workspaceFolder}/out/main2.wasm",
12 | "program": "${workspaceFolder}/src/main2.ts",
13 | "stopOnEntry": false,
14 | "trace": true
15 | }
16 | ]
17 | }
18 |
--------------------------------------------------------------------------------
/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-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/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 | }
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 --wpt-mode --legacy-script wpt-test-runner.js wpt-runtime.wasm
22 |
--------------------------------------------------------------------------------
/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/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/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/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/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/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/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 | }
--------------------------------------------------------------------------------
/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 : uint8_t {
13 | Log,
14 | Info,
15 | Debug,
16 | Warn,
17 | Error,
18 | };
19 | enum Slots : uint8_t { 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 |
--------------------------------------------------------------------------------
/debugger/vscode-dap-extension/tests/ts/src/main2.ts:
--------------------------------------------------------------------------------
1 | const v = "bar";
2 | console.log("hello.");
3 |
4 | //@ts-ignore
5 | addEventListener('fetch', (event: FetchEvent) => {
6 | foo(event);
7 | });
8 |
9 | function foo(ev: FetchEvent) {
10 | let arrrr = [1, 2, 3];
11 | let obj = {
12 | a: 1,
13 | b: 2,
14 | c: 3
15 | };
16 | let re = /a/;
17 | barrrrrr(ev, obj);
18 | console.log("hello from foo");
19 | }
20 |
21 | function barrrrrr(evt: FetchEvent, o: { b: number }) {
22 | let body = `Hello from +++EVEN MORE SSSSAUCIER+++ TYPESCRIPTIER content! ${o.b}`;
23 | let resp = new Response(body);
24 | evt.respondWith(resp);
25 | }
26 |
--------------------------------------------------------------------------------
/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 | }
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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/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 | }
--------------------------------------------------------------------------------
/cmake/cbindgen.cmake:
--------------------------------------------------------------------------------
1 | set(CBINDGEN_VERSION 0.29.0)
2 |
3 | # cbindgen doesn't have pre-built binaries for all platforms, so we install it via cargo-binstall. Which we install first, too.
4 | find_program(CBINDGEN_EXECUTABLE cbindgen)
5 | if(NOT CBINDGEN_EXECUTABLE)
6 | find_program(CARGO_BINSTALL_EXECUTABLE cargo-binstall)
7 | if(NOT CARGO_BINSTALL_EXECUTABLE)
8 | execute_process(
9 | COMMAND curl -L --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh
10 | COMMAND bash
11 | )
12 | endif()
13 | execute_process(
14 | COMMAND cargo binstall -y cbindgen
15 | )
16 | endif()
17 |
--------------------------------------------------------------------------------
/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/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 | }
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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/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/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 | }
--------------------------------------------------------------------------------
/docs/src/SUMMARY.md:
--------------------------------------------------------------------------------
1 | # Summary
2 |
3 | [Introduction](./README.md)
4 |
5 | # Getting Started
6 |
7 | - [Building and Running](./getting-started/building.md)
8 | - [Testing](./getting-started/testing.md)
9 |
10 | # Developer Guide
11 |
12 | - [Project workflow using `just`](./developer/just.md)
13 | - [Devoloping Builtins in C++](./developer/builtins-cpp.md)
14 | - [🚧 Devoloping Builtins in Rust](./developer/builtins-rust.md)
15 | - [ Devoloping Changes to SpiderMonkey](./developer/spidermonkey.md)
16 | - [🚧 Debugging StarlingMonkey application](./developer/debugging.md)
17 |
18 | # Community
19 |
20 | - [Community](./resources/community.md)
21 | - [Adopters](./ADOPTERS.md)
22 | - [Code of Conduct](./CODE_OF_CONDUCT.md)
23 |
--------------------------------------------------------------------------------
/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 | }
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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/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 | }
--------------------------------------------------------------------------------
/cmake/binaryen.cmake:
--------------------------------------------------------------------------------
1 | set(BINARYEN_VERSION 123)
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 |
--------------------------------------------------------------------------------
/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 | }
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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/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/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/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 | }
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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/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/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/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/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/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/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 | }
--------------------------------------------------------------------------------
/builtins/web/base64.h:
--------------------------------------------------------------------------------
1 | #ifndef BUILTINS_WEB_BASE64_H
2 | #define BUILTINS_WEB_BASE64_H
3 |
4 | #include "extension-api.h"
5 |
6 |
7 |
8 | namespace builtins::web::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, const std::string& v);
22 |
23 | } // namespace builtins::web::base64
24 |
25 |
26 |
27 | #endif
28 |
--------------------------------------------------------------------------------
/debugger/vscode-dap-extension/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ES2022",
4 | "module": "NodeNext",
5 | "moduleResolution": "NodeNext",
6 | "outDir": "out",
7 | "lib": [
8 | "ES2022"
9 | ],
10 | "strict": true,
11 | "noImplicitReturns": true,
12 | "noFallthroughCasesInSwitch": true,
13 | "noImplicitAny": true,
14 | "noImplicitThis": true,
15 | "noUnusedLocals": true,
16 | "strictNullChecks": true,
17 | "strictFunctionTypes": true,
18 | "noUnusedParameters": true,
19 | "sourceMap": true,
20 | "preserveConstEnums": true,
21 | "removeComments": false,
22 | "inlineSourceMap": false
23 | },
24 | "exclude": [
25 | "node_modules",
26 | "tests"
27 | ]
28 | }
29 |
--------------------------------------------------------------------------------
/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 | }
--------------------------------------------------------------------------------
/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::web::form_data {
8 |
9 | class FormDataParser {
10 | public:
11 | virtual JSObject *parse(JSContext *cx, std::string_view body) = 0;
12 |
13 | FormDataParser() = default;
14 | virtual ~FormDataParser() = default;
15 |
16 | FormDataParser(const FormDataParser &) = default;
17 | FormDataParser(FormDataParser &&) = delete;
18 |
19 | FormDataParser &operator=(const FormDataParser &) = default;
20 | FormDataParser &operator=(FormDataParser &&) = delete;
21 |
22 | static std::unique_ptr create(std::string_view content_type);
23 | };
24 |
25 | } // namespace builtins::web::form_data
26 |
27 | #endif // BUILTINS_WEB_FORM_DATA_PARSER_
28 |
--------------------------------------------------------------------------------
/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/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 | }
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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/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/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 | }
--------------------------------------------------------------------------------
/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 |
7 |
8 | namespace builtins::web::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 builtins::web::crypto
26 |
27 |
28 |
29 | #endif // BUILTINS_WEB_CRYPTO_UUID_H
30 |
--------------------------------------------------------------------------------
/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-wasip1)
13 |
14 | CPMAddPackage("gh:corrosion-rs/corrosion@0.5.1")
15 | string(TOLOWER ${Rust_CARGO_HOST_ARCH} HOST_ARCH)
16 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 | }
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 | }
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/release-please-config.json:
--------------------------------------------------------------------------------
1 | {
2 | "separate-pull-requests": true,
3 | "bump-minor-pre-major": false,
4 | "bump-patch-for-minor-pre-major": false,
5 | "include-v-in-tag": true,
6 | "bootstrap-sha": "6cdcc0e8ba3cc8a80e026af3c0867a1f63e57d2a",
7 | "packages": {
8 | ".": {
9 | "package-name": "starlingmonkey",
10 | "release-type": "simple",
11 | "exclude-paths": ["debugger/vscode-dap-extension/**"],
12 | "changelog-sections": [
13 | { "type": "feat", "section": "Features" },
14 | { "type": "fix", "section": "Bug Fixes" },
15 | { "type": "feat", "scope": "debugger", "hidden": true },
16 | { "type": "fix", "scope": "debugger", "hidden": true },
17 | { "type": "chore", "scope": "debugger", "hidden": true }
18 | ]
19 | },
20 | "debugger/vscode-dap-extension": {
21 | "package-name": "starlingmonkey-debugger",
22 | "release-type": "node"
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/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/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/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 | }
--------------------------------------------------------------------------------
/debugger/vscode-dap-extension/src/signals.ts:
--------------------------------------------------------------------------------
1 | export class Signal {
2 | private _promise!: Promise;
3 | private _resolve!: (val: Val) => void;
4 | private _reject!: (err: Err) => void;
5 | private _handled = false;
6 |
7 | constructor() {
8 | this.setPromise();
9 | }
10 |
11 | wait(): Promise {
12 | this._handled = true;
13 | return this._promise;
14 | }
15 |
16 | resolve(value: Val) {
17 | this._resolve(value);
18 | this.setPromise();
19 | }
20 |
21 | reject(err: Err) {
22 | this._reject(err);
23 | this.setPromise();
24 | }
25 |
26 | get handled() {
27 | return this._handled;
28 | }
29 |
30 | private setPromise() {
31 | this._handled = false;
32 | this._promise = new Promise((resolve, reject) => {
33 | this._resolve = resolve;
34 | this._reject = reject;
35 | });
36 | }
37 | }
--------------------------------------------------------------------------------
/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 | }
--------------------------------------------------------------------------------
/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 |
4 | #include
5 | #include
6 |
7 | class CryptoKeyECComponents final {
8 | public:
9 | enum class Type : uint8_t { Public, Private };
10 | Type type;
11 |
12 | // Private and public keys.
13 | std::string x;
14 | std::string y;
15 |
16 | // Only private keys.
17 | std::string d;
18 | static std::unique_ptr createPublic(std::string_view x,
19 | std::string_view y);
20 |
21 | static std::unique_ptr
22 | createPrivate(std::string_view x, std::string_view y, std::string_view d);
23 |
24 | CryptoKeyECComponents(std::string_view x, std::string_view y);
25 |
26 | CryptoKeyECComponents(std::string_view x, std::string_view y, std::string_view d);
27 | };
28 |
29 | #endif
30 |
--------------------------------------------------------------------------------
/debugger/vscode-dap-extension/.vscode/tasks.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "2.0.0",
3 | "tasks": [
4 | {
5 | "type": "npm",
6 | "script": "build",
7 | "isBackground": false,
8 | "group": {
9 | "isDefault": true,
10 | "kind": "build"
11 | },
12 | "problemMatcher": "$esbuild",
13 | "label": "npm: build"
14 | },
15 | {
16 | "type": "npm",
17 | "script": "watch",
18 | "group": "build",
19 | "problemMatcher": "$esbuild-watch",
20 | "isBackground": true,
21 | "label": "npm: watch"
22 | },
23 | {
24 | "type": "npm",
25 | "script": "watch-web",
26 | "group": "build",
27 | "problemMatcher": "$esbuild-watch",
28 | "isBackground": true,
29 | "label": "npm: watch web"
30 | }
31 | ]
32 | }
--------------------------------------------------------------------------------
/debugger/vscode-dap-extension/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | ## [0.2.1](https://github.com/bytecodealliance/StarlingMonkey/compare/starlingmonkey-debugger-v0.2.0...starlingmonkey-debugger-v0.2.1) (2025-10-17)
4 |
5 |
6 | ### Bug Fixes
7 |
8 | * **debugger:** Fix path normalization in debugger sourcemaps handling ([#279](https://github.com/bytecodealliance/StarlingMonkey/issues/279)) ([afcf222](https://github.com/bytecodealliance/StarlingMonkey/commit/afcf222f512eb211d1b29d7a427fc8db6dd27f84))
9 |
10 | ## 0.2.0 (2025-08-20)
11 |
12 | Initial preview release of the extension, supporting the usual basics of debugging: setting breakpoints, changing values on the stack, stepping over and into expressions, showing stacks, etc, both for pure JS and for languages compiled to JS, provided they generate useful sourcemaps.
13 |
14 | As the [README.md](README.md) file says, things might break in surprising and unfortunate ways. For the most part, the extension should work well, though.
15 |
--------------------------------------------------------------------------------
/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/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 | }
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
7 |
8 | namespace builtins::web::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 : uint8_t { 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 builtins::web::worker_location
30 |
31 |
32 |
33 | #endif
34 |
--------------------------------------------------------------------------------
/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": "PASS"
40 | },
41 | "URLSearchParams must not do newline normalization": {
42 | "status": "PASS"
43 | }
44 | }
--------------------------------------------------------------------------------
/docs/book.toml:
--------------------------------------------------------------------------------
1 | [book]
2 | authors = ["StarlingMonkey Authors"]
3 | language = "en"
4 | multilingual = false
5 | src = "src"
6 | title = "StarlingMonkey Developer Documentation"
7 | description = "Documentation for StarlingMonkey"
8 |
9 | [preprocessor.alerts]
10 | renderers = ["html", "linkcheck"]
11 |
12 | [output.linkcheck]
13 | traverse-parent-directories = true
14 |
15 | [output.html]
16 | git-repository-url = "https://github.com/bytecodealliance/StarlingMonkey"
17 | edit-url-template = "https://github.com/bytecodealliance/StarlingMonkey/edit/main/docs/{path}"
18 | default-theme = "light"
19 | preferred-dark-theme = "navy"
20 | copy-fonts = true
21 | no-section-label = false
22 | smart-punctuation = true
23 |
24 | [output.html.fold]
25 | enable = true
26 | level = 1
27 |
28 | [output.html.search]
29 | enable = true
30 | limit-results = 30
31 | teaser-word-count = 30
32 | use-boolean-and = true
33 | boost-title = 2
34 | boost-hierarchy = 1
35 | boost-paragraph = 1
36 | expand = true
37 | heading-split-level = 3
38 |
--------------------------------------------------------------------------------
/tests/wpt-harness/expectations/dom/events/Event-constructors.any.js.json:
--------------------------------------------------------------------------------
1 | {
2 | "Event-constructors": {
3 | "status": "PASS"
4 | },
5 | "Event-constructors 1": {
6 | "status": "PASS"
7 | },
8 | "Event-constructors 2": {
9 | "status": "PASS"
10 | },
11 | "Event-constructors 3": {
12 | "status": "PASS"
13 | },
14 | "Event-constructors 4": {
15 | "status": "PASS"
16 | },
17 | "Event-constructors 5": {
18 | "status": "PASS"
19 | },
20 | "Event-constructors 6": {
21 | "status": "PASS"
22 | },
23 | "Event-constructors 7": {
24 | "status": "PASS"
25 | },
26 | "Event-constructors 8": {
27 | "status": "PASS"
28 | },
29 | "Event-constructors 9": {
30 | "status": "PASS"
31 | },
32 | "Event-constructors 10": {
33 | "status": "PASS"
34 | },
35 | "Event-constructors 11": {
36 | "status": "PASS"
37 | },
38 | "Event-constructors 12": {
39 | "status": "PASS"
40 | },
41 | "Event-constructors 13": {
42 | "status": "PASS"
43 | }
44 | }
--------------------------------------------------------------------------------
/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/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/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 | }
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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();
--------------------------------------------------------------------------------
/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.42.0)
6 | set(CPM_HASH_SUM "2020b4fc42dba44817983e06342e682ecfc3d2f484a581f11cc5731fbe4dce8a")
7 |
8 | if(CPM_SOURCE_CACHE)
9 | set(CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
10 | elseif(DEFINED ENV{CPM_SOURCE_CACHE})
11 | set(CPM_DOWNLOAD_LOCATION "$ENV{CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
12 | else()
13 | set(CPM_DOWNLOAD_LOCATION "${CMAKE_BINARY_DIR}/cmake/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
14 | endif()
15 |
16 | # Expand relative path. This is important if the provided path contains a tilde (~)
17 | get_filename_component(CPM_DOWNLOAD_LOCATION ${CPM_DOWNLOAD_LOCATION} ABSOLUTE)
18 |
19 | file(DOWNLOAD
20 | https://github.com/cpm-cmake/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake
21 | ${CPM_DOWNLOAD_LOCATION} EXPECTED_HASH SHA256=${CPM_HASH_SUM}
22 | )
23 |
24 | include(${CPM_DOWNLOAD_LOCATION})
25 |
--------------------------------------------------------------------------------
/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
16 | -Wimplicit-fallthrough -Wno-unknown-warning-option -Wno-invalid-offsetof
17 | -fno-sized-deallocation -fno-aligned-new -mthread-model single
18 | -fPIC -fno-rtti -fno-exceptions -fno-math-errno -pipe
19 | -fno-omit-frame-pointer -funwind-tables -m32
20 | )
21 | list(JOIN CMAKE_CXX_FLAGS " " CMAKE_CXX_FLAGS)
22 |
23 | list(APPEND CMAKE_C_FLAGS
24 | -Wall -Werror -Wno-unknown-attributes -Wno-pointer-to-int-cast
25 | -Wno-int-to-pointer-cast -m32
26 | )
27 | list(JOIN CMAKE_C_FLAGS " " CMAKE_C_FLAGS)
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 |
--------------------------------------------------------------------------------
/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 |
7 |
8 | namespace builtins::web::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 : uint8_t { 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 builtins::web::text_codec
31 |
32 |
33 |
34 | #endif
35 |
--------------------------------------------------------------------------------
/builtins/web/crypto/crypto.h:
--------------------------------------------------------------------------------
1 | #ifndef BUILTINS_WEB_CRYPTO_H
2 | #define BUILTINS_WEB_CRYPTO_H
3 |
4 | #include "builtin.h"
5 |
6 |
7 |
8 | namespace builtins::web::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 : uint8_t { 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 builtins::web::crypto
34 |
35 |
36 |
37 | #endif
38 |
--------------------------------------------------------------------------------
/builtins/web/event/custom-event.h:
--------------------------------------------------------------------------------
1 | #ifndef BUILTINS_WEB_CUSTOM_EVENT_H_
2 | #define BUILTINS_WEB_CUSTOM_EVENT_H_
3 |
4 | #include "builtin.h"
5 | #include "event.h"
6 |
7 |
8 |
9 | namespace builtins::web::event {
10 |
11 | class CustomEvent : public BuiltinImpl {
12 | static bool detail_get(JSContext *cx, unsigned argc, JS::Value *vp);
13 |
14 | public:
15 | static constexpr int ParentSlots = Event::Slots::Count;
16 | enum Slots : uint8_t { Detail = ParentSlots, Count };
17 |
18 | static constexpr const char *class_name = "CustomEvent";
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 bool init_class(JSContext *cx, HandleObject global);
29 | static bool constructor(JSContext *cx, unsigned argc, Value *vp);
30 | };
31 |
32 | } // namespace builtins::web::event
33 |
34 |
35 |
36 | #endif // BUILTINS_WEB_CUSTOM_EVENT_H_
37 |
--------------------------------------------------------------------------------
/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 | }
--------------------------------------------------------------------------------
/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 |
7 |
8 | namespace builtins::web::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 : uint8_t { 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 builtins::web::performance
31 |
32 |
33 |
34 | #endif
35 |
--------------------------------------------------------------------------------
/builtins/web/abort/abort-controller.h:
--------------------------------------------------------------------------------
1 | #ifndef WEB_BUILTINS_ABORT_CONTROLLER_H
2 | #define WEB_BUILTINS_ABORT_CONTROLLER_H
3 |
4 | #include "builtin.h"
5 |
6 |
7 |
8 | namespace builtins::web::abort {
9 |
10 | class AbortController : public BuiltinImpl {
11 | static bool signal_get(JSContext *cx, unsigned argc, JS::Value *vp);
12 | static bool abort(JSContext *cx, unsigned argc, JS::Value *vp);
13 |
14 | static JSObject *create(JSContext *cx);
15 |
16 | public:
17 | static constexpr const char *class_name = "AbortController";
18 | static constexpr unsigned ctor_length = 0;
19 |
20 | enum Slots : uint8_t { Signal = 0, Count };
21 |
22 | static const JSFunctionSpec static_methods[];
23 | static const JSPropertySpec static_properties[];
24 | static const JSFunctionSpec methods[];
25 | static const JSPropertySpec properties[];
26 |
27 | static bool init_class(JSContext *cx, HandleObject global);
28 | static bool constructor(JSContext *cx, unsigned argc, Value *vp);
29 | };
30 |
31 | } // namespace builtins::web::abort
32 |
33 |
34 |
35 |
36 |
37 | #endif // WEB_BUILTINS_ABORT_CONTROLLER_H
38 |
--------------------------------------------------------------------------------
/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 | }
--------------------------------------------------------------------------------
/runtime/allocator.h:
--------------------------------------------------------------------------------
1 | #ifndef JS_COMPUTE_RUNTIME_ALLOCATOR_H
2 | #define JS_COMPUTE_RUNTIME_ALLOCATOR_H
3 |
4 | #include
5 |
6 | struct JSContext;
7 |
8 | /// We need a handle to the JSContext in order to use JS_realloc in the
9 | /// implementation of cabi_realloc. Unfortunately way that we can do this now is
10 | /// to keep the context pointer in a global that can be used there. This global
11 | /// is initialized in js-compute-runtime.cpp.
12 | extern JSContext *CONTEXT;
13 |
14 | extern "C" {
15 |
16 | /// A strong symbol to override the cabi_realloc defined by wit-bindgen. This
17 | /// version of cabi_realloc uses JS_malloc under the hood.
18 | void *cabi_realloc(void *ptr, size_t orig_size, size_t align, size_t new_size);
19 |
20 | /// A more ergonomic version of cabi_realloc for fresh allocations.
21 | inline void *cabi_malloc(size_t bytes, size_t align) { return cabi_realloc(nullptr, 0, align, bytes); }
22 |
23 | /// Not required by wit-bindgen generated code, but a usefully named version of
24 | /// JS_free that can help with identifying where memory allocated by the c-abi.
25 | void cabi_free(void *ptr);
26 | }
27 |
28 | #endif
29 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 | }
--------------------------------------------------------------------------------
/debugger/vscode-dap-extension/eslint.config.mjs:
--------------------------------------------------------------------------------
1 | import js from "@eslint/js";
2 | import tseslint from "typescript-eslint";
3 | import { defineConfig, globalIgnores } from "eslint/config";
4 |
5 | export default tseslint.config(
6 | globalIgnores(["src/sourcemaps/*.ts", "**/*.d.ts", "tests/**/*", "dist/**/*", "out/**/*", "starling-debugger/**/*", "eslint.config.mjs"]),
7 | js.configs.recommended,
8 | tseslint.configs.recommended,
9 | {
10 | rules: {
11 | // "@typescript-eslint/no-explicit-any": "off",
12 | "@typescript-eslint/naming-convention": "warn",
13 | "@typescript-eslint/prefer-as-const": "warn",
14 | "@typescript-eslint/no-unused-vars": [
15 | "warn",
16 | { argsIgnorePattern: "^_", varsIgnorePattern: "^_", caughtErrorsIgnorePattern: "^_" }
17 | ],
18 | "no-unused-vars": "off",
19 | "prefer-const": "warn",
20 | curly: "warn",
21 | eqeqeq: "warn",
22 | "@typescript-eslint/no-explicit-any": 'warn',
23 | "no-throw-literal": "warn",
24 | semi: "error",
25 | },
26 | }
27 | );
28 |
--------------------------------------------------------------------------------
/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/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 | }
--------------------------------------------------------------------------------
/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 "native-stream-sink.h"
6 | #include "native-stream-source.h"
7 | #include "transform-stream-default-controller.h"
8 | #include "transform-stream.h"
9 |
10 | namespace builtins::web::streams {
11 |
12 | bool install(api::Engine *engine) {
13 | if (!NativeStreamSource::init_class(engine->cx(), engine->global())) {
14 | return false;
15 | }
16 | if (!NativeStreamSink::init_class(engine->cx(), engine->global())) {
17 | return false;
18 | }
19 | if (!TransformStreamDefaultController::init_class(engine->cx(), engine->global())) {
20 | return false;
21 | }
22 | if (!TransformStream::init_class(engine->cx(), engine->global())) {
23 | return false;
24 | }
25 | if (!CompressionStream::init_class(engine->cx(), engine->global())) {
26 | return false;
27 | }
28 | if (!DecompressionStream::init_class(engine->cx(), engine->global())) {
29 | return false;
30 | }
31 | if (!BufReader::init_class(engine->cx(), engine->global())) {
32 | return false;
33 | }
34 | return true;
35 | }
36 |
37 | } // namespace builtins::web::streams
38 |
--------------------------------------------------------------------------------
/runtime/debugger.h:
--------------------------------------------------------------------------------
1 | #ifndef DEBUGGER_H
2 | #define DEBUGGER_H
3 |
4 | #include "extension-api.h"
5 |
6 | namespace content_debugger {
7 | /**
8 | * Establish a debug connection via a TCP socket and start debugging using a debugger script
9 | * received via the new connection.
10 | * Only active in builds with the `ENABLE_JS_DEBUGGER` CMake option set.
11 | *
12 | * @param content_already_initialized Whether the content script has already run
13 | *
14 | * For more detail on using the Debugger API, see
15 | * https://firefox-source-docs.mozilla.org/js/Debugger/index.html
16 | *
17 | * @return the global object that serves as the debugger
18 | */
19 | void maybe_init_debugger(api::Engine *engine, bool content_already_initialized);
20 |
21 | /**
22 | * Get the path to a replacement script to evaluate instead of the content script.
23 | * Always returns `false` in builds without the `ENABLE_JS_DEBUGGER` CMake option set.
24 | *
25 | * @return the path to the replacement script, if any
26 | */
27 | mozilla::Maybe replacement_script_path();
28 |
29 | bool dbg_print(JSContext *cx, unsigned argc, Value *vp);
30 | } // namespace content_debugger
31 |
32 | #endif // DEBUGGER_H
33 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/builtins/web/abort/weak-index-set.h:
--------------------------------------------------------------------------------
1 | #ifndef WEB_BUILTINS_WEAK_INDEX_SET_
2 | #define WEB_BUILTINS_WEAK_INDEX_SET_
3 |
4 | #include "builtin.h"
5 | #include "js/GCVector.h"
6 |
7 |
8 | // Default GC policy_ for `js::GCVector` is _appropriate for weak references_:
9 | // it invokes `GCPolicy::traceWeak` to drop unreachable elements automatically.
10 | using WeakVec = JS::GCVector, 8, js::SystemAllocPolicy>;
11 |
12 | class WeakIndexSet {
13 | WeakVec items_;
14 |
15 | public:
16 | WeakIndexSet() = default;
17 |
18 | bool insert(JSObject* obj) {
19 | auto *it = std::find_if(items_.begin(), items_.end(), [&obj](const auto &item) { return item == obj; });
20 |
21 | if (it == items_.end()) {
22 | return items_.append(obj);
23 | }
24 | return true;
25 | }
26 |
27 | bool remove(JSObject* obj) {
28 | items_.eraseIf([&obj](const auto &item) { return item == obj; });
29 | return true;
30 | }
31 |
32 | WeakVec &items() { return items_;}
33 | [[nodiscard]] const WeakVec &items() const { return items_; }
34 |
35 | void trace(JSTracer* trc) { items_.trace(trc); }
36 |
37 | bool traceWeak(JSTracer* trc) { return items_.traceWeak(trc); }
38 | };
39 |
40 | #endif // WEB_BUILTINS_WEAK_INDEX_SET_
41 |
--------------------------------------------------------------------------------
/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/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 | }
--------------------------------------------------------------------------------
/debugger/vscode-dap-extension/src/sourcemaps/LICENSE.txt:
--------------------------------------------------------------------------------
1 | VS Code - Node Debug
2 |
3 | Copyright (c) Microsoft Corporation, StarlingMonkey contributors
4 |
5 | All rights reserved.
6 |
7 | MIT License
8 |
9 | Permission is hereby granted, free of charge, to any person obtaining a copy
10 | of this software and associated documentation files (the "Software"), to deal
11 | in the Software without restriction, including without limitation the rights
12 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 | copies of the Software, and to permit persons to whom the Software is
14 | furnished to do so, subject to the following conditions:
15 |
16 | The above copyright notice and this permission notice shall be included in all
17 | copies or substantial portions of the Software.
18 |
19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25 | SOFTWARE.
26 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 | }
--------------------------------------------------------------------------------