Showing preview only (4,873K chars total). Download the full file or copy to clipboard to get everything.
Repository: awslabs/llrt
Branch: main
Commit: 36bd4a837d3f
Files: 657
Total size: 4.5 MB
Directory structure:
gitextract_jm62atds/
├── .cargo/
│ └── config.toml
├── .fleet/
│ └── settings.json
├── .github/
│ ├── dependabot.yml
│ ├── pull_request_template.md
│ └── workflows/
│ ├── build-modules.yml
│ ├── build.yml
│ ├── ci.yml
│ ├── publish.yml
│ └── release.yml
├── .gitignore
├── .gitmodules
├── .prettierignore
├── .vscode/
│ ├── launch.json
│ └── settings.json
├── .yarnrc.yml
├── API.md
├── CHANGELOG.md
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── Cargo.toml
├── GOVERNANCE.md
├── LICENSE
├── MAINTAINERS.md
├── Makefile
├── NOTICE
├── README.md
├── THIRD_PARTY_LICENSES
├── benchmarks/
│ └── v8-v7/
│ ├── README.txt
│ ├── base.js
│ ├── crypto.js
│ ├── deltablue.js
│ ├── earley-boyer.js
│ ├── index.js
│ ├── navier-stokes.js
│ ├── raytrace.js
│ ├── regexp.js
│ ├── richards.js
│ └── splay.js
├── build.mjs
├── example/
│ ├── clear-ddb-table.mjs
│ ├── functions/
│ │ ├── build.mjs
│ │ ├── package.json
│ │ ├── src/
│ │ │ ├── api.ts
│ │ │ ├── hello.mjs
│ │ │ ├── non-included-sdk.mjs
│ │ │ ├── react/
│ │ │ │ ├── App.css
│ │ │ │ ├── App.tsx
│ │ │ │ ├── CreateTodo.tsx
│ │ │ │ ├── TodoItem.tsx
│ │ │ │ ├── TodoList.css
│ │ │ │ ├── TodoList.tsx
│ │ │ │ ├── index.html
│ │ │ │ └── index.tsx
│ │ │ ├── ssr.ts
│ │ │ ├── types.d.ts
│ │ │ ├── v2.js
│ │ │ ├── v3-lib.mjs
│ │ │ ├── v3-mono.mjs
│ │ │ ├── v3-s3.mjs
│ │ │ └── v3.mjs
│ │ └── tsconfig.json
│ ├── infrastructure/
│ │ ├── cdk.json
│ │ ├── package.json
│ │ ├── src/
│ │ │ └── index.ts
│ │ └── tsconfig.json
│ ├── llrt-sam/
│ │ ├── .gitignore
│ │ ├── README.md
│ │ ├── hello-world/
│ │ │ ├── app.ts
│ │ │ ├── package.json
│ │ │ └── tsconfig.json
│ │ ├── samconfig.toml
│ │ └── template.yaml
│ ├── llrt-sam-container-image/
│ │ ├── .gitignore
│ │ ├── README.md
│ │ ├── events/
│ │ │ └── event.json
│ │ ├── hello-world/
│ │ │ ├── Dockerfile
│ │ │ └── app.mjs
│ │ ├── samconfig.toml
│ │ └── template.yaml
│ └── register-hooks/
│ ├── hooks/
│ │ ├── calc.js
│ │ ├── fs.js
│ │ ├── http.js
│ │ └── v8.js
│ ├── simple-server.js
│ ├── simple-server.sh
│ ├── src/
│ │ └── http.js
│ ├── test.js
│ └── test.sh
├── fixtures/
│ ├── a.js
│ ├── b.js
│ ├── c.cjs
│ ├── cjs-handler.cjs
│ ├── d.cjs
│ ├── define-property-export.cjs
│ ├── empty.js
│ ├── empty.lrt
│ ├── export-function.cjs
│ ├── fs/
│ │ └── readdir/
│ │ ├── readdir.js
│ │ └── recursive/
│ │ └── readdir.js
│ ├── handler.mjs
│ ├── hello.js
│ ├── hello.txt
│ ├── import.cjs
│ ├── import.js
│ ├── local.mjs
│ ├── node_modules/
│ │ ├── elem-aws-lambda-powertools/
│ │ │ ├── commons/
│ │ │ │ ├── lib/
│ │ │ │ │ ├── cjs/
│ │ │ │ │ │ ├── index.js
│ │ │ │ │ │ └── typeUtils.js
│ │ │ │ │ └── esm/
│ │ │ │ │ ├── index.js
│ │ │ │ │ └── typeUtils.js
│ │ │ │ └── package.json
│ │ │ └── jmespath/
│ │ │ ├── lib/
│ │ │ │ ├── cjs/
│ │ │ │ │ └── index.js
│ │ │ │ └── esm/
│ │ │ │ └── index.js
│ │ │ └── package.json
│ │ ├── elem-debug/
│ │ │ ├── package.json
│ │ │ └── src/
│ │ │ └── browser.js
│ │ ├── elem-hono/
│ │ │ ├── dist/
│ │ │ │ ├── cjs/
│ │ │ │ │ └── utils/
│ │ │ │ │ └── url.js
│ │ │ │ └── index.js
│ │ │ └── package.json
│ │ ├── elem-lodash.merge/
│ │ │ ├── index.js
│ │ │ └── package.json
│ │ ├── elem-react-dom/
│ │ │ ├── cjs/
│ │ │ │ ├── react-dom-server.edge.development.js
│ │ │ │ └── react-dom.development.js
│ │ │ ├── index.js
│ │ │ ├── package.json
│ │ │ └── server.edge.js
│ │ └── elem-uuid/
│ │ ├── dist/
│ │ │ └── commonjs-browser/
│ │ │ └── index.js
│ │ └── package.json
│ ├── package.json
│ ├── primitive-handler.mjs
│ ├── prop-export.cjs
│ ├── referenced-exports.cjs
│ ├── require.mjs
│ ├── sdk-handler.mjs
│ ├── sdk-runtime-init.mjs
│ ├── test1245/
│ │ ├── index.js
│ │ ├── main/
│ │ │ └── foo.js
│ │ └── package.json
│ ├── test903/
│ │ ├── bar.mjs
│ │ └── foo.mjs
│ ├── test_modules/
│ │ ├── test-aws-lambda-powertools-jmespath.js
│ │ ├── test-debug.js
│ │ ├── test-elem-hono.js
│ │ ├── test-lodash.merge.js
│ │ ├── test-react-dom.js
│ │ └── test-uuid.js
│ ├── throw.js
│ ├── throwing-handler.mjs
│ ├── throwing-init-handler.mjs
│ └── tla-webcall-handler.mjs
├── index.mjs
├── lambda-server.js
├── libs/
│ ├── llrt_build/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ └── lib.rs
│ ├── llrt_compression/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ └── lib.rs
│ ├── llrt_context/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ └── lib.rs
│ ├── llrt_dns_cache/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ └── lib.rs
│ ├── llrt_encoding/
│ │ ├── Cargo.toml
│ │ ├── build.rs
│ │ └── src/
│ │ └── lib.rs
│ ├── llrt_hooking/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ └── lib.rs
│ ├── llrt_json/
│ │ ├── Cargo.toml
│ │ ├── benches/
│ │ │ └── json.rs
│ │ ├── build.rs
│ │ └── src/
│ │ ├── escape.rs
│ │ ├── lib.rs
│ │ ├── parse.rs
│ │ └── stringify.rs
│ ├── llrt_logging/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ └── lib.rs
│ ├── llrt_numbers/
│ │ ├── Cargo.toml
│ │ ├── benches/
│ │ │ └── numbers.rs
│ │ └── src/
│ │ └── lib.rs
│ ├── llrt_test/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ └── lib.rs
│ ├── llrt_test_tls/
│ │ ├── Cargo.toml
│ │ ├── data/
│ │ │ ├── generate.sh
│ │ │ ├── root.pem
│ │ │ ├── server.key
│ │ │ └── server.pem
│ │ └── src/
│ │ ├── api.rs
│ │ ├── config.rs
│ │ ├── lib.rs
│ │ └── server.rs
│ └── llrt_utils/
│ ├── Cargo.toml
│ └── src/
│ ├── any_of.rs
│ ├── bytearray_buffer.rs
│ ├── bytes.rs
│ ├── class.rs
│ ├── clone.rs
│ ├── ctx.rs
│ ├── error.rs
│ ├── error_messages.rs
│ ├── fs.rs
│ ├── hash.rs
│ ├── io.rs
│ ├── latch.rs
│ ├── lib.rs
│ ├── macros.rs
│ ├── mc_oneshot.rs
│ ├── module.rs
│ ├── object.rs
│ ├── option.rs
│ ├── primordials.rs
│ ├── provider.rs
│ ├── result.rs
│ ├── reuse_list.rs
│ ├── signals.rs
│ ├── string.rs
│ ├── sysinfo.rs
│ └── time.rs
├── linker/
│ ├── ar
│ ├── cc
│ ├── cc-aarch64-linux-gnu
│ ├── cc-aarch64-linux-musl
│ ├── cc-x86_64-linux-gnu
│ ├── cc-x86_64-linux-musl
│ ├── cxx
│ ├── cxx-aarch64-linux-gnu
│ ├── cxx-aarch64-linux-musl
│ ├── cxx-x86_64-linux-gnu
│ ├── cxx-x86_64-linux-musl
│ └── ranlib
├── llrt/
│ ├── Cargo.toml
│ └── src/
│ ├── base.rs
│ ├── main.c
│ ├── main.rs
│ ├── minimal_tracer.rs
│ └── repl.rs
├── llrt_core/
│ ├── Cargo.toml
│ ├── build.rs
│ └── src/
│ ├── builtins_inspect.rs
│ ├── bytecode.rs
│ ├── compiler.rs
│ ├── compiler_common.rs
│ ├── environment.rs
│ ├── http.rs
│ ├── lib.rs
│ ├── libs.rs
│ ├── modules/
│ │ ├── console.rs
│ │ ├── embedded/
│ │ │ ├── loader.rs
│ │ │ ├── mod.rs
│ │ │ └── resolver.rs
│ │ ├── js/
│ │ │ ├── @llrt/
│ │ │ │ ├── expect/
│ │ │ │ │ ├── jest-asymmetric-matchers.ts
│ │ │ │ │ ├── jest-expect.ts
│ │ │ │ │ ├── jest-utils.ts
│ │ │ │ │ └── stringify.ts
│ │ │ │ └── test/
│ │ │ │ ├── CircularBuffer.ts
│ │ │ │ ├── Color.ts
│ │ │ │ ├── SocketClient.ts
│ │ │ │ ├── index.ts
│ │ │ │ ├── shared.ts
│ │ │ │ └── worker.ts
│ │ │ ├── llrt.d.ts
│ │ │ ├── stream/
│ │ │ │ └── promises.ts
│ │ │ └── stream.ts
│ │ ├── llrt/
│ │ │ ├── hex.rs
│ │ │ ├── mod.rs
│ │ │ ├── qjs.rs
│ │ │ ├── util.rs
│ │ │ └── xml.rs
│ │ └── mod.rs
│ ├── runtime_client.rs
│ ├── security.rs
│ └── vm.rs
├── llrt_modules/
│ ├── Cargo.toml
│ ├── README.md
│ └── src/
│ ├── lib.rs
│ ├── module/
│ │ ├── loader.rs
│ │ ├── mod.rs
│ │ ├── require.rs
│ │ └── resolver.rs
│ ├── module_builder.rs
│ └── package/
│ ├── loader.rs
│ ├── mod.rs
│ └── resolver.rs
├── modules/
│ ├── llrt_abort/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ ├── abort_controller.rs
│ │ ├── abort_signal.rs
│ │ └── lib.rs
│ ├── llrt_assert/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ └── lib.rs
│ ├── llrt_async_hooks/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ ├── finalization_registry.rs
│ │ └── lib.rs
│ ├── llrt_buffer/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ ├── array_buffer_view.rs
│ │ ├── blob.rs
│ │ ├── buffer.rs
│ │ ├── file.rs
│ │ └── lib.rs
│ ├── llrt_child_process/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ └── lib.rs
│ ├── llrt_console/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ └── lib.rs
│ ├── llrt_crypto/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ ├── crc32.rs
│ │ ├── hash.rs
│ │ ├── lib.rs
│ │ ├── provider/
│ │ │ ├── graviola.rs
│ │ │ ├── mod.rs
│ │ │ ├── openssl.rs
│ │ │ ├── ring.rs
│ │ │ └── rust/
│ │ │ ├── aes_variants.rs
│ │ │ └── mod.rs
│ │ └── subtle/
│ │ ├── crypto_key.rs
│ │ ├── derive.rs
│ │ ├── derive_algorithm.rs
│ │ ├── digest.rs
│ │ ├── encryption.rs
│ │ ├── encryption_algorithm.rs
│ │ ├── export_key.rs
│ │ ├── generate_key.rs
│ │ ├── import_key.rs
│ │ ├── key_algorithm.rs
│ │ ├── mod.rs
│ │ ├── sign.rs
│ │ ├── sign_algorithm.rs
│ │ ├── stubs.rs
│ │ ├── verify.rs
│ │ └── wrapping.rs
│ ├── llrt_dgram/
│ │ ├── Cargo.toml
│ │ ├── README.md
│ │ └── src/
│ │ ├── lib.rs
│ │ └── socket.rs
│ ├── llrt_dns/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ ├── lib.rs
│ │ └── lookup.rs
│ ├── llrt_events/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ ├── custom_event.rs
│ │ ├── event.rs
│ │ ├── event_target.rs
│ │ └── lib.rs
│ ├── llrt_exceptions/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ └── lib.rs
│ ├── llrt_fetch/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ ├── body.rs
│ │ ├── fetch.rs
│ │ ├── form_data.rs
│ │ ├── headers.rs
│ │ ├── incoming.rs
│ │ ├── lib.rs
│ │ ├── request.rs
│ │ ├── response.rs
│ │ └── security.rs
│ ├── llrt_fs/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ ├── access.rs
│ │ ├── chmod.rs
│ │ ├── file_handle.rs
│ │ ├── lib.rs
│ │ ├── mkdir.rs
│ │ ├── open.rs
│ │ ├── read_dir.rs
│ │ ├── read_file.rs
│ │ ├── rename.rs
│ │ ├── rm.rs
│ │ ├── stats.rs
│ │ ├── symlink.rs
│ │ └── write_file.rs
│ ├── llrt_http/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ ├── agent.rs
│ │ ├── client.rs
│ │ ├── config.rs
│ │ └── lib.rs
│ ├── llrt_intl/
│ │ ├── Cargo.toml
│ │ ├── README.md
│ │ └── src/
│ │ ├── cldr_data.rs
│ │ ├── date_time_format.rs
│ │ ├── lib.rs
│ │ └── pattern_formatter.rs
│ ├── llrt_navigator/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ └── lib.rs
│ ├── llrt_net/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ ├── lib.rs
│ │ ├── security.rs
│ │ ├── server.rs
│ │ └── socket.rs
│ ├── llrt_os/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ ├── lib.rs
│ │ ├── network.rs
│ │ ├── statistics.rs
│ │ ├── unix.rs
│ │ └── windows.rs
│ ├── llrt_path/
│ │ ├── Cargo.toml
│ │ ├── benches/
│ │ │ └── slash_replacement.rs
│ │ └── src/
│ │ └── lib.rs
│ ├── llrt_perf_hooks/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ ├── lib.rs
│ │ └── performance.rs
│ ├── llrt_process/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ └── lib.rs
│ ├── llrt_stream/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ ├── lib.rs
│ │ ├── readable.rs
│ │ └── writable.rs
│ ├── llrt_stream_web/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ ├── lib.rs
│ │ ├── queuing_strategy/
│ │ │ ├── byte_length.rs
│ │ │ ├── count.rs
│ │ │ └── mod.rs
│ │ ├── readable/
│ │ │ ├── byob_reader.rs
│ │ │ ├── byte_controller.rs
│ │ │ ├── controller.rs
│ │ │ ├── default_controller.rs
│ │ │ ├── default_reader.rs
│ │ │ ├── iterator.rs
│ │ │ ├── mod.rs
│ │ │ ├── objects.rs
│ │ │ ├── reader.rs
│ │ │ └── stream/
│ │ │ ├── algorithms.rs
│ │ │ ├── mod.rs
│ │ │ ├── pipe.rs
│ │ │ ├── source.rs
│ │ │ └── tee.rs
│ │ ├── readable_writable_pair.rs
│ │ ├── utils/
│ │ │ ├── mod.rs
│ │ │ ├── promise.rs
│ │ │ └── queue.rs
│ │ └── writable/
│ │ ├── default_controller.rs
│ │ ├── default_writer.rs
│ │ ├── mod.rs
│ │ ├── objects.rs
│ │ ├── stream/
│ │ │ ├── mod.rs
│ │ │ └── sink.rs
│ │ └── writer.rs
│ ├── llrt_string_decoder/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ ├── lib.rs
│ │ └── string_decoder.rs
│ ├── llrt_temporal/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ ├── duration.rs
│ │ ├── instant.rs
│ │ ├── lib.rs
│ │ ├── now.rs
│ │ ├── plain_date.rs
│ │ ├── plain_date_time.rs
│ │ ├── plain_time.rs
│ │ ├── utils/
│ │ │ ├── date.rs
│ │ │ ├── date_time.rs
│ │ │ ├── mod.rs
│ │ │ ├── round/
│ │ │ │ ├── date_time.rs
│ │ │ │ ├── mod.rs
│ │ │ │ ├── span.rs
│ │ │ │ ├── time.rs
│ │ │ │ ├── timestamp.rs
│ │ │ │ └── zoned.rs
│ │ │ ├── span.rs
│ │ │ ├── time.rs
│ │ │ ├── total/
│ │ │ │ ├── mod.rs
│ │ │ │ └── span.rs
│ │ │ └── zoned.rs
│ │ └── zoned_date_time.rs
│ ├── llrt_timers/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ └── lib.rs
│ ├── llrt_tls/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ ├── lib.rs
│ │ ├── no_verification.rs
│ │ ├── openssl_config.rs
│ │ └── rustls_config.rs
│ ├── llrt_tty/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ └── lib.rs
│ ├── llrt_url/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ ├── lib.rs
│ │ ├── url_class.rs
│ │ └── url_search_params.rs
│ ├── llrt_util/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ ├── lib.rs
│ │ ├── text_decoder.rs
│ │ └── text_encoder.rs
│ └── llrt_zlib/
│ ├── Cargo.toml
│ └── src/
│ ├── brotli.rs
│ ├── lib.rs
│ ├── zlib.rs
│ └── zstd.rs
├── pack
├── package.json
├── rustfmt.toml
├── sdk.cfg
├── shims/
│ ├── @aws-crypto/
│ │ ├── crc32.js
│ │ ├── crc32c.js
│ │ ├── index.js
│ │ ├── sha1-browser.js
│ │ └── sha256-browser.js
│ ├── @smithy/
│ │ ├── abort-controller.js
│ │ ├── split-stream.js
│ │ ├── util-base64.js
│ │ ├── util-hex-encoding.js
│ │ └── util-utf8.js
│ ├── collect-stream-body.js
│ ├── create-read-stream.js
│ ├── is-streaming.js
│ ├── mnemonist/
│ │ └── lru-cache.js
│ ├── sdk-stream-mixin.js
│ ├── stream-collector.js
│ └── string-hasher.js
├── tests/
│ ├── e2e/
│ │ ├── IntegTestResourcesStack.template.yml
│ │ ├── README.md
│ │ ├── cognito_identity.e2e.test.ts
│ │ ├── dynamodb.e2e.test.ts
│ │ └── s3.e2e.test.ts
│ ├── unit/
│ │ ├── assert.test.ts
│ │ ├── async_hooks.test.ts
│ │ ├── asynchronous-processing-discipline.test.ts
│ │ ├── buffer.test.ts
│ │ ├── child_process.test.ts
│ │ ├── clone.test.ts
│ │ ├── compile.test.ts
│ │ ├── console.test.ts
│ │ ├── crypto.subtle.test.ts
│ │ ├── crypto.test.ts
│ │ ├── date.test.ts
│ │ ├── dgram.test.ts
│ │ ├── dns.test.ts
│ │ ├── encoding.test.ts
│ │ ├── events.test.ts
│ │ ├── exceptions.test.ts
│ │ ├── executable.test.ts
│ │ ├── fetch.formdata.test.ts
│ │ ├── fetch.headers.test.ts
│ │ ├── fetch.request.test.ts
│ │ ├── fetch.response.test.ts
│ │ ├── fetch.test.ts
│ │ ├── fs.test.ts
│ │ ├── import.test.ts
│ │ ├── intl.test.ts
│ │ ├── jest-expect.test.ts
│ │ ├── json.test.ts
│ │ ├── llrt.qjs.test.ts
│ │ ├── llrt.xml.test.ts
│ │ ├── module.test.ts
│ │ ├── navigator.test.ts
│ │ ├── net.test.ts
│ │ ├── numbers.test.ts
│ │ ├── os.test.ts
│ │ ├── path.test.ts
│ │ ├── perf_hooks.test.ts
│ │ ├── performance.test.ts
│ │ ├── process.test.ts
│ │ ├── require.test.ts
│ │ ├── socket.test.ts
│ │ ├── stream.test.ts
│ │ ├── string_decoder.test.ts
│ │ ├── symbol-to-string-tag.test.ts
│ │ ├── temporal.duration.test.ts
│ │ ├── temporal.instant.test.ts
│ │ ├── temporal.now.test.ts
│ │ ├── temporal.plaindate.test.ts
│ │ ├── temporal.plaindatetime.test.ts
│ │ ├── temporal.plaintime.test.ts
│ │ ├── temporal.zoneddatetime.test.ts
│ │ ├── test-utils.ts
│ │ ├── timers.test.ts
│ │ ├── tty.test.ts
│ │ ├── url.test.ts
│ │ ├── util.test.ts
│ │ └── zlib.test.ts
│ └── wpt/
│ ├── FileAPI/
│ │ └── support/
│ │ ├── Blob.js
│ │ └── send-file-formdata-helper.js
│ ├── FileAPI.blob.test.ts
│ ├── FileAPI.file.test.ts
│ ├── FileAPI.harness.js
│ ├── README.md
│ ├── WebCryptoAPI.derive_bits_keys.test.ts
│ ├── WebCryptoAPI.digest.test.ts
│ ├── WebCryptoAPI.harness.js
│ ├── WebCryptoAPI.test.ts
│ ├── common/
│ │ ├── gc.js
│ │ ├── get-host-info.sub.js
│ │ └── subset-tests.js
│ ├── console.harness.js
│ ├── console.test.ts
│ ├── encoding/
│ │ └── resources/
│ │ ├── decoding-helpers.js
│ │ └── encodings.js
│ ├── encoding.harness.js
│ ├── encoding.test.ts
│ ├── fetch/
│ │ └── api/
│ │ ├── cors/
│ │ │ └── resources/
│ │ │ └── not-cors-safelisted.json
│ │ ├── request/
│ │ │ ├── request-cache.js
│ │ │ └── request-error.js
│ │ └── resources/
│ │ ├── data.json
│ │ ├── keepalive-helper.js
│ │ ├── keepalive-worker.js
│ │ ├── sw-intercept-abort.js
│ │ ├── sw-intercept.js
│ │ └── utils.js
│ ├── fetch.api.abort.test.ts
│ ├── fetch.api.basic.test.ts
│ ├── fetch.api.body.test.ts
│ ├── fetch.api.headers.test.ts
│ ├── fetch.api.request.test.ts
│ ├── fetch.api.response.test.ts
│ ├── fetch.harness.js
│ ├── hr-time.harness.js
│ ├── hr-time.test.ts
│ ├── resources/
│ │ ├── idlharness.js
│ │ └── testharness.js
│ ├── streams/
│ │ └── resources/
│ │ ├── recording-streams.js
│ │ ├── rs-test-templates.js
│ │ ├── rs-utils.js
│ │ └── test-utils.js
│ ├── streams.harness.js
│ ├── streams.piping.test.ts
│ ├── streams.readable-byte-streams.test.ts
│ ├── streams.readable-streams.test.ts
│ ├── streams.writable-streams.test.ts
│ ├── url/
│ │ └── resources/
│ │ ├── IdnaTestV2-removed.json
│ │ ├── IdnaTestV2.json
│ │ ├── percent-encoding.json
│ │ ├── setters_tests.json
│ │ ├── toascii.json
│ │ ├── urltestdata-javascript-only.json
│ │ └── urltestdata.json
│ ├── url.harness.js
│ ├── url.test.ts
│ ├── webidl-harness.js
│ └── webidl.ecmascript-binding.es-exceptions.test.ts
├── tsconfig.json
├── types/
│ ├── .eslintrc.cjs
│ ├── abort.d.ts
│ ├── assert.d.ts
│ ├── async_hooks.d.ts
│ ├── buffer.d.ts
│ ├── child_process.d.ts
│ ├── console.d.ts
│ ├── crypto.d.ts
│ ├── dgram.d.ts
│ ├── dns.d.ts
│ ├── dom-events.d.ts
│ ├── events.d.ts
│ ├── exceptions.d.ts
│ ├── fetch.d.ts
│ ├── fs/
│ │ └── promises.d.ts
│ ├── fs.d.ts
│ ├── globals.d.ts
│ ├── https.d.ts
│ ├── index.d.ts
│ ├── module.d.ts
│ ├── navigator.d.ts
│ ├── net.d.ts
│ ├── os.d.ts
│ ├── package.json
│ ├── path.d.ts
│ ├── perf_hooks.d.ts
│ ├── process.d.ts
│ ├── stream/
│ │ └── web.d.ts
│ ├── stream.d.ts
│ ├── string_decoder.d.ts
│ ├── timers.d.ts
│ ├── timezone.d.ts
│ ├── tsconfig.json
│ ├── tty.d.ts
│ ├── url.d.ts
│ ├── util.d.ts
│ └── zlib.d.ts
├── vitest.config.mjs
└── wpt_errors.txt
================================================
FILE CONTENTS
================================================
================================================
FILE: .cargo/config.toml
================================================
[target.aarch64-unknown-linux-musl]
rustflags = [
"-Ctarget-feature=+lse,+crt-static",
"-Ctarget-cpu=neoverse-n1",
"-Zunstable-options",
"-Cpanic=immediate-abort",
"-Zpanic_abort_tests",
"-Zthreads=8",
]
linker = "./linker/cc-aarch64-linux-musl"
ar = "./linker/ar"
[target.x86_64-unknown-linux-musl]
rustflags = [
"-Ctarget-feature=+crt-static",
"-Ctarget-cpu=haswell",
"-Zunstable-options",
"-Cpanic=immediate-abort",
"-Zpanic_abort_tests",
"-Zthreads=8",
]
linker = "./linker/cc-x86_64-linux-musl"
ar = "./linker/ar"
[env]
CC_aarch64_apple_darwin = "/usr/bin/clang"
CC_x86_64_apple_darwin = "/usr/bin/clang"
CXX_aarch64_apple_darwin = "/usr/bin/clang"
CXX_x86_64_apple_darwin = "/usr/bin/clang"
[unstable]
build-std = ["core", "compiler_builtins", "alloc", "std", "panic_abort"]
================================================
FILE: .fleet/settings.json
================================================
{
"backend.maxHeapSizeMb": 2048
}
================================================
FILE: .github/dependabot.yml
================================================
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: weekly
# Maintain dependencies for JS
- package-ecosystem: "npm"
directory: "/" # Location of package manifests
schedule:
interval: monthly
groups:
"@types":
patterns:
- "@types*"
update-types:
- "minor"
- "patch"
"@aws-sdk":
patterns:
- "@aws-sdk*"
update-types:
- "minor"
- "patch"
aws-cdk:
patterns:
- "aws-cdk"
- "aws-cdk-lib"
update-types:
- "minor"
- "patch"
# Maintain dependencies for Rust
- package-ecosystem: cargo
directory: "/"
schedule:
interval: daily
groups:
rustcrypto:
patterns:
- "aes*"
- "cbc"
- "const-oid"
- "ctr"
- "der"
- "ecdsa"
- "elliptic-curve"
- "md-5"
- "hmac"
- "p256"
- "p384"
- "p521"
- "pkcs8"
- "rsa"
- "spki"
- "x25519-dalek"
================================================
FILE: .github/pull_request_template.md
================================================
### Issue # (if available)
<!-- **Please post the link to the resolved issue** -->
### Description of changes
<!-- **Please explain what your changes does** -->
### Checklist
- [ ] Created unit tests in `tests/unit` and/or in Rust for my feature if needed
- [ ] Ran `make fix` to format JS and apply Clippy auto fixes
- [ ] Made sure my code didn't add any additional warnings: `make check`
- [ ] Added relevant type info in `types/` directory
- [ ] Updated documentation if needed ([API.md](API.md)/[README.md](README.md)/Other)
_By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._
================================================
FILE: .github/workflows/build-modules.yml
================================================
name: Setup, Build & Test modules
on:
workflow_call:
inputs:
os:
required: true
type: string
platform:
required: true
type: string
arch:
required: true
type: string
toolchain:
required: true
type: string
crypto:
required: false
type: string
default: "ring"
permissions:
contents: read
jobs:
build:
name: ${{ inputs.arch }}-${{ inputs.platform }}-${{ inputs.crypto }}
runs-on: ${{ inputs.os }}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ inputs.toolchain }}
- name: Install Windows OpenSSL
if: inputs.platform == 'windows' && inputs.crypto == 'openssl'
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
path-type: inherit
install: >-
mingw-w64-x86_64-gcc
mingw-w64-x86_64-openssl
mingw-w64-x86_64-pkgconf
- name: Set OpenSSL env for Windows
if: inputs.platform == 'windows' && inputs.crypto == 'openssl'
shell: bash
run: |
echo "OPENSSL_DIR=D:/a/_temp/msys64/mingw64" >> $GITHUB_ENV
echo "OPENSSL_LIB_DIR=D:/a/_temp/msys64/mingw64/lib" >> $GITHUB_ENV
echo "OPENSSL_INCLUDE_DIR=D:/a/_temp/msys64/mingw64/include" >> $GITHUB_ENV
- name: Map crypto feature to TLS and crypto features
id: features
shell: bash
run: |
case "${{ inputs.crypto }}" in
graviola)
echo "tls_feature=tls-graviola" >> $GITHUB_OUTPUT
echo "crypto_feature=crypto-graviola" >> $GITHUB_OUTPUT
;;
ring)
echo "tls_feature=tls-ring" >> $GITHUB_OUTPUT
echo "crypto_feature=crypto-ring" >> $GITHUB_OUTPUT
;;
openssl)
echo "tls_feature=tls-openssl" >> $GITHUB_OUTPUT
echo "crypto_feature=crypto-openssl" >> $GITHUB_OUTPUT
if [ "${{ inputs.platform }}" != "windows" ]; then
echo "extra_features=,openssl-vendored" >> $GITHUB_OUTPUT
fi
;;
aws-lc)
echo "tls_feature=tls-aws-lc" >> $GITHUB_OUTPUT
echo "crypto_feature=crypto-ring" >> $GITHUB_OUTPUT
;;
*)
echo "Unknown crypto feature: ${{ inputs.crypto }}"
exit 1
;;
esac
- name: Run build crates
shell: bash
env:
RUSTFLAGS: ""
TLS_FEATURE: ${{ steps.features.outputs.tls_feature }}
CRYPTO_FEATURE: ${{ steps.features.outputs.crypto_feature }}
run: |
crates=$(cargo metadata --no-deps --format-version 1 --quiet | jq -r '.packages[] | select(.manifest_path | contains("modules/")) | .name')
for crate in $crates; do
echo "Compiling crate: $crate"
if [ "$crate" = "llrt_fetch" ]; then
cargo build -p "$crate" --no-default-features --features "http1,http2,webpki-roots,compression-rust,$TLS_FEATURE"
elif [ "$crate" = "llrt_http" ]; then
cargo build -p "$crate" --no-default-features --features "http1,http2,webpki-roots,$TLS_FEATURE"
elif [ "$crate" = "llrt_crypto" ]; then
cargo build -p "$crate" --no-default-features --features "$CRYPTO_FEATURE"
else
cargo build -p "$crate"
fi
done
- name: Run build all
shell: bash
env:
TLS_FEATURE: ${{ steps.features.outputs.tls_feature }}
CRYPTO_FEATURE: ${{ steps.features.outputs.crypto_feature }}
EXTRA_FEATURES: ${{ steps.features.outputs.extra_features }}
run: |
cargo build -p llrt_modules --no-default-features --features "base,$TLS_FEATURE,$CRYPTO_FEATURE$EXTRA_FEATURES"
- name: Run tests all
shell: bash
env:
TLS_FEATURE: ${{ steps.features.outputs.tls_feature }}
CRYPTO_FEATURE: ${{ steps.features.outputs.crypto_feature }}
EXTRA_FEATURES: ${{ steps.features.outputs.extra_features }}
run: |
cargo test -p llrt_modules --no-default-features --features "base,$TLS_FEATURE,$CRYPTO_FEATURE$EXTRA_FEATURES"
================================================
FILE: .github/workflows/build.yml
================================================
name: Setup, Build & Test
on:
workflow_call:
inputs:
os:
required: true
type: string
platform:
required: true
type: string
arch:
required: true
type: string
release:
required: false
type: string
toolchain:
required: false
type: string
default: "nightly"
crypto:
required: false
type: string
default: ""
jobs:
build:
runs-on: ${{ inputs.os }}
name: build ${{ inputs.arch }}-${{ inputs.platform }}${{ inputs.crypto && format('-{0}', inputs.crypto) || '' }}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Checkout submodules
run: git submodule update --init --checkout
- name: Setup Node.js
uses: actions/setup-node@v6
with:
cache: yarn
node-version: lts/*
- name: Install Linux dependencies
if: inputs.platform == 'linux'
run: |
sudo apt-get -y update
sudo apt-get -y install make nodejs
sudo snap install zig --classic --beta
- name: Install MacOS dependencies
if: inputs.platform == 'darwin'
env:
HOMEBREW_NO_AUTO_UPDATE: 1
run: |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install zig make
- name: Install zig on windows
if: inputs.platform == 'windows'
shell: pwsh
run: |
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
iex "& {$(irm get.scoop.sh)} -RunAsAdmin"
scoop install zig
- name: Install Windows dependencies
if: inputs.platform == 'windows'
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
path-type: inherit
install: >-
mingw-w64-x86_64-make
mingw-w64-x86_64-cmake
mingw-w64-x86_64-gcc
mingw-w64-x86_64-clang
mingw-w64-x86_64-perl
zip
zstd
patch
unzip
- name: Install JavaScript dependencies
run: |
corepack enable
yarn
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ inputs.toolchain }}
- name: Map crypto to features
id: features
if: inputs.crypto != ''
shell: bash
run: |
case "${{ inputs.crypto }}" in
graviola)
echo "cargo_features=--no-default-features --features macro,crypto-graviola-rust,tls-graviola" >> $GITHUB_OUTPUT
;;
ring)
echo "cargo_features=--no-default-features --features macro,crypto-ring-rust,tls-ring" >> $GITHUB_OUTPUT
;;
openssl)
if [ "${{ inputs.platform }}" = "windows" ]; then
echo "cargo_features=--no-default-features --features macro,crypto-openssl,tls-openssl" >> $GITHUB_OUTPUT
else
echo "cargo_features=--no-default-features --features macro,crypto-openssl,tls-openssl,openssl-vendored" >> $GITHUB_OUTPUT
fi
;;
aws-lc)
echo "cargo_features=--no-default-features --features macro,crypto-rust,tls-aws-lc" >> $GITHUB_OUTPUT
;;
*)
echo "Unknown crypto: ${{ inputs.crypto }}"
exit 1
;;
esac
- name: Run tests
if: inputs.platform != 'windows'
env:
CARGO_FEATURES: ${{ steps.features.outputs.cargo_features }}
run: |
make test-ci 2>&1
- name: Run tests on windows
if: inputs.platform == 'windows'
shell: msys2 {0}
env:
CARGO_FEATURES: ${{ steps.features.outputs.cargo_features }}
run: |
set -e
make test-ci 2>&1
- name: Build Linux binaries
if: inputs.release && inputs.platform == 'linux'
run: |
make libs-${{ inputs.release }}
make release-aws-${{ inputs.release }}
make release-aws-${{ inputs.release }}-no-sdk
make release-aws-${{ inputs.release }}-full-sdk
- name: Build Darwin binaries
if: inputs.release && inputs.platform == 'darwin'
run: |
make llrt-darwin-${{ inputs.release }}.zip
make llrt-darwin-${{ inputs.release }}-no-sdk.zip
make llrt-darwin-${{ inputs.release }}-full-sdk.zip
- name: Build Windows binaries
if: inputs.release && inputs.platform == 'windows'
shell: msys2 {0}
run: |
# HACK: Add scoop/shims to PATH
export PATH="$PATH:/c/Users/$USER/scoop/shims"
make stdlib
rm -rf target/ || true
make llrt-windows-${{ inputs.release }}.zip
make llrt-windows-${{ inputs.release }}-no-sdk.zip
make llrt-windows-${{ inputs.release }}-full-sdk.zip
- name: Upload artifacts
if: inputs.release
uses: actions/upload-artifact@v7
with:
name: artifacts-${{ inputs.platform }}-${{ inputs.arch }}
path: |
*.zip
llrt-container-arm64*
llrt-container-x64*
- name: Upload changelog
if: inputs.release && inputs.platform == 'linux' && inputs.arch == 'x86_64'
uses: actions/upload-artifact@v7
with:
name: changelog
path: CHANGELOG.md
================================================
FILE: .github/workflows/ci.yml
================================================
name: LLRT CI
on:
push:
branches:
- "main"
pull_request:
# Only run on the latest ref
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
components: clippy, rustfmt
- name: Format
run: cargo fmt --all -- --check
- name: Clippy
run: | #create mock js files
mkdir -p bundle/js
for i in {1..5}; do
echo "console.log(123);" > "bundle/js/test$i.js"
done
cargo clippy --all-targets -- -D warnings
build:
needs:
- check
strategy:
fail-fast: ${{ startsWith(github.ref, 'refs/tags/') }}
matrix:
include:
# Ubuntu x64
- os: ubuntu-latest
platform: linux
arch: x86_64
toolchain: nightly
crypto: ring
- os: ubuntu-latest
platform: linux
arch: x86_64
toolchain: nightly
crypto: aws-lc
- os: ubuntu-latest
platform: linux
arch: x86_64
toolchain: nightly
crypto: graviola
- os: ubuntu-latest
platform: linux
arch: x86_64
toolchain: nightly
crypto: openssl
# Ubuntu arm64
- os: ubuntu-24.04-arm
platform: linux
arch: aarch64
toolchain: nightly
crypto: ring
- os: ubuntu-24.04-arm
platform: linux
arch: aarch64
toolchain: nightly
crypto: aws-lc
- os: ubuntu-24.04-arm
platform: linux
arch: aarch64
toolchain: nightly
crypto: graviola
- os: ubuntu-24.04-arm
platform: linux
arch: aarch64
toolchain: nightly
crypto: openssl
# macOS arm64
- os: macos-latest
platform: darwin
arch: aarch64
toolchain: nightly
crypto: ring
- os: macos-latest
platform: darwin
arch: aarch64
toolchain: nightly
crypto: aws-lc
- os: macos-latest
platform: darwin
arch: aarch64
toolchain: nightly
crypto: graviola
- os: macos-latest
platform: darwin
arch: aarch64
toolchain: nightly
crypto: openssl
# Windows x64 (ring, openssl, graviola - no aws-lc)
- os: windows-latest
platform: windows
arch: x86_64
toolchain: nightly-x86_64-pc-windows-gnu
crypto: ring
- os: windows-latest
platform: windows
arch: x86_64
toolchain: nightly-x86_64-pc-windows-gnu
crypto: openssl
- os: windows-latest
platform: windows
arch: x86_64
toolchain: nightly-x86_64-pc-windows-gnu
crypto: graviola
uses: ./.github/workflows/build.yml
with:
os: ${{ matrix.os }}
platform: ${{ matrix.platform }}
arch: ${{ matrix.arch }}
toolchain: ${{ matrix.toolchain }}
crypto: ${{ matrix.crypto }}
modules:
needs:
- check
strategy:
fail-fast: false
matrix:
include:
# Ubuntu x64
- os: ubuntu-latest
platform: linux
arch: x86_64
toolchain: stable
crypto: ring
- os: ubuntu-latest
platform: linux
arch: x86_64
toolchain: stable
crypto: aws-lc
- os: ubuntu-latest
platform: linux
arch: x86_64
toolchain: stable
crypto: graviola
- os: ubuntu-latest
platform: linux
arch: x86_64
toolchain: stable
crypto: openssl
# Ubuntu arm64
- os: ubuntu-24.04-arm
platform: linux
arch: aarch64
toolchain: stable
crypto: ring
- os: ubuntu-24.04-arm
platform: linux
arch: aarch64
toolchain: stable
crypto: aws-lc
- os: ubuntu-24.04-arm
platform: linux
arch: aarch64
toolchain: stable
crypto: graviola
- os: ubuntu-24.04-arm
platform: linux
arch: aarch64
toolchain: stable
crypto: openssl
# macOS arm64
- os: macos-latest
platform: darwin
arch: aarch64
toolchain: stable
crypto: ring
- os: macos-latest
platform: darwin
arch: aarch64
toolchain: stable
crypto: aws-lc
- os: macos-latest
platform: darwin
arch: aarch64
toolchain: stable
crypto: graviola
- os: macos-latest
platform: darwin
arch: aarch64
toolchain: stable
crypto: openssl
# Windows x64 (ring, openssl, graviola - no aws-lc)
- os: windows-latest
platform: windows
arch: x86_64
toolchain: stable-x86_64-pc-windows-gnu
crypto: ring
- os: windows-latest
platform: windows
arch: x86_64
toolchain: stable-x86_64-pc-windows-gnu
crypto: openssl
- os: windows-latest
platform: windows
arch: x86_64
toolchain: stable-x86_64-pc-windows-gnu
crypto: graviola
uses: ./.github/workflows/build-modules.yml
with:
os: ${{ matrix.os }}
platform: ${{ matrix.platform }}
arch: ${{ matrix.arch }}
toolchain: ${{ matrix.toolchain }}
crypto: ${{ matrix.crypto }}
================================================
FILE: .github/workflows/publish.yml
================================================
name: Publish crates
on:
workflow_call:
inputs:
ref:
required: true
type: string
secrets:
CRATES_IO_TOKEN:
required: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
ref: ${{ inputs.ref }}
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
- name: Publish utils
working-directory: ./llrt_utils
run: |
cargo publish
sleep 10
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
- name: Publish modules
working-directory: ./llrt_modules
run: |
cargo publish
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
================================================
FILE: .github/workflows/release.yml
================================================
name: LLRT Release
on:
push:
tags:
- "v*.*.*"
jobs:
build:
strategy:
fail-fast: ${{ startsWith(github.ref, 'refs/tags/') }}
matrix:
include:
- os: windows-latest
platform: windows
arch: x86_64
release: x64
toolchain: nightly-x86_64-pc-windows-gnu
- os: ubuntu-latest
platform: linux
arch: x86_64
release: x64
- os: ubuntu-24.04-arm
platform: linux
arch: aarch64
release: arm64
- os: macos-latest
platform: darwin
arch: x86_64
release: x64
- os: macos-latest
platform: darwin
arch: aarch64
release: arm64
uses: ./.github/workflows/build.yml
with:
os: ${{ matrix.os }}
platform: ${{ matrix.platform }}
arch: ${{ matrix.arch }}
release: ${{ matrix.release }}
toolchain: ${{ matrix.toolchain }}
release:
permissions:
contents: write
discussions: write
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Download artifacts
uses: actions/download-artifact@v8
with:
merge-multiple: true
- name: Fix permissions
run: |
chmod 755 ./llrt-container-x64*
chmod 755 ./llrt-container-arm64*
- name: Release
uses: softprops/action-gh-release@v2
with:
body_path: ./CHANGELOG.md
preserve_order: true
prerelease: contains(github.ref, 'beta') || contains(github.ref, 'alpha') || contains(github.ref, 'rc')
files: |
./llrt-lambda-x64.zip
./llrt-lambda-x64-no-sdk.zip
./llrt-lambda-x64-full-sdk.zip
./llrt-lambda-arm64.zip
./llrt-lambda-arm64-no-sdk.zip
./llrt-lambda-arm64-full-sdk.zip
./llrt-container-x64
./llrt-container-x64-no-sdk
./llrt-container-x64-full-sdk
./llrt-container-arm64
./llrt-container-arm64-no-sdk
./llrt-container-arm64-full-sdk
./llrt-linux-x64.zip
./llrt-linux-x64-no-sdk.zip
./llrt-linux-x64-full-sdk.zip
./llrt-linux-arm64.zip
./llrt-linux-arm64-no-sdk.zip
./llrt-linux-arm64-full-sdk.zip
./llrt-darwin-x64.zip
./llrt-darwin-x64-no-sdk.zip
./llrt-darwin-x64-full-sdk.zip
./llrt-darwin-arm64.zip
./llrt-darwin-arm64-no-sdk.zip
./llrt-darwin-arm64-full-sdk.zip
./llrt-windows-x64.zip
./llrt-windows-x64-no-sdk.zip
./llrt-windows-x64-full-sdk.zip
publish:
needs:
- build
uses: ./.github/workflows/publish.yml
with:
ref: ${{ github.ref }}
secrets:
CRATES_IO_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
================================================
FILE: .gitignore
================================================
.DS_Store
.idea
.yarn
.pnp*
.tmp-llrt-aws-sdk
/lib
/target
/llrt_core/target
/llrt_core/src/bytecode_cache.rs
/example/functions/build
/slask
/VERSION
/bundle
*.zip
cdk.out
flamegraph.svg
out.stacks
yarn-error.log
llrt-container-*
bootstrap
node_modules
!/fixtures/node_modules
tests/wpt/revision
/wpt
wpt_errors.tmp
================================================
FILE: .gitmodules
================================================
[submodule "zstd"]
path = zstd
url = https://github.com/facebook/zstd.git
update = none # Workaround for https://github.com/rust-lang/cargo/issues/4247
[submodule "wpt"]
path = wpt
url = https://github.com/web-platform-tests/wpt
branch = master
update = none # Workaround for https://github.com/rust-lang/cargo/issues/4247
================================================
FILE: .prettierignore
================================================
# Ignore web-platform-tests to avoid collisions!
/wpt
**/node_modules
================================================
FILE: .vscode/launch.json
================================================
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "Debug executable 'llrt'",
"cargo": {
"args": ["build"],
"filter": {
"name": "llrt",
"kind": "bin"
}
},
"env": {
"AWS_LAMBDA_FUNCTION_NAME": "n/a",
"AWS_LAMBDA_FUNCTION_MEMORY_SIZE": "1",
"AWS_LAMBDA_FUNCTION_VERSION": "1",
//"AWS_LAMBDA_RUNTIME_API": "localhost:3000",
"_EXIT_LOOP": "1",
"RUST_LOG": "llrt=trace,hyper::http=trace",
//"_HANDLER": "index.handler",
"ISENGARD_PRODUCTION_ACCOUNT": "false",
"AWS_ACCESS_KEY_ID": "",
"AWS_SECRET_ACCESS_KEY": "",
"AWS_SESSION_TOKEN": ""
},
"args": ["index.mjs"],
"cwd": "${workspaceFolder}"
},
{
"type": "lldb",
"request": "launch",
"name": "Debug tests 'llrt'",
"cargo": {
"args": ["build"],
"filter": {
"name": "llrt",
"kind": "bin"
}
},
"env": {
"AWS_LAMBDA_FUNCTION_NAME": "n/a",
"AWS_LAMBDA_FUNCTION_MEMORY_SIZE": "1",
"AWS_LAMBDA_FUNCTION_VERSION": "1",
"_AWS_LAMBDA_RUNTIME_API": "http://localhost:3000",
"_EXIT_LOOP": "1",
"RUST_LOG": "llrt=trace,hyper::http=trace",
//"_HANDLER": "index.handler",
"ISENGARD_PRODUCTION_ACCOUNT": "false",
"AWS_ACCESS_KEY_ID": "",
"AWS_SECRET_ACCESS_KEY": "",
"AWS_SESSION_TOKEN": ""
},
"args": ["test", "-d", "bundle"],
"cwd": "${workspaceFolder}"
}
]
}
================================================
FILE: .vscode/settings.json
================================================
{
"cSpell.words": ["Abortable", "rquickjs", "LLRT", "llrt"],
"cmake.configureOnOpen": false,
"rust-analyzer.showUnlinkedFileNotification": false,
"editor.formatOnPaste": true,
"editor.formatOnSave": true,
"yaml.format.singleQuote": false
}
================================================
FILE: .yarnrc.yml
================================================
nodeLinker: node-modules
================================================
FILE: API.md
================================================
# API documentation
> [!NOTE]
> The long term goal for LLRT is to become [WinterTC compliant](https://min-common-api.proposal.wintertc.org/). Not every API from Node.js will be supported.
# Node.js API
## assert
[ok](https://nodejs.org/api/assert.html#assertokvalue-message)
## async_hooks
### Static methods
[createHook](https://nodejs.org/api/async_hooks.html#async_hookscreatehookcallbacks)
[currentId](https://nodejs.org/api/async_hooks.html#async_hooksexecutionasyncid)
[executionAsyncId](https://nodejs.org/api/async_hooks.html#async_hooksexecutionasyncid)
[triggerAsyncId](https://nodejs.org/api/async_hooks.html#async_hookstriggerasyncid)
### Class: AsyncHook
[enable](https://nodejs.org/api/async_hooks.html#asynchookenable)
[disable](https://nodejs.org/api/async_hooks.html#asynchookdisable)
#### Hook callbacks
[init](https://nodejs.org/api/async_hooks.html#initasyncid-type-triggerasyncid-resource)
[before](https://nodejs.org/api/async_hooks.html#beforeasyncid)
[after](https://nodejs.org/api/async_hooks.html#afterasyncid)
[destroy](https://nodejs.org/api/async_hooks.html#destroyasyncid)
[promiseResolve](https://nodejs.org/api/async_hooks.html#promiseresolveasyncid)
## buffer
### Static methods
[alloc](https://nodejs.org/api/buffer.html#static-method-bufferallocsize-fill-encoding)
[allocUnsafe](https://nodejs.org/api/buffer.html#static-method-bufferallocunsafesize)
[allocUnsafeSlow](https://nodejs.org/api/buffer.html#static-method-bufferallocunsafeslowsize)
[byteLength](https://nodejs.org/api/buffer.html#static-method-bufferbytelengthstring-encoding)
[concat](https://nodejs.org/api/buffer.html#static-method-bufferconcatlist-totallength)
[from](https://nodejs.org/api/buffer.html#static-method-bufferfromarray)
[isBuffer](https://nodejs.org/api/buffer.html#static-method-bufferisbufferobj)
[isEncoding](https://nodejs.org/api/buffer.html#static-method-bufferisencodingencoding)
### Prototype methods
[copy](https://nodejs.org/api/buffer.html#bufcopytarget-targetstart-sourcestart-sourceend)
[readBigInt64BE](https://nodejs.org/api/buffer.html#bufreadbigint64beoffset)
[readBigInt64LE](https://nodejs.org/api/buffer.html#bufreadbigint64leoffset)
[readDoubleBE](https://nodejs.org/api/buffer.html#bufreaddoublebeoffset)
[readDoubleLE](https://nodejs.org/api/buffer.html#bufreaddoubleleoffset)
[readFloatBE](https://nodejs.org/api/buffer.html#bufreadfloatbeoffset)
[readFloatLE](https://nodejs.org/api/buffer.html#bufreadfloatleoffset)
[readInt8](https://nodejs.org/api/buffer.html#bufreadint8offset)
[readInt16BE](https://nodejs.org/api/buffer.html#bufreadint16beoffset)
[readInt16LE](https://nodejs.org/api/buffer.html#bufreadint16leoffset)
[readInt32BE](https://nodejs.org/api/buffer.html#bufreadint32beoffset)
[readInt32LE](https://nodejs.org/api/buffer.html#bufreadint32leoffset)
[readUInt8](https://nodejs.org/api/buffer.html#bufreaduint8offset)
[readUInt16BE](https://nodejs.org/api/buffer.html#bufreaduint16beoffset)
[readUInt16LE](https://nodejs.org/api/buffer.html#bufreaduint16leoffset)
[readUInt32BE](https://nodejs.org/api/buffer.html#bufreaduint32beoffset)
[readUInt32LE](https://nodejs.org/api/buffer.html#bufreaduint32leoffset)
[subarray](https://nodejs.org/api/buffer.html#bufsubarraystart-end)
[toString](https://nodejs.org/api/buffer.html#buftostringencoding-start-end)
[write](https://nodejs.org/api/buffer.html#bufwritestring-offset-length-encoding)
[writeBigInt64BE](https://nodejs.org/api/buffer.html#bufwritebigint64bevalue-offset)
[writeBigInt64LE](https://nodejs.org/api/buffer.html#bufwritebigint64levalue-offset)
[writeDoubleBE](https://nodejs.org/api/buffer.html#bufwritedoublebevalue-offset)
[writeDoubleLE](https://nodejs.org/api/buffer.html#bufwritedoublelevalue-offset)
[writeFloatBE](https://nodejs.org/api/buffer.html#bufwritefloatbevalue-offset)
[writeFloatLE](https://nodejs.org/api/buffer.html#bufwritefloatlevalue-offset)
[writeInt8](https://nodejs.org/api/buffer.html#bufwriteint8value-offset)
[writeInt16BE](https://nodejs.org/api/buffer.html#bufwriteint16bevalue-offset)
[writeInt16LE](https://nodejs.org/api/buffer.html#bufwriteint16levalue-offset)
[writeInt32BE](https://nodejs.org/api/buffer.html#bufwriteint32bevalue-offset)
[writeInt32LE](https://nodejs.org/api/buffer.html#bufwriteint32levalue-offset)
[writeUInt8](https://nodejs.org/api/buffer.html#bufwriteuint8value-offset)
[writeUInt16BE](https://nodejs.org/api/buffer.html#bufwriteuint16bevalue-offset)
[writeUInt16LE](https://nodejs.org/api/buffer.html#bufwriteuint16levalue-offset)
[writeUInt32BE](https://nodejs.org/api/buffer.html#bufwriteuint32bevalue-offset)
[writeUInt32LE](https://nodejs.org/api/buffer.html#bufwriteuint32levalue-offset)
### Constants
[constants.MAX_LENGTH](https://nodejs.org/api/buffer.html#bufferconstantsmax_length)
[constants.MAX_STRING_LENGTH](https://nodejs.org/api/buffer.html#bufferconstantsmax_string_length)
Everything else inherited from [Uint8Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)
## child_process
> [!WARNING]
> `spawn` uses native streams that is not 100% compatible with the Node.js Streams API.
[spawn](https://nodejs.org/api/child_process.html#child_processspawncommand-args-options)
## console
[Console](https://nodejs.org/api/console.html#class-console)
## crypto
[createHash](https://nodejs.org/api/crypto.html#cryptocreatehashalgorithm-options)
[createHmac](https://nodejs.org/api/crypto.html#cryptocreatehmacalgorithm-key-options)
[getRandomValues](https://nodejs.org/api/crypto.html#cryptogetrandomvaluestypedarray)
[randomBytes](https://nodejs.org/api/crypto.html#cryptorandombytessize-callback)
[randomFill](https://nodejs.org/api/crypto.html#cryptorandomfillbuffer-offset-size-callback)
[randomFillSync](https://nodejs.org/api/crypto.html#cryptorandomfillsyncbuffer-offset-size)
[randomInt](https://nodejs.org/api/crypto.html#cryptorandomintmin-max-callback)
[randomUUID](https://nodejs.org/api/crypto.html#cryptorandomuuidoptions)
[webcrypto](https://nodejs.org/api/crypto.html#cryptowebcrypto)
### LLRT specific hash classes
Lightweight and fast hash classes for LLRT.
- `Md5`
- `Sha1`
- `Sha256`
- `Sha384`
- `Sha512`
- `Crc32`
- `Crc32c`
## crypto.subtle
[subtle.decrypt](https://nodejs.org/api/webcrypto.html#subtledecryptalgorithm-key-data)
[subtle.deriveBits](https://nodejs.org/api/webcrypto.html#subtlederivebitsalgorithm-basekey-length)
[subtle.digest](https://nodejs.org/api/webcrypto.html#subtledigestalgorithm-data)
[subtle.encrypt](https://nodejs.org/api/webcrypto.html#subtleencryptalgorithm-key-data)
[subtle.exportKey](https://nodejs.org/api/webcrypto.html#subtleexportkeyformat-key)
[subtle.generateKey](https://nodejs.org/api/webcrypto.html#subtlegeneratekeyalgorithm-extractable-keyusages)
[subtle.importKey](https://nodejs.org/api/webcrypto.html#subtleimportkeyformat-keydata-algorithm-extractable-keyusages)
[subtle.sign](https://nodejs.org/api/webcrypto.html#subtlesignalgorithm-key-data)
[subtle.verify](https://nodejs.org/api/webcrypto.html#subtleverifyalgorithm-key-signature-datah)
## dgram
[createSocket](https://nodejs.org/api/dgram.html#dgramcreatesocketoptions-callback)
### Class: dgram.Socket
[address](https://nodejs.org/api/dgram.html#socketaddress)
[bind](https://nodejs.org/api/dgram.html#socketbindport-address-callback)
[close](https://nodejs.org/api/dgram.html#socketclosecallback)
[ref](https://nodejs.org/api/dgram.html#socketref)
[send](https://nodejs.org/api/dgram.html#socketsendmsg-offset-length-port-address-callback)
[unref](hhttps://nodejs.org/api/dgram.html#socketunref)
## dns
[lookup](https://nodejs.org/api/dns.html#dnslookuphostname-options-callback)
## events
[EventEmitter](https://nodejs.org/api/events.html#class-eventemitter)
## fs
[accessSync](https://nodejs.org/api/fs.html#fsaccesssyncpath-mode)
[constants](https://nodejs.org/api/fs.html#file-access-constants)
[lstatSync](https://nodejs.org/api/fs.html#fslstatsyncpath-options)
[mkdirSync](https://nodejs.org/api/fs.html#fsmkdirsyncpath-options)
[mkdtempSync](https://nodejs.org/api/fs.html#fsmkdtempsyncprefix-options)
[readdirSync](https://nodejs.org/api/fs.html#fsreaddirsyncpath-options)
[readFileSync](https://nodejs.org/api/fs.html#fsreadfilesyncpath-options)
[rmdirSync](https://nodejs.org/api/fs.html#fsrmdirsyncpath-options)
[rmSync](https://nodejs.org/api/fs.html#fsrmsyncpath-options)
[statSync](https://nodejs.org/api/fs.html#fsstatsyncpath-options)
[writeFileSync](https://nodejs.org/api/fs.html#fswritefilesyncfile-data-options)
[chmodSync](https://nodejs.org/api/fs.html#fschmodsyncpath-mode)
[renameSync](https://nodejs.org/api/fs.html#fsrenamesyncoldpath-newpath)
[symlinkSync](https://nodejs.org/api/fs.html#fssymlinksynctarget-path-type)
## fs/promises
[access](https://nodejs.org/api/fs.html#fsstatpath-options-callback)
[constants](https://nodejs.org/api/fs.html#file-access-constants)
[lstat](https://nodejs.org/api/fs.html#fspromiseslstatpath-options)
[mkdir](https://nodejs.org/api/fs.html#fsmkdirpath-options-callback)
[mkdtemp](https://nodejs.org/api/fs.html#fsmkdtempprefix-options-callback)
[open](https://nodejs.org/api/fs.html#fspromisesopenpath-flags-mode)
[readdir](https://nodejs.org/api/fs.html#fspromisesreaddirpath-options)
[readFile](https://nodejs.org/api/fs.html#filehandlereadfileoptions)
[rm](https://nodejs.org/api/fs.html#fsrmpath-options-callback)
[rmdir](https://nodejs.org/api/fs.html#fsrmdirpath-options-callback)
[stat](https://nodejs.org/api/fs.html#fsstatpath-options-callback)
[writeFile](https://nodejs.org/api/fs.html#fspromiseswritefilefile-data-options)
[chmod](https://nodejs.org/api/fs.html#fspromiseschmodpath-mode)
[rename](https://nodejs.org/api/fs.html#fspromisesrenameoldpath-newpath)
[symlink](https://nodejs.org/api/fs.html#fspromisessymlinktarget-path-type)
## https
[Agent](https://nodejs.org/api/https.html#class-httpsagent)
## module
[builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules)
[createRequire](https://nodejs.org/api/module.html#modulecreaterequirefilename)
> [!NOTE]
> `require` is available from esm modules natively. This function is just for compatibility
[isBuiltin](https://nodejs.org/api/module.html#moduleisbuiltinmodulename)
[registerHooks](https://nodejs.org/api/module.html#moduleregisterhooksoptions)
## net
> [!WARNING]
> These APIs uses native streams that is not 100% compatible with the Node.js Streams API. Server APIs like `createSever` provides limited functionality useful for testing purposes. Serverless applications typically don't expose servers. Some server options are not supported:
> `highWaterMark`, `pauseOnConnect`, `keepAlive`, `noDelay`, `keepAliveInitialDelay`
[connect](https://nodejs.org/api/net.html#netconnect)
[createConnection](https://nodejs.org/api/net.html#netcreateconnection)
[createServer](https://nodejs.org/api/net.html#netcreateserveroptions-connectionlistener)
## os
[arch](https://nodejs.org/api/os.html#osarch)
[availableParallelism](https://nodejs.org/api/os.html#osavailableparallelism)
[cpus](https://nodejs.org/api/os.html#oscpus)
[devNull](https://nodejs.org/api/os.html#osdevnull)
[endianness](https://nodejs.org/api/os.html#osendianness)
[EOL](https://nodejs.org/api/os.html#oseol)
[freemem](https://nodejs.org/api/os.html#osfreemem)
[getPriority](https://nodejs.org/api/os.html#osgetprioritypid)
[homedir](https://nodejs.org/api/os.html#oshomedir)
[hostname](https://nodejs.org/api/os.html#oshostname)
[loadavg](https://nodejs.org/api/os.html#osloadavg)
[machine](https://nodejs.org/api/os.html#osmachine)
[networkInterfaces](https://nodejs.org/api/os.html#osnetworkinterfaces)
[platform](https://nodejs.org/api/os.html#osplatform)
[release](https://nodejs.org/api/os.html#osrelease)
[setPriority](https://nodejs.org/api/os.html#ossetprioritypid-priority)
[tmpdir](https://nodejs.org/api/os.html#osplatform)
[totalmem](https://nodejs.org/api/os.html#ostotalmem)
[type](https://nodejs.org/api/os.html#ostype)
[uptime](https://nodejs.org/api/os.html#osuptime)
[userInfo](https://nodejs.org/api/os.html#osuserinfooptions)
[version](https://nodejs.org/api/os.html#osversion)
## path
[basename](https://nodejs.org/api/path.html#pathbasenamepath-suffix)
[delimiter](https://nodejs.org/api/path.html#pathdelimiter)
[dirname](https://nodejs.org/api/path.html#pathdirnamepath)
[extname](https://nodejs.org/api/path.html#pathextnamepath)
[format](https://nodejs.org/api/path.html#pathformatpathobject)
[isAbsolute](https://nodejs.org/api/path.html#pathisabsolutepath)
[join](https://nodejs.org/api/path.html#pathjoinpaths)
[normalize](https://nodejs.org/api/path.html#pathnormalizepath)
[parse](https://nodejs.org/api/path.html#pathparsepath)
[relative](https://nodejs.org/api/path.html#pathrelativefrom-to)
[resolve](https://nodejs.org/api/path.html#pathresolvepaths)
## perf_hooks
_performance is available globally_
[performance.now](https://nodejs.org/api/perf_hooks.html#performancenow)
## process
_process is available globally_
[arch](https://nodejs.org/api/process.html#processarch)
[argv](https://nodejs.org/api/process.html#processargv)
[argv0](https://nodejs.org/api/process.html#processargv0)
[cwd](https://nodejs.org/api/process.html#processcwd)
[env](https://nodejs.org/api/process.html#processenv)
[exit](https://nodejs.org/api/process.html#processexitcode)
[exitCode](https://nodejs.org/api/process.html#processexitcode-1)
[getegid](https://nodejs.org/api/process.html#processgetegid)
[geteuid](https://nodejs.org/api/process.html#processgeteuid)
[getgid](https://nodejs.org/api/process.html#processgetgid)
[getuid](https://nodejs.org/api/process.html#processgetuid)
[hrtime](https://nodejs.org/api/process.html#processhrtime)
[id](https://nodejs.org/api/process.html#processpid)
[kill](https://nodejs.org/api/process.html#processkillpid-signal)
[platform](https://nodejs.org/api/process.html#processplatform)
[release](https://nodejs.org/api/process.html#processrelease)
[setegid](https://nodejs.org/api/process.html#processsetegidgid)
[seteuid](https://nodejs.org/api/process.html#processseteuiduid)
[setgid](https://nodejs.org/api/process.html#processsetgidgid)
[setuid](https://nodejs.org/api/process.html#processsetuiduid)
[version](https://nodejs.org/api/process.html#processversion)
[versions](https://nodejs.org/api/process.html#processversions)
## stream
[Duplex](https://nodejs.org/api/stream.html#class-streamduplex)
[PassThrough](https://nodejs.org/api/stream.html#class-streampassthrough)
[Readable](https://nodejs.org/api/stream.html#class-streamreadable)
[Stream](https://nodejs.org/api/stream.html#class-stream)
[Transform](https://nodejs.org/api/stream.html#class-streamtransform)
[Writable](https://nodejs.org/api/stream.html#class-streamwritable)
[finished](https://nodejs.org/api/stream.html#streamfinishedstream-options-callback)
[pipeline](https://nodejs.org/api/stream.html#streampipelinestreams-callback)
## stream/promises
[finished](https://nodejs.org/api/stream.html#streamfinishedstream-options-callback)
[pipeline](https://nodejs.org/api/stream.html#streampipelinestreams-callback)
## string_decoder
[StringDecoder](https://nodejs.org/api/string_decoder.html#class-stringdecoder)
## timers
_Also available globally_
[clearImmediate](https://nodejs.org/api/timers.html#clearimmediateimmediate)
[clearInterval](https://nodejs.org/api/timers.html#clearintervaltimeout)
[clearTimeout](https://nodejs.org/api/timers.html#cleartimeouttimeout)
[setImmediate](https://nodejs.org/api/timers.html#setimmediatecallback-args)
[setInterval](https://nodejs.org/api/timers.html#setintervalcallback-delay-args)
[setTimeout](https://nodejs.org/api/timers.html#settimeoutcallback-delay-args)
## tty
[isatty](https://nodejs.org/api/tty.html#ttyisattyfd)
## url
### Class
[URL](https://nodejs.org/api/url.html#class-url)
[URLSearchParams](https://nodejs.org/api/url.html#class-urlsearchparams)
### Prototype methods
[domainToASCII](https://nodejs.org/api/url.html#urldomaintoasciidomain)
[domainToUnicode](https://nodejs.org/api/url.html#urldomaintounicodedomain)
[fileURLToPath](https://nodejs.org/api/url.html#urlfileurltopathurl-options)
[format](https://nodejs.org/api/url.html#urlformaturl-options)
[pathToFileURL](https://nodejs.org/api/url.html#urlpathtofileurlpath-options)
[urlToHttpOptions](https://nodejs.org/api/url.html#urlurltohttpoptionsurl)
## util
> [!IMPORTANT]
> Supported encodings: hex, base64, utf-8, utf-16le, windows-1252 and their aliases.
[format](https://nodejs.org/api/util.html#utilformatformat-args)
[inherits](https://nodejs.org/api/util.html#utilinheritsconstructor-superconstructor)
[TextDecoder](https://nodejs.org/api/util.html#class-utiltextdecoder)
[TextEncoder](https://nodejs.org/api/util.html#class-utiltextdecoder)
## zlib
### Convenience methods
[deflate](https://nodejs.org/api/zlib.html#zlibdeflatebuffer-options-callback)
[deflateSync](https://nodejs.org/api/zlib.html#zlibdeflatesyncbuffer-options)
[deflateRaw](https://nodejs.org/api/zlib.html#zlibdeflaterawbuffer-options-callback)
[deflateRawSync](https://nodejs.org/api/zlib.html#zlibdeflaterawsyncbuffer-options)
[gzip](https://nodejs.org/api/zlib.html#zlibgzipbuffer-options-callback)
[gzipSync](https://nodejs.org/api/zlib.html#zlibgzipsyncbuffer-options)
[inflate](https://nodejs.org/api/zlib.html#zlibinflatebuffer-options-callback)
[inflateSync](https://nodejs.org/api/zlib.html#zlibinflatesyncbuffer-options)
[inflateRaw](https://nodejs.org/api/zlib.html#zlibinflaterawbuffer-options-callback)
[inflateRawSync](https://nodejs.org/api/zlib.html#zlibinflaterawsyncbuffer-options)
[gunzip](https://nodejs.org/api/zlib.html#zlibgunzipbuffer-options-callback)
[gunzipSync](https://nodejs.org/api/zlib.html#zlibgunzipsyncbuffer-options)
[brotliCompress](https://nodejs.org/api/zlib.html#zlibbrotlicompressbuffer-options-callback)
[brotliCompressSync](https://nodejs.org/api/zlib.html#zlibbrotlicompresssyncbuffer-options)
[brotliDecompress](https://nodejs.org/api/zlib.html#zlibbrotlidecompressbuffer-options-callback)
[brotliDecompressSync](https://nodejs.org/api/zlib.html#zlibbrotlidecompresssyncbuffer-options)
[zstdCompress](https://nodejs.org/api/zlib.html#zlibzstdcompressbuffer-options-callback)
[zstdCompressSync](https://nodejs.org/api/zlib.html#zlibzstdcompresssyncbuffer-options)
[zstdDecompress](https://nodejs.org/api/zlib.html#zlibzstddecompressbuffer-options-callback)
[zstdDecompressSync](https://nodejs.org/api/zlib.html#zlibzstddecompresssyncbuffer-options)
# LLRT API
## llrt:hex
```typescript
export function encode(
value: string | Array | ArrayBuffer | Uint8Array
): string;
export function decode(value: string): Uint8Array;
```
## llrt:timezone
Lightweight timezone support for LLRT. Provides timezone offset calculations and a minimal `Intl.DateTimeFormat` implementation for dayjs and similar library compatibility.
```typescript
interface Timezone {
/**
* Get the UTC offset in minutes for a timezone at a given time.
* Returns a positive value for timezones ahead of UTC (e.g., 540 for Asia/Tokyo)
* and a negative value for timezones behind UTC (e.g., -420 for America/Denver).
* Automatically handles DST transitions.
*/
getOffset(timezone: string, epochMs: number): number;
/**
* List all available IANA timezone names.
*/
list(): string[];
}
declare var Timezone: Timezone;
export { Timezone };
```
### Example
```javascript
import { Timezone } from "llrt:timezone";
// Get current offset for Denver (handles DST automatically)
const offset = Timezone.getOffset("America/Denver", Date.now());
// Returns -420 (UTC-7) in winter, -360 (UTC-6) in summer
// Check DST transition
const beforeDst = new Date("2024-03-09T12:00:00Z").getTime();
const afterDst = new Date("2024-03-11T12:00:00Z").getTime();
console.log(Timezone.getOffset("America/Denver", beforeDst)); // -420
console.log(Timezone.getOffset("America/Denver", afterDst)); // -360
// List all available timezones
const zones = Timezone.list();
```
### Intl.DateTimeFormat
LLRT provides a minimal `Intl.DateTimeFormat` implementation focused on timezone support. This enables libraries like dayjs to work with timezone conversions transparently.
```javascript
// Create a formatter for a specific timezone
const formatter = new Intl.DateTimeFormat("en-US", {
timeZone: "America/Denver",
hour12: false,
year: "numeric",
month: "2-digit",
day: "2-digit",
hour: "2-digit",
minute: "2-digit",
second: "2-digit",
});
// Format a date
const date = new Date("2022-03-02T15:45:34Z");
console.log(formatter.format(date)); // "03/02/2022, 08:45:34"
// Get formatted parts
const parts = formatter.formatToParts(date);
// [{ type: "month", value: "03" }, { type: "literal", value: "/" }, ...]
// Get resolved options
const options = formatter.resolvedOptions();
console.log(options.timeZone); // "America/Denver"
```
### Date.prototype.toLocaleString with timezone
`Date.prototype.toLocaleString` is enhanced to support the `timeZone` option:
```javascript
const date = new Date("2022-03-02T15:45:34Z");
// Convert to Denver time
console.log(date.toLocaleString("en-US", { timeZone: "America/Denver" }));
// "03/02/2022, 8:45:34 AM"
// Convert to Tokyo time
console.log(date.toLocaleString("en-US", { timeZone: "Asia/Tokyo" }));
// "03/03/2022, 12:45:34 AM"
```
### Using with dayjs
The timezone module enables dayjs timezone support without polyfills:
```javascript
const dayjs = require("dayjs");
const utc = require("dayjs/plugin/utc");
const timezone = require("dayjs/plugin/timezone");
dayjs.extend(utc);
dayjs.extend(timezone);
// Convert between timezones
const date = dayjs("2022-03-02T15:45:34Z");
console.log(date.tz("America/Denver").format()); // "2022-03-02T08:45:34-07:00"
console.log(date.tz("Asia/Tokyo").format()); // "2022-03-03T00:45:34+09:00"
// Get start of day in a specific timezone
const denver = date.tz("America/Denver");
console.log(denver.startOf("day").format()); // "2022-03-02T00:00:00-07:00"
```
## llrt:qjs
```typescript
interface MemoryInfo {
malloc_size: number;
malloc_limit: number;
memory_used_size: number;
malloc_count: number;
memory_used_count: number;
atom_count: number;
atom_size: number;
str_count: number;
str_size: number;
obj_count: number;
obj_size: number;
prop_count: number;
prop_size: number;
shape_count: number;
shape_size: number;
js_func_count: number;
js_func_size: number;
js_func_code_size: number;
js_func_pc2line_count: number;
js_func_pc2line_size: number;
c_func_count: number;
array_count: number;
fast_array_count: number;
fast_array_elements: number;
binary_object_count: number;
binary_object_size: number;
}
export function ComputeMemoryUsage(): MemoryInfo;
```
## llrt:xml
A lightweight and fast XML parser and builder
```typescript
export class XmlText {
constructor(text: string);
toString(): string;
}
export class XmlNode {
constructor(name: string);
withName(name: string): this;
addAttribute(name: string, value: string): this;
addChildNode(node: XmlNode | XmlText): this;
removeAttribute(name: string): this;
toString(): string;
}
type XmlParserOptions = {
ignoreAttributes?: boolean;
attributeNamePrefix?: string;
textNodeName?: string;
attributeValueProcessor?: (attrName: string, attrValue: string, jpath: string) => unknown;
tagValueProcessor?: (attrName: string, attrValue: string, jpath: string, hasAttributes: boolean) => unknown;
}
export class XMLParser(options?: XmlParserOptions){
parse(xml:string):object
}
```
## llrt:util
```typescript
export function dimensions(): [number, number];
export function load(path: string): any;
export function print(value: any): void;
```
# Web Platform API
## CONSOLE
[Console](https://developer.mozilla.org/en-US/docs/Web/API/console)
## DOM
[AbortController](https://developer.mozilla.org/en-US/docs/Web/API/AbortController)
[AbortSignal](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal)
[CustomEvent](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent)
[Event](https://developer.mozilla.org/en-US/docs/Web/API/Event)
[EventTarget](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget)
## ECMASCRIPT
[globalThis](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis)
## ENCODING
[TextDecoder](https://developer.mozilla.org/en-US/docs/Web/API/TextDecoder)
[TextEncoder](https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder)
## FETCH
[Headers](https://developer.mozilla.org/en-US/docs/Web/API/Headers)
[Request](https://developer.mozilla.org/en-US/docs/Web/API/Request)
[Response](https://developer.mozilla.org/en-US/docs/Web/API/Response)
[fetch](https://developer.mozilla.org/en-US/docs/Web/API/Headers)
> [!IMPORTANT]
> There are some differences with the [WHATWG standard](https://fetch.spec.whatwg.org). Mainly browser specific behavior is removed:
>
> - `keepalive` is always true
> - `request.body` can only be `string`, `Array`, `ArrayBuffer` or `Uint8Array`
> - `response.body` returns `null`. Use `response.text()`, `response.json()` etc
> - `mode`, `credentials`, `referrerPolicy`, `priority`, `cache` is not available/applicable
## FILEAPI
[Blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob)
[File](https://developer.mozilla.org/en-US/docs/Web/API/File)
## HR-TIME
[performance.now](https://developer.mozilla.org/en-US/docs/Web/API/Performance/now)
[performance.timeOrigin](https://developer.mozilla.org/en-US/docs/Web/API/Performance/timeOrigin)
## HTML
[atob](https://developer.mozilla.org/en-US/docs/Web/API/atob)
[btoa](https://developer.mozilla.org/en-US/docs/Web/API/btoa)
[clearInterval](https://developer.mozilla.org/en-US/docs/Web/API/Window/clearInterval)
[clearTimeout](https://developer.mozilla.org/en-US/docs/Web/API/Window/clearTimeout)
[navigator](https://developer.mozilla.org/en-US/docs/Web/API/Window/navigator)
[queueMicrotask](https://developer.mozilla.org/en-US/docs/Web/API/Window/queueMicrotask)
[setInterval](https://developer.mozilla.org/en-US/docs/Web/API/Window/setInterval)
[setTimeout](https://developer.mozilla.org/en-US/docs/Web/API/Window/setTimeout)
[structuredClone](https://developer.mozilla.org/en-US/docs/Web/API/Window/structuredClone)
[userAgent](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/userAgent)
## STREAMS
[ByteLengthQueuingStrategy](https://developer.mozilla.org/en-US/docs/Web/API/ByteLengthQueuingStrategy)
[CountQueuingStrategy](https://developer.mozilla.org/en-US/docs/Web/API/CountQueuingStrategy)
[ReadableByteStreamController](https://developer.mozilla.org/en-US/docs/Web/API/ReadableByteStreamController)
[ReadableStream](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream)
[ReadableStreamBYOBReader](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBReader)
[ReadableStreamBYOBRequest](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBRequest)
[ReadableStreamDefaultController](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultController)
[ReadableStreamDefaultReader](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultReader)
[WritableStream](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream)
[WritableStreamDefaultController](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultController)
[WritableStreamDefaultWriter](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter)
## URL
[URL](https://developer.mozilla.org/en-US/docs/Web/API/URL)
[URLSearchParams](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams)
## WEBCRYPTO
[Crypto](https://developer.mozilla.org/en-US/docs/Web/API/Crypto)
[CryptoKey](https://developer.mozilla.org/en-US/docs/Web/API/CryptoKey)
[SubtleCrypto](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto)
## WEBIDL
[DOMException](https://developer.mozilla.org/en-US/docs/Web/API/DOMException)
## XHR
[FormData](https://developer.mozilla.org/en-US/docs/Web/API/FormData)
================================================
FILE: CHANGELOG.md
================================================
### Features
- Added dgram (UDP socket) module support (@chessbyte, @richarddavison)
- Added timezone support with minimal Intl.DateTimeFormat (@chessbyte, @richarddavison)
- Added Symbol.toStringTag to Web API classes (@chessbyte)
- Added Symbol.toStringTag to Crypto and SubtleCrypto (@chessbyte)
- Implemented `symlink` and `symlinkSync` in fs module (@kyubisation, @richarddavison)
- Exposed FormData in fetch (@nabetti1720)
- Exposed `module.registerHooks()` (@nabetti1720, @richarddavison)
- Exposed `llrt:qjs` module (@nabetti1720)
- Added modular crypto with multiple backend options (@richarddavison)
- Eliminated `ring` dependency from pure-rust crypto backend (@nabetti1720)
- Exported Md5, Sha1, Sha256, Sha384, Sha512 hash classes (@richarddavison)
- Improved performance interface compatibility in perf_hooks (@nabetti1720)
- Simplified child_process signal handling and detachment (@richarddavison)
- Added custom inspect functions for Map, Set, DataView, and ArrayBuffer (@richarddavison)
- Added basic Agent support (@Sytten)
- Transitioned from `chrono/chrono-tz` to `jiff` (@nabetti1720)
### Fixes
- Fix Proxy object handling JSON and console modules
- Fix S3 endpoint resolution issue in new SDK version (@richarddavison)
- Fix suite hook handling in TestAgent (@richarddavison)
- Handle secret param in Hash constructors for SDK signing (@richarddavison)
- Fix Headers keys and values methods to return iterable values (@richarddavison)
- Improve encoding handling in Hash and Hmac implementations (@richarddavison)
- Fix Buffer from utf16le (@Sytten)
- Buffer improvements (@Sytten)
- Use Latin-1 encoding for atob() per WHATWG spec (@chessbyte, @richarddavison)
- Fix buffer offsets when repeating subarray (@nabetti1720, @richarddavison)
- Fix stream/web primordials used before initialization (@nabetti1720)
- Correctly handle 'require' with parent directory specification (@nabetti1720, @richarddavison)
- Register and run test hooks in correct order (@kyubisation, @richarddavison)
- Fix & simplify json escape (@richarddavison)
- Require primordials to be initialized from module once to avoid data race (@richarddavison)
- Ignore init for global clients not in us-east-1 (@perpil)
- Improve support for dns lookup (@Sytten)
- Remove zstd WriteBuf dependency for byte slice conversion (@chessbyte)
- Disable `mlkem` in rustls-graviola (@nabetti1720)
- Optional webpki (@Sytten)
### Maintenance
- Upgrade rquickjs to 0.11 (@nabetti1720)
- Upgrade rquickjs to 0.10.0 (@mohebifar, @richarddavison)
- Eliminate use of `jwalk` for directory recursion (@nabetti1720)
- Update SDK dependencies and remove UUID module (@richarddavison)
- Dependency upgrades
Thanks for all the reports and contributors
Full list of changes:
https://github.com/awslabs/llrt/compare/v0.7.0-beta...v0.8.1-beta
================================================
FILE: CODE_OF_CONDUCT.md
================================================
## Code of Conduct
This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
opensource-codeofconduct@amazon.com with any additional questions or comments.
================================================
FILE: CONTRIBUTING.md
================================================
# Contributing Guidelines
Thank you for your interest in contributing to our project. Whether it's a bug report, new feature, correction, or additional
documentation, we greatly value feedback and contributions from our community.
Please read through this document before submitting any issues or pull requests to ensure we have all the necessary
information to effectively respond to your bug report or contribution.
## Reporting Bugs/Feature Requests
We welcome you to use the GitHub issue tracker to report bugs or suggest features.
When filing an issue, please check existing open, or recently closed, issues to make sure somebody else hasn't already
reported the issue. Please try to include as much information as you can. Details like these are incredibly useful:
- A reproducible test case or series of steps
- The version of our code being used
- Any modifications you've made relevant to the bug
- Anything unusual about your environment or deployment
## Contributing via Pull Requests
Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that:
1. You are working against the latest source on the _main_ branch.
2. You check existing open, and recently merged, pull requests to make sure someone else hasn't addressed the problem already.
3. You open an issue to discuss any significant work - we would hate for your time to be wasted.
To send us a pull request, please:
1. Fork the repository.
2. Modify the source; please focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change.
3. Ensure local tests pass.
4. Commit to your fork using clear commit messages.
5. Send us a pull request, answering any default questions in the pull request interface.
6. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.
GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and
[creating a pull request](https://help.github.com/articles/creating-a-pull-request/).
## Finding contributions to work on
Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels (enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any 'help wanted' issues is a great place to start.
## Code of Conduct
This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
<opensource-codeofconduct@amazon.com> with any additional questions or comments.
## Security issue notifications
If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public github issue.
## Licensing
See the [LICENSE](LICENSE) file for our project's licensing. We will ask you to confirm the licensing of your contribution.
================================================
FILE: Cargo.toml
================================================
[workspace]
resolver = "2"
members = [
"libs/llrt_build",
"libs/llrt_compression",
"libs/llrt_context",
"libs/llrt_encoding",
"libs/llrt_json",
"libs/llrt_numbers",
"libs/llrt_test",
"libs/llrt_test_tls",
"libs/llrt_utils",
"modules/llrt_abort",
"modules/llrt_async_hooks",
"modules/llrt_buffer",
"modules/llrt_child_process",
"modules/llrt_console",
"modules/llrt_crypto",
"modules/llrt_dgram",
"modules/llrt_events",
"modules/llrt_exceptions",
"modules/llrt_fetch",
"modules/llrt_fs",
"modules/llrt_http",
"modules/llrt_intl",
"modules/llrt_navigator",
"modules/llrt_net",
"modules/llrt_os",
"modules/llrt_path",
"modules/llrt_perf_hooks",
"modules/llrt_process",
"modules/llrt_stream",
"modules/llrt_stream_web",
"modules/llrt_string_decoder",
"modules/llrt_temporal",
"modules/llrt_timers",
"modules/llrt_tls",
"modules/llrt_tty",
"modules/llrt_url",
"modules/llrt_util",
"modules/llrt_zlib",
"llrt_modules",
"llrt_core",
"llrt",
]
[profile.flame]
inherits = "release"
strip = false
debug = true
[profile.release]
strip = true
lto = true
codegen-units = 1
opt-level = 3
panic = "abort"
[profile.test]
opt-level = 3
================================================
FILE: GOVERNANCE.md
================================================
# Project Governance (Very Minimal Governance model)
This open source project is managed by a Steering Committee composed of the maintainers of this project. Maintainers are
defined as individuals with full commit access to the project repositories.
## Steering Committee
The Steering Committee will be responsible for oversight of all technical, project, approval, and policy matters for the
project. This notably includes brand and trademark management.
The Steering Committee members are listed in the MAINTAINERS.md file in the repository. New maintainers (and accordingly,
Steering Committee members) may be added or removed by no less than 3/4 affirmative vote of the Steering Committee. The
Steering Committee will appoint a Chair responsible for organizing Steering Committee activity. If the Steering Committee
Chair is removed from the Committee (or the Chair steps down from that role), it is the responsibility of the Steering
Committe to appoint a new Chair.
The Steering Committee may, at its discretion, add or remove members who are not maintainers.
## Voting
The Steering Committee will strive for all decisions to be made by consensus. While explicit agreement of the entire
Steering Committee is preferred, it is not required for consensus. Rather, the Steering Committee will determine
consensus based on their good faith consideration of a number of factors, including the dominant view of the Steering
Committee and nature of support and objections. The Steering Committee will document evidence of consensus in accordance
with these requirements. If consensus cannot be reached, the Steering Committee will make the decision by a vote.
The Steering Committee Chair will call a vote with reasonable notice to the Steering Committee, setting out a discussion
period and a separate voting period. Any discussion may be conducted in person or electronically by text, voice, or video.
The discussion will be open to the public, with the notable exception of discussions involving embargoed security issues
or the addition or removal of maintainers, which will be private. In any vote, each voting representative will have one
vote. Except as specifically noted elsewhere in this document, decisions by vote require a simple majority vote of all
voting members.
## Termination of Membership
A maintainer’s access (and accordingly, their position on the Steering Committee) will be removed if any of the following
occur:
- Resignation: Written notice of resignation to the Steering Committee
- Steering Committee Vote: 3/4 affirmative vote of the Steering Committee to remove a member
- Unreachable Member: If a member is unresponsive for more than six months, the remaining active members of the Steering
Committee may vote to remove the member
## License of this document
This document is a modified work of the GitHub Minimal Viable Governance model, located here:
[https://github.com/github/MVG/](https://github.com/github/MVG/)
This document may be used, modified, and/or distributed under the terms of the
[Creative Commons Attribution 4.0 International (CC-BY) license](https://creativecommons.org/licenses/by/4.0/legalcode).
================================================
FILE: LICENSE
================================================
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
================================================
FILE: MAINTAINERS.md
================================================
<!-- markdownlint-disable MD043 -->
## Table of contents <!-- omit in toc -->
- [Overview](#overview)
- [Current Maintainers](#current-maintainers)
- [Labels](#labels)
- [Maintainer Responsibilities](#maintainer-responsibilities)
- [Uphold Code of Conduct](#uphold-code-of-conduct)
- [Prioritize Security](#prioritize-security)
- [Review Pull Requests](#review-pull-requests)
- [Triage New Issues](#triage-new-issues)
## Overview
> **Please treat this content as a living document.**
This is document explains who the maintainers are (see below), what they do in this repo, and how they should be doing it. If you're interested in contributing, see [CONTRIBUTING](CONTRIBUTING.md).
## Current Maintainers
| Maintainer | GitHub ID | Affiliation |
| --------------- | --------------------------------------------------- | ----------- |
| Richard Davison | [richarddavison](https://github.com/richarddavison) | Amazon |
| Nik Pinski | [nikp](https://github.com/nikp) | Amazon |
| Harold Sun | [bnusunny](https://github.com/bnusunny) | Amazon |
| Iain Maitland | [imaitland](https://github.com/imaitland) | Amazon |
## Labels
> WORK IN PROGRESS
## Maintainer Responsibilities
Maintainers are active and visible members of the community, and have [maintain-level permissions on a repository](https://docs.github.com/en/organizations/managing-access-to-your-organizations-repositories/repository-permission-levels-for-an-organization). Use those privileges to serve the community and evolve code as follows.
Be aware of recurring ambiguous situations and [document them](#common-scenarios) to help your fellow maintainers.
### Uphold Code of Conduct
Model the behavior set forward by the [Code of Conduct](CODE_OF_CONDUCT.md) and raise any violations to other maintainers and admins. There could be unusual circumstances where inappropriate behavior does not immediately fall within the [Code of Conduct](CODE_OF_CONDUCT.md).
These might be nuanced and should be handled with extra care - when in doubt, do not engage and reach out to other maintainers and admins.
### Prioritize Security
Security is your number one priority. Maintainer's Github keys must be password protected securely and any reported security vulnerabilities are addressed before features or bugs.
Note that this repository is monitored and supported 24/7 by Amazon Security, see [Reporting a Vulnerability](CONTRIBUTING.md#security-issue-notifications) for details.
### Review Pull Requests
Review pull requests regularly, comment, suggest, reject, merge and close. Accept only high quality pull-requests. Provide code reviews and guidance on incoming pull requests.
PRs are [labeled](#labels) based on file changes and semantic title. Pay attention to whether labels reflect the current state of the PR and correct accordingly.
Use and enforce [semantic versioning](https://semver.org/) pull request titles, as these will be used for [CHANGELOG](CHANGELOG.md) and [Release notes](https://github.com/awslabs/llrt/releases) - make sure they communicate their intent at the human level.
See [Common scenarios](#common-scenarios) section for additional guidance.
### Triage New Issues
Manage [labels](#labels), review issues regularly, and create new labels as needed by the project. Remove `triage` label when you're able to confirm the validity of a request, a bug can be reproduced, etc. Give priority to the original author for implementation, unless it is a sensitive task that is best handled by maintainers.
Make sure issues are assigned to our [board of activities](https://github.com/orgs/awslabs/projects/145/)
Use our [labels](#labels) to signal good first issues to new community members, and to set expectation that this might need additional feedback from the author, other customers, experienced community members and/or maintainers.
> WORK IN PROGRESS
================================================
FILE: Makefile
================================================
TARGET_linux_x86_64 = x86_64-unknown-linux-musl
TARGET_linux_arm64 = aarch64-unknown-linux-musl
TARGET_darwin_x86_64 = x86_64-apple-darwin
TARGET_darwin_arm64 = aarch64-apple-darwin
TARGET_windows_x86_64 = x86_64-pc-windows-gnu
TARGET_windows_arm64 = aarch64-is-not-yet-supported
RUST_VERSION = nightly
TOOLCHAIN = +$(RUST_VERSION)
BUILD_ARG = $(TOOLCHAIN) build -r
BUILD_DIR = ./target/release
BUNDLE_DIR = bundle
TS_SOURCES = $(wildcard llrt_core/src/modules/js/*.ts) $(wildcard llrt_core/src/modules/js/@llrt/test/*.ts) $(wildcard llrt_core/src/modules/js/@llrt/*.ts) $(wildcard tests/unit/*.ts)
STD_JS_FILE = $(BUNDLE_DIR)/js/@llrt/std.js
RELEASE_ARCH_NAME_x64 = x86_64
RELEASE_ARCH_NAME_arm64 = arm64
LAMBDA_PREFIX = llrt-lambda
RELEASE_TARGETS = arm64 x64
RELEASE_ZIPS = $(addprefix $(LAMBDA_PREFIX)-,$(RELEASE_TARGETS))
ifeq ($(OS),Windows_NT)
DETECTED_OS := windows
ARCH = x86_64
else
DETECTED_OS := $(shell uname | tr A-Z a-z)
ARCH = $(shell uname -m)
endif
ifeq ($(ARCH),aarch64)
ARCH = arm64
endif
ZSTD_LIB_CC_ARGS = -s -O3 -flto
ZSTD_LIB_ARGS = -j lib-nomt UNAME=Linux ZSTD_LIB_COMPRESSION=0 ZSTD_LIB_DICTBUILDER=0 AR="zig ar"
ifeq ($(DETECTED_OS),windows)
ZSTD_LIB_CC_x64 = CC="zig cc -target x86_64-windows-gnu $(ZSTD_LIB_CC_ARGS)"
else
ZSTD_LIB_CC_arm64 = CC="zig cc -target aarch64-linux-musl $(ZSTD_LIB_CC_ARGS)"
ZSTD_LIB_CC_x64 = CC="zig cc -target x86_64-linux-musl $(ZSTD_LIB_CC_ARGS)"
endif
CURRENT_TARGET ?= $(TARGET_$(DETECTED_OS)_$(ARCH))
export CC_aarch64_unknown_linux_musl = $(CURDIR)/linker/cc-aarch64-linux-musl
export CXX_aarch64_unknown_linux_musl = $(CURDIR)/linker/cxx-aarch64-linux-musl
export AR_aarch64_unknown_linux_musl = $(CURDIR)/linker/ar
export CC_x86_64_unknown_linux_musl = $(CURDIR)/linker/cc-x86_64-linux-musl
export CXX_x86_64_unknown_linux_musl = $(CURDIR)/linker/cxx-x86_64-linux-musl
export AR_x86_64_unknown_linux_musl = $(CURDIR)/linker/ar
define alias_template
release${1}: llrt-$(DETECTED_OS)-$(ARCH)${1}.zip
llrt-linux-x86_64${1}.zip: llrt-linux-x64${1}.zip
llrt-windows-x86_64${1}.zip: llrt-windows-x64${1}.zip
llrt-darwin-x86_64${1}.zip: llrt-darwin-x64${1}.zip
endef
$(eval $(call alias_template,-full-sdk))
$(eval $(call alias_template,))
$(eval $(call alias_template,-no-sdk))
define release_template
release-aws-${1}${2}: | llrt-lambda-${1}${2}.zip llrt-container-${1}${2} llrt-linux-${1}${2}.zip
llrt-lambda-${1}${2}.zip: export SDK_BUNDLE_MODE = ${3}
llrt-lambda-${1}${2}.zip: | clean-js js
cargo $$(BUILD_ARG) --target $$(TARGET_linux_$$(RELEASE_ARCH_NAME_${1})) --features lambda
./pack target/$$(TARGET_linux_$$(RELEASE_ARCH_NAME_${1}))/release/llrt target/$$(TARGET_linux_$$(RELEASE_ARCH_NAME_${1}))/release/bootstrap
@rm -rf $$@
zip -j $$@ target/$$(TARGET_linux_$$(RELEASE_ARCH_NAME_${1}))/release/bootstrap
llrt-container-${1}${2}: export SDK_BUNDLE_MODE = ${3}
llrt-container-${1}${2}: | clean-js js
cargo $$(BUILD_ARG) --target $$(TARGET_linux_$$(RELEASE_ARCH_NAME_${1})) --features lambda,uncompressed
mv target/$$(TARGET_linux_$$(RELEASE_ARCH_NAME_${1}))/release/llrt $$@
llrt-linux-${1}${2}.zip: export SDK_BUNDLE_MODE = ${3}
llrt-linux-${1}${2}.zip: | clean-js js
cargo $$(BUILD_ARG) --target $$(TARGET_linux_$$(RELEASE_ARCH_NAME_${1}))
@rm -rf $$@
zip -j $$@ target/$$(TARGET_linux_$$(RELEASE_ARCH_NAME_${1}))/release/llrt
llrt-darwin-${1}${2}.zip: export SDK_BUNDLE_MODE = ${3}
llrt-darwin-${1}${2}.zip: | clean-js js
cargo $$(BUILD_ARG) --target $$(TARGET_darwin_$$(RELEASE_ARCH_NAME_${1}))
@rm -rf $$@
zip -j $$@ target/$$(TARGET_darwin_$$(RELEASE_ARCH_NAME_${1}))/release/llrt
# llrt-windows-arm64* is automatically generated, but not currently supported.
llrt-windows-${1}${2}.zip: export SDK_BUNDLE_MODE = ${3}
llrt-windows-${1}${2}.zip: | clean-js js
cargo $$(BUILD_ARG) --target $$(TARGET_windows_$$(RELEASE_ARCH_NAME_${1}))
zip -j $$@ target/$$(TARGET_windows_$$(RELEASE_ARCH_NAME_${1}))/release/llrt.exe
endef
$(foreach target,$(RELEASE_TARGETS),$(eval $(call release_template,$(target),-full-sdk,FULL)))
$(foreach target,$(RELEASE_TARGETS),$(eval $(call release_template,$(target),,STD)))
$(foreach target,$(RELEASE_TARGETS),$(eval $(call release_template,$(target),-no-sdk,NONE)))
build: js
cargo $(BUILD_ARG) --target $(CURRENT_TARGET)
ifeq ($(DETECTED_OS),windows)
stdlib:
rustup toolchain install $(RUST_VERSION) --target $(TARGET_windows_x86_64)
rustup target add $(TARGET_windows_x86_64)
rustup component add rust-src --toolchain $(RUST_VERSION) --target $(TARGET_windows_x86_64)
else
stdlib-x64:
rustup toolchain install $(RUST_VERSION) --target $(TARGET_linux_x86_64)
rustup target add $(TARGET_linux_x86_64)
rustup component add rust-src --toolchain $(RUST_VERSION) --target $(TARGET_linux_x86_64)
stdlib-arm64:
rustup toolchain install $(RUST_VERSION) --target $(TARGET_linux_arm64)
rustup target add $(TARGET_linux_arm64)
rustup component add rust-src --toolchain $(RUST_VERSION) --target $(TARGET_linux_arm64)
stdlib: | stdlib-x64 stdlib-arm64
endif
toolchain:
rustup toolchain install $(RUST_VERSION) --target $(CURRENT_TARGET)
rustup target add $(CURRENT_TARGET)
rustup component add rust-src --toolchain $(RUST_VERSION) --target $(CURRENT_TARGET)
clean-js:
rm -rf ./bundle
clean: clean-js
rm -rf ./target
rm -rf ./lib
js: $(STD_JS_FILE)
bundle/js/%.js: $(TS_SOURCES)
node build.mjs
fix:
npx pretty-quick
cargo fix --allow-dirty
cargo clippy --fix --allow-dirty
cargo fmt
bloat: js
cargo build --profile=flame --target $(CURRENT_TARGET)
cargo bloat --profile=flame --crates
run: export AWS_LAMBDA_FUNCTION_NAME = n/a
run: export AWS_LAMBDA_FUNCTION_MEMORY_SIZE = 1
run: export AWS_LAMBDA_FUNCTION_VERSION = 1
run: export AWS_LAMBDA_RUNTIME_API = localhost:3000
run: export _EXIT_ITERATIONS = 1
run: export JS_MINIFY = 0
run: export RUST_LOG = llrt=trace
run: export _HANDLER = index.handler
run:
cargo run -vv
run-ssr: export AWS_LAMBDA_RUNTIME_API = localhost:3000
run-ssr: export TABLE_NAME=quickjs-table
run-ssr: export AWS_REGION = us-east-1
run-ssr: export _HANDLER = index.handler
run-ssr: js
cargo build
cd example/functions && yarn build && cd build && ../../../target/debug/llrt
flame:
cargo flamegraph --profile flame -- index.mjs
run-cli: export RUST_LOG = llrt=trace
run-cli: js
cargo run
test: export JS_MINIFY = 0
test: export TEST_SUB_DIR = unit
test: export LLRT_ASYNC_HOOKS = 1
test: js
cargo run -- test -d bundle/js/__tests__/$(TEST_SUB_DIR)
init-wpt:
cd wpt && \
git sparse-checkout init --no-cone && \
git sparse-checkout set \
/README.md \
/console \
/docs \
/encoding \
/FileAPI \
/fetch \
/hr-time \
/streams \
/tools \
/url \
/WebCryptoAPI \
/webidl \
/wpt \
/xhr
update-wpt:
( cd wpt && git fetch origin master && git reset --hard FETCH_HEAD && git log -1 --oneline > ../tests/wpt/revision )
test-wpt: export JS_MINIFY = 0
test-wpt: export TEST_SUB_DIR = wpt
test-wpt: js
npx pretty-quick --pattern "tests/wpt/**/*.{js,ts,json}"
cargo run -- test -d bundle/js/__tests__/$(TEST_SUB_DIR) 2> wpt_errors.tmp
tidyup-wpt:
sed -E 's/\x1b\[[0-9;]*m//g' wpt_errors.tmp \
| sed '1,/^$$/d' \
| sed -E '/^ ?[^ ]/s|^.*__tests__/|🧪/|' \
> wpt_errors.txt
test-e2e: export JS_MINIFY = 0
test-e2e: export TEST_TIMEOUT = 60000
test-e2e: export SDK_BUNDLE_MODE = STD
test-e2e: export TEST_SUB_DIR = e2e
test-e2e: js
cargo run -- test -d bundle/js/__tests__/$(TEST_SUB_DIR)
test-ci: export JS_MINIFY = 0
test-ci: export RUST_BACKTRACE = 1
test-ci: export TEST_SUB_DIR = unit
test-ci: export LLRT_ASYNC_HOOKS = 1
test-ci: clean-js | toolchain js
ifdef CARGO_FEATURES
cargo $(TOOLCHAIN) -Z build-std -Z build-std-features test --target $(CURRENT_TARGET) $(CARGO_FEATURES) -- --nocapture --show-output
cargo $(TOOLCHAIN) run -r --target $(CURRENT_TARGET) $(CARGO_FEATURES) -- test -d bundle/js/__tests__/$(TEST_SUB_DIR)
else
cargo $(TOOLCHAIN) -Z build-std -Z build-std-features test --target $(CURRENT_TARGET) --features lambda -- --nocapture --show-output
cargo $(TOOLCHAIN) run -r --target $(CURRENT_TARGET) -- test -d bundle/js/__tests__/$(TEST_SUB_DIR)
endif
libs-arm64: lib/arm64/libzstd.a lib/zstd.h lib/zstd_errors.h
libs-x64: lib/x64/libzstd.a lib/zstd.h lib/zstd_errors.h
libs: | libs-arm64 libs-x64
lib/zstd.h:
cp zstd/lib/zstd.h $@
lib/zstd_errors.h:
cp zstd/lib/zstd_errors.h $@
lib/arm64/libzstd.a:
mkdir -p $(dir $@)
rm -f zstd/lib/-.o
cd zstd/lib && make clean && make $(ZSTD_LIB_ARGS) $(ZSTD_LIB_CC_arm64)
cp zstd/lib/libzstd.a $@
lib/x64/libzstd.a:
mkdir -p $(dir $@)
rm -f zstd/lib/-.o
cd zstd/lib && make clean && make $(ZSTD_LIB_ARGS) $(ZSTD_LIB_CC_x64)
cp zstd/lib/libzstd.a $@
bench:
cargo build -r
hyperfine -N --warmup=100 "node fixtures/hello.js" "deno run fixtures/hello.js" "bun fixtures/hello.js" "$(BUILD_DIR)/llrt fixtures/hello.js" "qjs fixtures/hello.js"
deploy:
cd example/infrastructure && yarn deploy --require-approval never
check:
cargo clippy --all-targets --no-default-features --features "lambda,macro,no-sdk,uncompressed,crypto-rust,tls-ring" -- -D warnings
test-rs:
cargo test --all-targets --no-default-features --features "lambda,macro,no-sdk,uncompressed,crypto-rust,tls-ring"
check-crates:
cargo metadata --no-deps --format-version 1 --quiet | \
jq -r '.packages[] | select(.manifest_path | contains("modules/")) | .name' | \
while read crate; do \
echo "Checking crate: $$crate"; \
cargo check -p "$$crate"; \
done
.PHONY: libs check check-all check-crates libs-arm64 libs-x64 toolchain clean-js release-linux release-darwin release-windows lambda stdlib stdlib-x64 stdlib-arm64 test test-ci run js run-release build release clean flame deploy
================================================
FILE: NOTICE
================================================
LLRT
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
================================================
FILE: README.md
================================================
[](https://github.com/awslabs/llrt/actions/workflows/ci.yml) [](https://github.com/awslabs/llrt/actions/workflows/release.yml)
LLRT (**L**ow **L**atency **R**un**t**ime) is a lightweight JavaScript runtime designed to address the growing demand for fast and efficient Serverless applications. LLRT offers up to over **10x** faster startup and up to **2x** overall lower cost compared to other JavaScript runtimes running on **AWS Lambda**
It's built in Rust, utilizing QuickJS as JavaScript engine, ensuring efficient memory usage and swift startup.
> [!WARNING]
> LLRT is an **experimental** package. It is subject to change and intended only for evaluation purposes.
<sub>LLRT - [DynamoDB Put, ARM, 128MB](example/functions/src/v3-lib.mjs):<sub>

<sub>Node.js 20 - [DynamoDB Put, ARM, 128MB](example/functions/src/v3-lib.mjs):<sub>

HTTP benchmarks measured in **round trip time** for a cold start ([why?](#benchmark-methodology))
## Configure Lambda functions to use LLRT
Download the last LLRT release from <https://github.com/awslabs/llrt/releases>
### Option 1: Custom runtime (recommended)
Choose `Custom Runtime on Amazon Linux 2023` and package the LLRT `bootstrap` binary together with your JS code.
### Option 2: Use a layer
Choose `Custom Runtime on Amazon Linux 2023`, upload `llrt-lambda-arm64.zip` or `llrt-lambda-x64.zip` as a layer and add to your function
### Option 3: Package LLRT in a container image
See our [AWS SAM example](./example/llrt-sam-container-image) or:
```dockerfile
FROM --platform=arm64 busybox
WORKDIR /var/task/
COPY app.mjs ./
ADD https://github.com/awslabs/llrt/releases/latest/download/llrt-container-arm64 /usr/bin/llrt
RUN chmod +x /usr/bin/llrt
ENV LAMBDA_HANDLER "app.handler"
CMD [ "llrt" ]
```
### Option 4: AWS SAM
The following [example project](example/llrt-sam/) sets up a lambda
instrumented with a layer containing the llrt runtime.
### Option 5: AWS CDK
You can use [`cdk-lambda-llrt` construct library](https://github.com/tmokmss/cdk-lambda-llrt) to deploy LLRT Lambda functions with AWS CDK.
```ts
import { LlrtFunction } from "cdk-lambda-llrt";
const handler = new LlrtFunction(this, "Handler", {
entry: "lambda/index.ts",
});
```
See [Construct Hub](https://constructs.dev/packages/cdk-lambda-llrt/) and [its examples](https://github.com/tmokmss/cdk-lambda-llrt/tree/main/example) for more details.
That's it 🎉
> [!IMPORTANT]
> Even though LLRT supports [ES2023](https://262.ecma-international.org/14.0/) it's **NOT** a drop in replacement for Node.js. Consult [Compatibility matrix](#compatibility-matrix) and [API](API.md) for more details.
> All dependencies should be bundled for a `browser` platform and mark included `@aws-sdk` packages as external.
## Testing & ensuring compatibility
The best way to ensure your code is compatible with LLRT is to write tests and execute them using the built-in test runner. The test runner currently supports Jest/Chai assertions. There are three main types of tests you can create:
Unit Tests
- Useful for validating specific modules and functions in isolation
- Allow focused testing of individual components
End-to-End (E2E) Tests
- Validate overall compatibility with AWS SDK and WinterTC compliance
- Test the integration between all components
- Confirm expected behavior from end-user perspective
- For more information about the E2E Tests and how to run them, see [here](tests/e2e/README.md).
Web Platform Tests (WPT)
- Useful for validating LLRT’s behavior against standardized browser APIs and runtime expectations
- Ensure compatibility with web standards and cross-runtime environments
- Help verify alignment with WinterTC and broader JavaScript ecosystem
- For setup instructions and how to run WPT in LLRT, see [here](tests/wpt/README.md).
### Test runner
Test runner uses a lightweight Jest-like API and supports Jest/Chai assertions. For examples on how to implement tests for LLRT see the `/tests` folder of this repository.
To run tests, execute the `llrt test` command. LLRT scans the current directory and sub-directories for files that ends with `*.test.js` or `*.test.mjs`. You can also provide a specific test directory to scan by using the `llrt test -d <directory>` option.
The test runner also has support for filters. Using filters is as simple as adding additional command line arguments, i.e: `llrt test crypto` will only run tests that match the filename containing `crypto`.
## Compatibility matrix
> [!NOTE]
> LLRT only support a fraction of the Node.js APIs. It is **NOT** a drop in replacement for Node.js, nor will it ever be. Below is a high level overview of partially supported APIs and modules. For more details consult the [API](API.md) documentation
| [Node.js API](https://nodejs.org/api/index.html) | Node.js | LLRT |
| ------------------------------------------------ | ------- | ----- |
| node:assert | ✔︎ | ✔︎️⚠️ |
| node:async_hooks | ✔︎ | ✔︎️⚠️ |
| node:buffer | ✔︎ | ✔︎️⚠️ |
| node:child_process | ✔︎ | ✔︎⚠️ |
| node:cluster | ✔︎ | ✘ |
| node:console | ✔︎ | ✔︎⚠️ |
| node:crypto | ✔︎ | ✔︎⚠️ |
| node:dgram | ✔︎ | ✘ |
| node:diagnostics_channel | ✔︎ | ✘ |
| node:dns | ✔︎ | ✔︎⚠️ |
| node:events | ✔︎ | ✔︎⚠️ |
| node:fs | ✔︎ | ✔︎⚠️ |
| node:fs/promises | ✔︎ | ✔︎⚠️ |
| node:http | ✔︎ | ✘⏱ |
| node:http2 | ✔︎ | ✘ |
| node:https | ✔︎ | ✘⏱ |
| node:inspector | ✔︎ | ✘ |
| node:inspector/promises | ✔︎ | ✘ |
| node:module | ✔︎ | ✔︎⚠️ |
| node:net | ✔︎ | ✔︎⚠️ |
| node:os | ✔︎ | ✔︎⚠️ |
| node:path | ✔︎ | ✔︎⚠️ |
| node:perf_hooks | ✔︎ | ✔︎⚠️ |
| node:process | ✔︎ | ✔︎⚠️ |
| node:querystring | ✔︎ | ✘ |
| node:readline | ✔︎ | ✘ |
| node:readline/promises | ✔︎ | ✘ |
| node:repl | ✔︎ | ✘ |
| node:sqlite | ✔︎ | ✘ |
| node:stream | ✔︎ | ✔︎\* |
| node:stream/promises | ✔︎ | ✔︎\* |
| node:stream/web | ✔︎ | ✔︎⚠️ |
| node:string_decoder | ✔︎ | ✔︎ |
| node:test | ✔︎ | ✘ |
| node:timers | ✔︎ | ✔︎⚠️ |
| node:tls | ✔︎ | ✘⏱ |
| node:tty | ✔︎ | ✔︎⚠️ |
| node:url | ✔︎ | ✔︎⚠️ |
| node:util | ✔︎ | ✔︎⚠️ |
| node:v8 | ✔︎ | ✘\*\* |
| node:vm | ✔︎ | ✘ |
| node:wasi | ✔︎ | ✘ |
| node:worker_threads | ✔︎ | ✘ |
| node:zlib | ✔︎ | ✔︎⚠️ |
| [LLRT API](https://github.com/awslabs/llrt/blob/main/API.md) | Node.js | LLRT |
| ------------------------------------------------------------ | ------- | ---- |
| llrt:hex | ✘ | ✔︎ |
| llrt:qjs | ✘ | ✔︎ |
| llrt:util | ✘ | ✔︎ |
| llrt:xml | ✘ | ✔︎ |
| [Web Platform API](https://min-common-api.proposal.wintertc.org/) | LLRT |
| ----------------------------------------------------------------- | ---- |
| COMPRESSION | ✘⏱ |
| CONSOLE | ✔︎⚠️ |
| DOM | ✔︎⚠️ |
| ECMASCRIPT | ✔︎⚠️ |
| ENCODING | ✔︎⚠️ |
| FETCH | ✔︎⚠️ |
| FILEAPI | ✔︎⚠️ |
| HR-TIME | ✔︎ |
| HTML | ✔︎⚠️ |
| STREAMS | ✔︎⚠️ |
| URL | ✔︎ |
| URLPATTERN | ✘⏱ |
| WASM-JS-API-2 | ✘ |
| WASM-WEB-API-2 | ✘ |
| WEBCRYPTO | ✔︎⚠️ |
| WEBIDL | ✔︎⚠️ |
| XHR | ✔︎⚠️ |
| Other features | LLRT |
| -------------- | ---- |
| async/await | ✔︎ |
| esm | ✔︎ |
| cjs | ✔︎ |
| Intl | ✔︎⚠️ |
| Temporal | ✔︎⚠️ |
_⚠️ = partially supported in LLRT_<br />
_⏱ = planned partial support_<br />
_\* = Not native_<br />
_\*\* = The `module.registerHooks()` API allows you to emulate some functionality. See also `example/register-hooks`._<br />
## Using node_modules (dependencies) with LLRT
Since LLRT is meant for performance critical application it's not recommended to deploy `node_modules` without bundling, minification and tree-shaking.
LLRT can work with any bundler of your choice. Below are some configurations for popular bundlers:
> [!WARNING]
> LLRT implements native modules that are largely compatible with the following external packages.
> By implementing the following conversions in the bundler's alias function, your application may be faster, but we recommend that you test thoroughly as they are not fully compatible.
| Node.js | LLRT |
| --------------- | -------- |
| fast-xml-parser | llrt:xml |
### ESBuild
```shell
esbuild index.js --platform=browser --target=es2023 --format=esm --bundle --minify --external:@aws-sdk --external:@smithy
```
### Rollup
```javascript
import resolve from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs";
import terser from "@rollup/plugin-terser";
export default {
input: "index.js",
output: {
file: "dist/bundle.js",
format: "esm",
sourcemap: true,
target: "es2023",
},
plugins: [resolve(), commonjs(), terser()],
external: ["@aws-sdk", "@smithy"],
};
```
### Webpack
```javascript
import TerserPlugin from "terser-webpack-plugin";
import nodeExternals from "webpack-node-externals";
export default {
entry: "./index.js",
output: {
path: "dist",
filename: "bundle.js",
libraryTarget: "module",
},
target: "web",
mode: "production",
resolve: {
extensions: [".js"],
},
externals: [nodeExternals(), "@aws-sdk", "@smithy"],
optimization: {
minimize: true,
minimizer: [
new TerserPlugin({
terserOptions: {
ecma: 2023,
},
}),
],
},
};
```
## Using AWS SDK (v3) with LLRT
LLRT includes many AWS SDK clients and utils as part of the runtime, built into the executable. These SDK Clients have been specifically fine-tuned to offer best performance while not compromising on compatibility. LLRT replaces some JavaScript dependencies used by the AWS SDK by native ones such as Hash calculations and XML parsing.
V3 SDK packages not included in the list below have to be bundled with your source code. For an example on how to use a non-included SDK, see [this example build script (buildExternalSdkFunction)](example/functions/build.mjs)
LLRT supports the following three bundles by default. Bundle types and suffixes are as follows.
| Bundle Type | Suffix | Purpose of Use |
| ----------- | ----------- | --------------------------------------------------------- |
| no-sdk | \*-no-sdk | Suitable for workloads that do not use `@aws-sdk`. |
| std-sdk | (none) | Suitable for workloads that utilize the major `@aws-sdk`. |
| full-sdk | \*-full-sdk | Suitable for workloads that utilize any `@aws-sdk`. |
The relationship between the supported packages for each bundle type is as follows.
| Analytics | no-sdk | std-sdk | full-sdk |
| ------------------------------------ | ------ | ------- | -------- |
| @aws-sdk/client-athena | | | ✔︎ |
| @aws-sdk/client-firehose | | | ✔︎ |
| @aws-sdk/client-glue | | | ✔︎ |
| @aws-sdk/client-kinesis | | | ✔︎ |
| @aws-sdk/client-opensearch | | | ✔︎ |
| @aws-sdk/client-opensearchserverless | | | ✔︎ |
| Application integration | no-sdk | std-sdk | full-sdk |
| --------------------------- | ------ | ------- | -------- |
| @aws-sdk/client-eventbridge | | ✔︎ | ✔︎ |
| @aws-sdk/client-scheduler | | | ✔︎ |
| @aws-sdk/client-sfn | | ✔︎ | ✔︎ |
| @aws-sdk/client-sns | | ✔︎ | ✔︎ |
| @aws-sdk/client-sqs | | ✔︎ | ✔︎ |
| Business applications | no-sdk | std-sdk | full-sdk |
| --------------------- | ------ | ------- | -------- |
| @aws-sdk/client-ses | | ✔︎ | ✔︎ |
| @aws-sdk/client-sesv2 | | | ✔︎ |
| Compute services | no-sdk | std-sdk | full-sdk |
| ---------------------------- | ------ | ------- | -------- |
| @aws-sdk/client-auto-scaling | | | ✔︎ |
| @aws-sdk/client-batch | | | ✔︎ |
| @aws-sdk/client-ec2 | | | ✔︎ |
| @aws-sdk/client-lambda | | | ✔︎ |
| Containers | no-sdk | std-sdk | full-sdk |
| -------------------------------- | ------ | ------- | -------- |
| @aws-sdk/client-ecr | | | ✔︎ |
| @aws-sdk/client-ecs | | | ✔︎ |
| @aws-sdk/client-eks | | | ✔︎ |
| @aws-sdk/client-servicediscovery | | | ✔︎ |
| Databases | no-sdk | std-sdk | full-sdk |
| -------------------------------- | ------ | ------- | -------- |
| @aws-sdk/client-dynamodb | | ✔︎ | ✔︎ |
| @aws-sdk/client-dynamodb-streams | | | ✔︎ |
| @aws-sdk/client-elasticache | | | ✔︎ |
| @aws-sdk/client-rds | | | ✔︎ |
| @aws-sdk/client-rds-data | | | ✔︎ |
| Developer tools | no-sdk | std-sdk | full-sdk |
| -------------------- | ------ | ------- | -------- |
| @aws-sdk/client-xray | | ✔︎ | ✔︎ |
| Front-end web and mobile services | no-sdk | std-sdk | full-sdk |
| --------------------------------- | ------ | ------- | -------- |
| @aws-sdk/client-amplify | | | ✔︎ |
| @aws-sdk/client-appsync | | | ✔︎ |
| @aws-sdk/client-location | | | ✔︎ |
| Machine Learning (ML) and Artificial Intelligence (AI) | no-sdk | std-sdk | full-sdk |
| ------------------------------------------------------ | ------ | ------- | -------- |
| @aws-sdk/client-bedrock | | | ✔︎ |
| @aws-sdk/client-bedrock-runtime | | | ✔︎ |
| @aws-sdk/client-bedrock-agent | | | ✔︎ |
| @aws-sdk/client-bedrock-agent-runtime | | | ✔︎ |
| @aws-sdk/client-polly | | | ✔︎ |
| @aws-sdk/client-rekognition | | | ✔︎ |
| @aws-sdk/client-textract | | | ✔︎ |
| @aws-sdk/client-translate | | | ✔︎ |
| Management and governance | no-sdk | std-sdk | full-sdk |
| --------------------------------- | ------ | ------- | -------- |
| @aws-sdk/client-appconfig | | | ✔︎ |
| @aws-sdk/client-appconfigdata | | | ✔︎ |
| @aws-sdk/client-cloudformation | | | ✔︎ |
| @aws-sdk/client-cloudwatch | | | ✔︎ |
| @aws-sdk/client-cloudwatch-events | | ✔︎ | ✔︎ |
| @aws-sdk/client-cloudwatch-logs | | ✔︎ | ✔︎ |
| @aws-sdk/client-service-catalog | | | ✔︎ |
| @aws-sdk/client-ssm | | ✔︎ | ✔︎ |
| Media | no-sdk | std-sdk | full-sdk |
| ---------------------------- | ------ | ------- | -------- |
| @aws-sdk/client-mediaconvert | | | ✔︎ |
| Networking and content delivery | no-sdk | std-sdk | full-sdk |
| ----------------------------------------- | ------ | ------- | -------- |
| @aws-sdk/client-api-gateway | | | ✔︎ |
| @aws-sdk/client-apigatewayv2 | | | ✔︎ |
| @aws-sdk/client-elastic-load-balancing-v2 | | | ✔︎ |
| Security, identity, and compliance | no-sdk | std-sdk | full-sdk |
| ----------------------------------------- | ------ | ------- | -------- |
| @aws-sdk/client-acm | | | ✔︎ |
| @aws-sdk/client-cognito-identity | | ✔︎ | ✔︎ |
| @aws-sdk/client-cognito-identity-provider | | ✔︎ | ✔︎ |
| @aws-sdk/client-iam | | | ✔︎ |
| @aws-sdk/client-kms | | ✔︎ | ✔︎ |
| @aws-sdk/client-secrets-manager | | ✔︎ | ✔︎ |
| @aws-sdk/client-sso | | | ✔︎ |
| @aws-sdk/client-sso-admin | | | ✔︎ |
| @aws-sdk/client-sso-oidc | | | ✔︎ |
| @aws-sdk/client-sts | | ✔︎ | ✔︎ |
| @aws-sdk/client-verifiedpermissions | | | ✔︎ |
| Storage | no-sdk | std-sdk | full-sdk |
| ------------------- | ------ | ------- | -------- |
| @aws-sdk/client-efs | | | ✔︎ |
| @aws-sdk/client-s3 | | ✔︎ | ✔︎ |
| Other bundled packages | no-sdk | std-sdk | full-sdk |
| -------------------------------- | ------ | ------- | -------- |
| @aws-crypto | | ✔︎ | ✔︎ |
| @aws-sdk/credential-providers | | ✔︎ | ✔︎ |
| @aws-sdk/lib-dynamodb | | ✔︎ | ✔︎ |
| @aws-sdk/lib-storage | | ✔︎ | ✔︎ |
| @aws-sdk/s3-presigned-post | | ✔︎ | ✔︎ |
| @aws-sdk/s3-request-presigner | | ✔︎ | ✔︎ |
| @aws-sdk/util-dynamodb | | ✔︎ | ✔︎ |
| @aws-sdk/util-user-agent-browser | | ✔︎ | ✔︎ |
| @smithy | | ✔︎ | ✔︎ |
> [!IMPORTANT]
> LLRT currently does not support returning streams from SDK responses. Use `response.Body.transformToString();` or `response.Body.transformToByteArray();` as shown below.
>
> ```javascript
> const response = await client.send(command);
> // or 'transformToByteArray()'
> const str = await response.Body.transformToString();
> ```
## Running TypeScript with LLRT
Same principle as dependencies applies when using TypeScript. TypeScript must be bundled and transpiled into ES2023 JavaScript.
> [!NOTE]
> LLRT will not support running TypeScript without transpilation. This is by design for performance reasons. Transpiling requires CPU and memory that adds latency and cost during execution. This can be avoided if done ahead of time during deployment.
## Rationale
What justifies the introduction of another JavaScript runtime in light of existing options such as [Node.js](https://nodejs.org/en), [Bun](https://bun.sh) & [Deno](https://deno.com/)?
Node.js, Bun, and Deno represent highly proficient JavaScript runtimes. However, they are designed with general-purpose applications in mind. These runtimes were not specifically tailored for the demands of a Serverless environment, characterized by short-lived runtime instances. They each depend on a ([Just-In-Time compiler (JIT)](https://en.wikipedia.org/wiki/Just-in-time_compilation) for dynamic code compilation and optimization during execution. While JIT compilation offers substantial long-term performance advantages, it carries a computational and memory overhead.
In contrast, LLRT distinguishes itself by not incorporating a JIT compiler, a strategic decision that yields two significant advantages:
A) JIT compilation is a notably sophisticated technological component, introducing increased system complexity and contributing substantially to the runtime's overall size.
B) Without the JIT overhead, LLRT conserves both CPU and memory resources that can be more efficiently allocated to code execution tasks, thereby reducing application startup times.
## Limitations
There are many cases where LLRT shows notable performance drawbacks compared with JIT-powered runtimes, such as large data processing, Monte Carlo simulations or performing tasks with hundreds of thousands or millions of iterations. LLRT is most effective when applied to smaller Serverless functions dedicated to tasks such as data transformation, real time processing, AWS service integrations, authorization, validation etc. It is designed to complement existing components rather than serve as a comprehensive replacement for everything. Notably, given its supported APIs are based on Node.js specification, transitioning back to alternative solutions requires minimal code adjustments.
## Building from source
1. Clone code and cd to directory
```
git clone git@github.com:awslabs/llrt.git
cd llrt
```
2. Install git submodules
```
git submodule update --init --checkout
```
3. Install rust
```
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y
source "$HOME/.cargo/env"
```
4. Install dependencies
```
# MacOS
brew install zig make cmake zstd node corepack
# Ubuntu
sudo apt -y install make zstd
sudo snap install zig --classic --beta
# Windows WSL2 (requires systemd to be enabled*)
sudo apt -y install cmake g++ gcc make zip zstd
sudo snap install zig --classic --beta
# Windows WSL2 (If Node.js is not yet installed)
sudo curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash
nvm install --lts
```
_\* See [Microsoft Devblogs](https://devblogs.microsoft.com/commandline/systemd-support-is-now-available-in-wsl/#how-can-you-get-systemd-on-your-machine)_
5. Install Node.js packages
```
corepack enable
yarn
```
6. Install generate libs and setup rust targets & toolchains
```
make stdlib && make libs
```
> [!NOTE]
> If these commands exit with an error that says `can't cd to zstd/lib`,
> you've not cloned this repository recursively. Run `git submodule update --init` to download the submodules and run the commands above again.
7. Build binaries for Lambda (Per bundle type and architecture desired)
```
# for arm64, use
make llrt-lambda-arm64.zip
make llrt-lambda-arm64-no-sdk.zip
make llrt-lambda-arm64-full-sdk.zip
# or for x86-64, use
make llrt-lambda-x64.zip
make llrt-lambda-x64-no-sdk.zip
make llrt-lambda-x64-full-sdk.zip
```
8. Build binaries for Container (Per bundle type and architecture desired)
```
# for arm64, use
make llrt-container-arm64
make llrt-container-arm64-no-sdk
make llrt-container-arm64-full-sdk
# or for x86-64, use
make llrt-container-x64
make llrt-container-x64-no-sdk
make llrt-container-x64-full-sdk
```
9. Optionally build for your local machine (Mac or Linux)
```
make release
make release-no-sdk
make release-full-sdk
```
You should now have a `llrt-lambda-arm64*.zip` or `llrt-lambda-x64*.zip`. You can manually upload this as a Lambda layer or use it via your Infrastructure-as-code pipeline
## Crypto and TLS Backend Options
LLRT supports multiple cryptographic backends for both the crypto module and TLS connections. These can be configured via Cargo features.
### Crypto Provider Features
| Feature | Description |
| ----------------------- | ----------------------------------------------------------------- |
| `crypto-rust` (default) | Pure Rust crypto using RustCrypto crates |
| `crypto-ring` | Ring-only crypto (limited algorithm support) |
| `crypto-ring-rust` | Ring for hashing/HMAC, RustCrypto for everything else |
| `crypto-graviola` | Graviola-only crypto (limited algorithm support) |
| `crypto-graviola-rust` | Graviola for hashing/HMAC/AES-GCM, RustCrypto for everything else |
| `crypto-openssl` | OpenSSL-based crypto |
### TLS Backend Features
| Feature | Description |
| -------------------- | --------------------------------------------- |
| `tls-ring` (default) | rustls with ring crypto |
| `tls-aws-lc` | rustls with AWS-LC crypto (optimized for AWS) |
| `tls-graviola` | rustls with graviola crypto |
| `tls-openssl` | OpenSSL for TLS |
### Building with Different Backends
```bash
# Default (crypto-rust + tls-ring)
cargo build --release
# Using AWS-LC for TLS
cargo build --release --no-default-features --features "macro,tls-aws-lc"
# Using OpenSSL for both crypto and TLS
cargo build --release --no-default-features --features "macro,crypto-openssl,tls-openssl"
# Using Graviola for both crypto and TLS
cargo build --release --no-default-features --features "macro,crypto-graviola-rust,tls-graviola"
```
## Running Lambda emulator
Please note that in order to run the example you will need:
- Valid AWS credentials via a `~/.aws/credentials` or via environment variables.
```bash
export AWS_ACCESS_KEY_ID=XXX
export AWS_SECRET_ACCESS_KEY=YYY
export AWS_REGION=us-east-1
```
- A DynamoDB table (with `id` as the partition key) on `us-east-1`
- The `dynamodb:PutItem` IAM permission on this table. You can use this policy (don't forget to modify <YOUR_ACCOUNT_ID>):
```json
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "putItem",
"Effect": "Allow",
"Action": "dynamodb:PutItem",
"Resource": "arn:aws:dynamodb:us-east-1:<YOUR_ACCOUNT_ID>:table/quickjs-table"
}
]
}
```
Start the `lambda-server.js` in a separate terminal
node lambda-server.js
Then run llrt:
make run
## Environment Variables
### `LLRT_ASYNC_HOOKS=value`
When using asynchronous hooks, the hooking function inside QuickJS is activated. This is disabled by default as there is concern that it may have a significant impact on performance.
By setting this environment variable to `1`, the asynchronous hook function can be enabled, allowing you to track asynchronous processing using the `async_hooks` module.
### `LLRT_EXTRA_CA_CERTS=file`
Load extra certificate authorities from a PEM encoded file
### `LLRT_GC_THRESHOLD_MB=value`
Set a memory threshold in MB for garbage collection. Default threshold is 20MB
### `LLRT_HTTP_VERSION=value`
Extends the HTTP request version. By default, only HTTP/1.1 is enabled. Specifying '2' will enable HTTP/1.1 and HTTP/2.
### `LLRT_LOG=[target][=][level][,...]`
Filter the log output by target module, level, or both (using `=`). Log levels are case-insensitive and will also enable any higher priority logs.
Log levels in descending priority order:
- `Error`
- `Warn | Warning`
- `Info`
- `Debug`
- `Trace`
Example filters:
- `warn` will enable all warning and error logs
- `llrt_core::vm=trace` will enable all logs in the `llrt_core::vm` module
- `warn,llrt_core::vm=trace` will enable all logs in the `llrt_core::vm` module and all warning and error logs in other modules
### `LLRT_NET_ALLOW="host[ ...]"`
Space-delimited list of hosts or socket paths which should be allowed for network connections. Network connections will be denied for any host or socket path missing from this list. Set an empty list to deny all connections
### `LLRT_NET_DENY="host[ ...]"`
Space-delimited list of hosts or socket paths which should be denied for network connections
### `LLRT_NET_POOL_IDLE_TIMEOUT=value`
Set a timeout in seconds for idle sockets being kept-alive. Default timeout is 15 seconds
### `LLRT_PLATFORM=value`
Used to explicitly specify a preferred platform for the Node.js package resolver. The default is `browser`. If `node` is specified, "node" takes precedence in the search path. If a value other than `browser` or `node` is specified, it will behave as if "browser" was specified.
### `LLRT_REGISTER_HOOKS=file`
If you want to enable a hooking mechanism that is mostly compatible with Node.js's `module.registerHooks()`, specify the js file name in this environment variable.
We provide a concrete example in `example/register-hooks`.
> [!NOTE]
> This environment variable is only effective when running on AWS Lambda.
> When using the LLRT CLI, hook files must be specified using the --import option instead of this environment variable.
### `LLRT_SDK_CONNECTION_WARMUP=1`
Initializes TLS connections in parallel during function init which significantly reduces cold starts due. Enabled by default, can be disabled with value `0` or `false`
### `LLRT_TLS_VERSION=value`
Set the TLS version to be used for network connections. By default only TLS 1.2 is enabled. TLS 1.3 can also be enabled by setting this variable to `1.3`
## Benchmark Methodology
Although Init Duration [reported by Lambda](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtime-environment.html) is commonly used to understand cold start impact on overall request latency, this metric does not include the time needed to copy code into the Lambda sandbox.
The technical definition of Init Duration ([source](https://docs.aws.amazon.com/lambda/latest/dg/nodejs-logging.html#node-logging-output)):
> For the first request served, the amount of time it took the runtime to load the function and run code outside of the handler method.
Measuring round-trip request duration provides a more complete picture of user facing cold-start latency.
Lambda invocation results (λ-labeled row) report the sum total of Init Duration + Function Duration.
## Security
See [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more information.
## License
This library is licensed under the Apache-2.0 License. See the [LICENSE](LICENSE) file.
================================================
FILE: THIRD_PARTY_LICENSES
================================================
** zstd; version zstd -- http://facebook.github.io/zstd/
Copyright (c) 2016-present, Facebook, Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name Facebook nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
------
** quickjs; version 2021-03-27 -- https://bellard.org/quickjs/
Copyright 2020 Fabrice Bellard and Charlie Gordon.
** rquickjs; version v0.4.0 -- https://github.com/DelSkayn/rquickjs
Copyright (c) 2020 Mees Delzenne
MIT License
Copyright (c) <year> <copyright holders>
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
------
** esbuild; version 0.19.12 -- github.com/evanw/esbuild
Copyright (c) 2020 Evan Wallace
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: benchmarks/v8-v7/README.txt
================================================
V8 Benchmark Suite
==================
This is the V8 benchmark suite: A collection of pure JavaScript
benchmarks that we have used to tune V8. The licenses for the
individual benchmarks are included in the JavaScript files.
In addition to the benchmarks, the suite consists of the benchmark
framework (base.js), which must be loaded before any of the individual
benchmark files, and two benchmark runners: An HTML version (run.html)
and a standalone JavaScript version (run.js).
Changes From Version 1 To Version 2
===================================
For version 2 the crypto benchmark was fixed. Previously, the
decryption stage was given plaintext as input, which resulted in an
error. Now, the decryption stage is given the output of the
encryption stage as input. The result is checked against the original
plaintext. For this to give the correct results the crypto objects
are reset for each iteration of the benchmark. In addition, the size
of the plain text has been increased a little and the use of
Math.random() and new Date() to build an RNG pool has been removed.
Other benchmarks were fixed to do elementary verification of the
results of their calculations. This is to avoid accidentally
obtaining scores that are the result of an incorrect JavaScript engine
optimization.
Changes From Version 2 To Version 3
===================================
Version 3 adds a new benchmark, RegExp. The RegExp benchmark is
generated by loading 50 of the most popular pages on the web and
logging all regexp operations performed. Each operation is given a
weight that is calculated from an estimate of the popularity of the
pages where it occurs and the number of times it is executed while
loading each page. Finally the literal letters in the data are
encoded using ROT13 in a way that does not affect how the regexps
match their input.
Changes from Version 3 to Version 4
===================================
The Splay benchmark is a newcomer in version 4. It manipulates a
splay tree by adding and removing data nodes, thus exercising the
memory management subsystem of the JavaScript engine.
Furthermore, all the unused parts of the Prototype library were
removed from the RayTrace benchmark. This does not affect the running
of the benchmark.
Changes from Version 4 to Version 5
===================================
Removed duplicate line in random seed code, and changed the name of
the Object.prototype.inherits function in the DeltaBlue benchmark to
inheritsFrom to avoid name clashes when running in Chromium with
extensions enabled.
Changes from Version 5 to Version 6
===================================
Removed dead code from the RayTrace benchmark and fixed a couple of
typos in the DeltaBlue implementation. Changed the Splay benchmark to
avoid converting the same numeric key to a string over and over again
and to avoid inserting and removing the same element repeatedly thus
increasing pressure on the memory subsystem. Changed the RegExp
benchmark to exercise the regular expression engine on different
input strings.
Furthermore, the benchmark runner was changed to run the benchmarks
for at least a few times to stabilize the reported numbers on slower
machines.
Changes from Version 6 to Version 7
===================================
Added the Navier-Stokes benchmark, a 2D differential equation solver
that stresses arithmetic computations on double arrays.
================================================
FILE: benchmarks/v8-v7/base.js
================================================
// Copyright 2012 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following
// disclaimer in the documentation and/or other materials provided
// with the distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Simple framework for running the benchmark suites and
// computing a score based on the timing measurements.
// A benchmark has a name (string) and a function that will be run to
// do the performance measurement. The optional setup and tearDown
// arguments are functions that will be invoked before and after
// running the benchmark, but the running time of these functions will
// not be accounted for in the benchmark score.
function Benchmark(name, run, setup, tearDown) {
this.name = name;
this.run = run;
this.Setup = setup ? setup : function () {};
this.TearDown = tearDown ? tearDown : function () {};
}
// Benchmark results hold the benchmark and the measured time used to
// run the benchmark. The benchmark score is computed later once a
// full benchmark suite has run to completion.
function BenchmarkResult(benchmark, time) {
this.benchmark = benchmark;
this.time = time;
}
// Automatically convert results to numbers. Used by the geometric
// mean computation.
BenchmarkResult.prototype.valueOf = function () {
return this.time;
};
// Suites of benchmarks consist of a name and the set of benchmarks in
// addition to the reference timing that the final score will be based
// on. This way, all scores are relative to a reference run and higher
// scores implies better performance.
function BenchmarkSuite(name, reference, benchmarks) {
this.name = name;
this.reference = reference;
this.benchmarks = benchmarks;
BenchmarkSuite.suites.push(this);
}
// Keep track of all declared benchmark suites.
BenchmarkSuite.suites = [];
// Scores are not comparable across versions. Bump the version if
// you're making changes that will affect that scores, e.g. if you add
// a new benchmark or change an existing one.
BenchmarkSuite.version = "7";
// To make the benchmark results predictable, we replace Math.random
// with a 100% deterministic alternative.
Math.random = (function () {
var seed = 49734321;
return function () {
// Robert Jenkins' 32 bit integer hash function.
seed = (seed + 0x7ed55d16 + (seed << 12)) & 0xffffffff;
seed = (seed ^ 0xc761c23c ^ (seed >>> 19)) & 0xffffffff;
seed = (seed + 0x165667b1 + (seed << 5)) & 0xffffffff;
seed = ((seed + 0xd3a2646c) ^ (seed << 9)) & 0xffffffff;
seed = (seed + 0xfd7046c5 + (seed << 3)) & 0xffffffff;
seed = (seed ^ 0xb55a4f09 ^ (seed >>> 16)) & 0xffffffff;
return (seed & 0xfffffff) / 0x10000000;
};
})();
// Runs all registered benchmark suites and optionally yields between
// each individual benchmark to avoid running for too long in the
// context of browsers. Once done, the final score is reported to the
// runner.
BenchmarkSuite.RunSuites = function (runner) {
var continuation = null;
var suites = BenchmarkSuite.suites;
var length = suites.length;
BenchmarkSuite.scores = [];
var index = 0;
function RunStep() {
while (continuation || index < length) {
if (continuation) {
continuation = continuation();
} else {
var suite = suites[index++];
if (runner.NotifyStart) runner.NotifyStart(suite.name);
continuation = suite.RunStep(runner);
}
if (continuation && typeof window != "undefined" && window.setTimeout) {
window.setTimeout(RunStep, 25);
return;
}
}
if (runner.NotifyScore) {
var score = BenchmarkSuite.GeometricMean(BenchmarkSuite.scores);
var formatted = BenchmarkSuite.FormatScore(100 * score);
runner.NotifyScore(formatted);
}
}
RunStep();
};
// Counts the total number of registered benchmarks. Useful for
// showing progress as a percentage.
BenchmarkSuite.CountBenchmarks = function () {
var result = 0;
var suites = BenchmarkSuite.suites;
for (var i = 0; i < suites.length; i++) {
result += suites[i].benchmarks.length;
}
return result;
};
// Computes the geometric mean of a set of numbers.
BenchmarkSuite.GeometricMean = function (numbers) {
var log = 0;
for (var i = 0; i < numbers.length; i++) {
log += Math.log(numbers[i]);
}
return Math.pow(Math.E, log / numbers.length);
};
// Converts a score value to a string with at least three significant
// digits.
BenchmarkSuite.FormatScore = function (value) {
if (value > 100) {
return value.toFixed(0);
} else {
return value.toPrecision(3);
}
};
// Notifies the runner that we're done running a single benchmark in
// the benchmark suite. This can be useful to report progress.
BenchmarkSuite.prototype.NotifyStep = function (result) {
this.results.push(result);
if (this.runner.NotifyStep) this.runner.NotifyStep(result.benchmark.name);
};
// Notifies the runner that we're done with running a suite and that
// we have a result which can be reported to the user if needed.
BenchmarkSuite.prototype.NotifyResult = function () {
var mean = BenchmarkSuite.GeometricMean(this.results);
var score = this.reference / mean;
BenchmarkSuite.scores.push(score);
if (this.runner.NotifyResult) {
var formatted = BenchmarkSuite.FormatScore(100 * score);
this.runner.NotifyResult(this.name, formatted);
}
};
// Notifies the runner that running a benchmark resulted in an error.
BenchmarkSuite.prototype.NotifyError = function (error) {
if (this.runner.NotifyError) {
this.runner.NotifyError(this.name, error);
}
if (this.runner.NotifyStep) {
this.runner.NotifyStep(this.name);
}
};
// Runs a single benchmark for at least a second and computes the
// average time it takes to run a single iteration.
BenchmarkSuite.prototype.RunSingleBenchmark = function (benchmark, data) {
function Measure(data) {
var elapsed = 0;
var start = new Date();
for (var n = 0; elapsed < 1000; n++) {
benchmark.run();
elapsed = new Date() - start;
}
if (data != null) {
data.runs += n;
data.elapsed += elapsed;
}
}
if (data == null) {
// Measure the benchmark once for warm up and throw the result
// away. Return a fresh data object.
Measure(null);
return { runs: 0, elapsed: 0 };
} else {
Measure(data);
// If we've run too few iterations, we continue for another second.
if (data.runs < 32) return data;
var usec = (data.elapsed * 1000) / data.runs;
this.NotifyStep(new BenchmarkResult(benchmark, usec));
return null;
}
};
// This function starts running a suite, but stops between each
// individual benchmark in the suite and returns a continuation
// function which can be invoked to run the next benchmark. Once the
// last benchmark has been executed, null is returned.
BenchmarkSuite.prototype.RunStep = function (runner) {
this.results = [];
this.runner = runner;
var length = this.benchmarks.length;
var index = 0;
var suite = this;
var data;
// Run the setup, the actual benchmark, and the tear down in three
// separate steps to allow the framework to yield between any of the
// steps.
function RunNextSetup() {
if (index < length) {
try {
suite.benchmarks[index].Setup();
} catch (e) {
suite.NotifyError(e);
return null;
}
return RunNextBenchmark;
}
suite.NotifyResult();
return null;
}
function RunNextBenchmark() {
try {
data = suite.RunSingleBenchmark(suite.benchmarks[index], data);
} catch (e) {
suite.NotifyError(e);
return null;
}
// If data is null, we're done with this benchmark.
return data == null ? RunNextTearDown : RunNextBenchmark();
}
function RunNextTearDown() {
try {
suite.benchmarks[index++].TearDown();
} catch (e) {
suite.NotifyError(e);
return null;
}
return RunNextSetup;
}
// Start out running the setup.
return RunNextSetup();
};
================================================
FILE: benchmarks/v8-v7/crypto.js
================================================
/*
* Copyright (c) 2003-2005 Tom Wu
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
*
* IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
* INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER
* RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF
* THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* In addition, the following condition applies:
*
* All redistributions must retain an intact copy of this copyright notice
* and disclaimer.
*/
// The code has been adapted for use as a benchmark by Google.
var Crypto = new BenchmarkSuite("Crypto", 266181, [
new Benchmark("Encrypt", encrypt),
new Benchmark("Decrypt", decrypt),
]);
// Basic JavaScript BN library - subset useful for RSA encryption.
// Bits per digit
var dbits;
var BI_DB;
var BI_DM;
var BI_DV;
var BI_FP;
var BI_FV;
var BI_F1;
var BI_F2;
// JavaScript engine analysis
var canary = 0xdeadbeefcafe;
var j_lm = (canary & 0xffffff) == 0xefcafe;
// (public) Constructor
function BigInteger(a, b, c) {
this.array = new Array();
if (a != null)
if ("number" == typeof a) this.fromNumber(a, b, c);
else if (b == null && "string" != typeof a) this.fromString(a, 256);
else this.fromString(a, b);
}
// return new, unset BigInteger
function nbi() {
return new BigInteger(null);
}
// am: Compute w_j += (x*this_i), propagate carries,
// c is initial carry, returns final carry.
// c < 3*dvalue, x < 2*dvalue, this_i < dvalue
// We need to select the fastest one that works in this environment.
// am1: use a single mult and divide to get the high bits,
// max digit bits should be 26 because
// max internal value = 2*dvalue^2-2*dvalue (< 2^53)
function am1(i, x, w, j, c, n) {
var this_array = this.array;
var w_array = w.array;
while (--n >= 0) {
var v = x * this_array[i++] + w_array[j] + c;
c = Math.floor(v / 0x4000000);
w_array[j++] = v & 0x3ffffff;
}
return c;
}
// am2 avoids a big mult-and-extract completely.
// Max digit bits should be <= 30 because we do bitwise ops
// on values up to 2*hdvalue^2-hdvalue-1 (< 2^31)
function am2(i, x, w, j, c, n) {
var this_array = this.array;
var w_array = w.array;
var xl = x & 0x7fff,
xh = x >> 15;
while (--n >= 0) {
var l = this_array[i] & 0x7fff;
var h = this_array[i++] >> 15;
var m = xh * l + h * xl;
l = xl * l + ((m & 0x7fff) << 15) + w_array[j] + (c & 0x3fffffff);
c = (l >>> 30) + (m >>> 15) + xh * h + (c >>> 30);
w_array[j++] = l & 0x3fffffff;
}
return c;
}
// Alternately, set max digit bits to 28 since some
// browsers slow down when dealing with 32-bit numbers.
function am3(i, x, w, j, c, n) {
var this_array = this.array;
var w_array = w.array;
var xl = x & 0x3fff,
xh = x >> 14;
while (--n >= 0) {
var l = this_array[i] & 0x3fff;
var h = this_array[i++] >> 14;
var m = xh * l + h * xl;
l = xl * l + ((m & 0x3fff) << 14) + w_array[j] + c;
c = (l >> 28) + (m >> 14) + xh * h;
w_array[j++] = l & 0xfffffff;
}
return c;
}
// This is tailored to VMs with 2-bit tagging. It makes sure
// that all the computations stay within the 29 bits available.
function am4(i, x, w, j, c, n) {
var this_array = this.array;
var w_array = w.array;
var xl = x & 0x1fff,
xh = x >> 13;
while (--n >= 0) {
var l = this_array[i] & 0x1fff;
var h = this_array[i++] >> 13;
var m = xh * l + h * xl;
l = xl * l + ((m & 0x1fff) << 13) + w_array[j] + c;
c = (l >> 26) + (m >> 13) + xh * h;
w_array[j++] = l & 0x3ffffff;
}
return c;
}
// am3/28 is best for SM, Rhino, but am4/26 is best for v8.
// Kestrel (Opera 9.5) gets its best result with am4/26.
// IE7 does 9% better with am3/28 than with am4/26.
// Firefox (SM) gets 10% faster with am3/28 than with am4/26.
setupEngine = function (fn, bits) {
BigInteger.prototype.am = fn;
dbits = bits;
BI_DB = dbits;
BI_DM = (1 << dbits) - 1;
BI_DV = 1 << dbits;
BI_FP = 52;
BI_FV = Math.pow(2, BI_FP);
BI_F1 = BI_FP - dbits;
BI_F2 = 2 * dbits - BI_FP;
};
// Digit conversions
var BI_RM = "0123456789abcdefghijklmnopqrstuvwxyz";
var BI_RC = new Array();
var rr, vv;
rr = "0".charCodeAt(0);
for (vv = 0; vv <= 9; ++vv) BI_RC[rr++] = vv;
rr = "a".charCodeAt(0);
for (vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv;
rr = "A".charCodeAt(0);
for (vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv;
function int2char(n) {
return BI_RM.charAt(n);
}
function intAt(s, i) {
var c = BI_RC[s.charCodeAt(i)];
return c == null ? -1 : c;
}
// (protected) copy this to r
function bnpCopyTo(r) {
var this_array = this.array;
var r_array = r.array;
for (var i = this.t - 1; i >= 0; --i) r_array[i] = this_array[i];
r.t = this.t;
r.s = this.s;
}
// (protected) set from integer value x, -DV <= x < DV
function bnpFromInt(x) {
var this_array = this.array;
this.t = 1;
this.s = x < 0 ? -1 : 0;
if (x > 0) this_array[0] = x;
else if (x < -1) this_array[0] = x + DV;
else this.t = 0;
}
// return bigint initialized to value
function nbv(i) {
var r = nbi();
r.fromInt(i);
return r;
}
// (protected) set from string and radix
function bnpFromString(s, b) {
var this_array = this.array;
var k;
if (b == 16) k = 4;
else if (b == 8) k = 3;
else if (b == 256)
k = 8; // byte array
else if (b == 2) k = 1;
else if (b == 32) k = 5;
else if (b == 4) k = 2;
else {
this.fromRadix(s, b);
return;
}
this.t = 0;
this.s = 0;
var i = s.length,
mi = false,
sh = 0;
while (--i >= 0) {
var x = k == 8 ? s[i] & 0xff : intAt(s, i);
if (x < 0) {
if (s.charAt(i) == "-") mi = true;
continue;
}
mi = false;
if (sh == 0) this_array[this.t++] = x;
else if (sh + k > BI_DB) {
this_array[this.t - 1] |= (x & ((1 << (BI_DB - sh)) - 1)) << sh;
this_array[this.t++] = x >> (BI_DB - sh);
} else this_array[this.t - 1] |= x << sh;
sh += k;
if (sh >= BI_DB) sh -= BI_DB;
}
if (k == 8 && (s[0] & 0x80) != 0) {
this.s = -1;
if (sh > 0) this_array[this.t - 1] |= ((1 << (BI_DB - sh)) - 1) << sh;
}
this.clamp();
if (mi) BigInteger.ZERO.subTo(this, this);
}
// (protected) clamp off excess high words
function bnpClamp() {
var this_array = this.array;
var c = this.s & BI_DM;
while (this.t > 0 && this_array[this.t - 1] == c) --this.t;
}
// (public) return string representation in given radix
function bnToString(b) {
var this_array = this.array;
if (this.s < 0) return "-" + this.negate().toString(b);
var k;
if (b == 16) k = 4;
else if (b == 8) k = 3;
else if (b == 2) k = 1;
else if (b == 32) k = 5;
else if (b == 4) k = 2;
else return this.toRadix(b);
var km = (1 << k) - 1,
d,
m = false,
r = "",
i = this.t;
var p = BI_DB - ((i * BI_DB) % k);
if (i-- > 0) {
if (p < BI_DB && (d = this_array[i] >> p) > 0) {
m = true;
r = int2char(d);
}
while (i >= 0) {
if (p < k) {
d = (this_array[i] & ((1 << p) - 1)) << (k - p);
d |= this_array[--i] >> (p += BI_DB - k);
} else {
d = (this_array[i] >> (p -= k)) & km;
if (p <= 0) {
p += BI_DB;
--i;
}
}
if (d > 0) m = true;
if (m) r += int2char(d);
}
}
return m ? r : "0";
}
// (public) -this
function bnNegate() {
var r = nbi();
BigInteger.ZERO.subTo(this, r);
return r;
}
// (public) |this|
function bnAbs() {
return this.s < 0 ? this.negate() : this;
}
// (public) return + if this > a, - if this < a, 0 if equal
function bnCompareTo(a) {
var this_array = this.array;
var a_array = a.array;
var r = this.s - a.s;
if (r != 0) return r;
var i = this.t;
r = i - a.t;
if (r != 0) return r;
while (--i >= 0) if ((r = this_array[i] - a_array[i]) != 0) return r;
return 0;
}
// returns bit length of the integer x
function nbits(x) {
var r = 1,
t;
if ((t = x >>> 16) != 0) {
x = t;
r += 16;
}
if ((t = x >> 8) != 0) {
x = t;
r += 8;
}
if ((t = x >> 4) != 0) {
x = t;
r += 4;
}
if ((t = x >> 2) != 0) {
x = t;
r += 2;
}
if ((t = x >> 1) != 0) {
x = t;
r += 1;
}
return r;
}
// (public) return the number of bits in "this"
function bnBitLength() {
var this_array = this.array;
if (this.t <= 0) return 0;
return (
BI_DB * (this.t - 1) + nbits(this_array[this.t - 1] ^ (this.s & BI_DM))
);
}
// (protected) r = this << n*DB
function bnpDLShiftTo(n, r) {
var this_array = this.array;
var r_array = r.array;
var i;
for (i = this.t - 1; i >= 0; --i) r_array[i + n] = this_array[i];
for (i = n - 1; i >= 0; --i) r_array[i] = 0;
r.t = this.t + n;
r.s = this.s;
}
// (protected) r = this >> n*DB
function bnpDRShiftTo(n, r) {
var this_array = this.array;
var r_array = r.array;
for (var i = n; i < this.t; ++i) r_array[i - n] = this_array[i];
r.t = Math.max(this.t - n, 0);
r.s = this.s;
}
// (protected) r = this << n
function bnpLShiftTo(n, r) {
var this_array = this.array;
var r_array = r.array;
var bs = n % BI_DB;
var cbs = BI_DB - bs;
var bm = (1 << cbs) - 1;
var ds = Math.floor(n / BI_DB),
c = (this.s << bs) & BI_DM,
i;
for (i = this.t - 1; i >= 0; --i) {
r_array[i + ds + 1] = (this_array[i] >> cbs) | c;
c = (this_array[i] & bm) << bs;
}
for (i = ds - 1; i >= 0; --i) r_array[i] = 0;
r_array[ds] = c;
r.t = this.t + ds + 1;
r.s = this.s;
r.clamp();
}
// (protected) r = this >> n
function bnpRShiftTo(n, r) {
var this_array = this.array;
var r_array = r.array;
r.s = this.s;
var ds = Math.floor(n / BI_DB);
if (ds >= this.t) {
r.t = 0;
return;
}
var bs = n % BI_DB;
var cbs = BI_DB - bs;
var bm = (1 << bs) - 1;
r_array[0] = this_array[ds] >> bs;
for (var i = ds + 1; i < this.t; ++i) {
r_array[i - ds - 1] |= (this_array[i] & bm) << cbs;
r_array[i - ds] = this_array[i] >> bs;
}
if (bs > 0) r_array[this.t - ds - 1] |= (this.s & bm) << cbs;
r.t = this.t - ds;
r.clamp();
}
// (protected) r = this - a
function bnpSubTo(a, r) {
var this_array = this.array;
var r_array = r.array;
var a_array = a.array;
var i = 0,
c = 0,
m = Math.min(a.t, this.t);
while (i < m) {
c += this_array[i] - a_array[i];
r_array[i++] = c & BI_DM;
c >>= BI_DB;
}
if (a.t < this.t) {
c -= a.s;
while (i < this.t) {
c += this_array[i];
r_array[i++] = c & BI_DM;
c >>= BI_DB;
}
c += this.s;
} else {
c += this.s;
while (i < a.t) {
c -= a_array[i];
r_array[i++] = c & BI_DM;
c >>= BI_DB;
}
c -= a.s;
}
r.s = c < 0 ? -1 : 0;
if (c < -1) r_array[i++] = BI_DV + c;
else if (c > 0) r_array[i++] = c;
r.t = i;
r.clamp();
}
// (protected) r = this * a, r != this,a (HAC 14.12)
// "this" should be the larger one if appropriate.
function bnpMultiplyTo(a, r) {
var this_array = this.array;
var r_array = r.array;
var x = this.abs(),
y = a.abs();
var y_array = y.array;
var i = x.t;
r.t = i + y.t;
while (--i >= 0) r_array[i] = 0;
for (i = 0; i < y.t; ++i)
r_array[i + x.t] = x.am(0, y_array[i], r, i, 0, x.t);
r.s = 0;
r.clamp();
if (this.s != a.s) BigInteger.ZERO.subTo(r, r);
}
// (protected) r = this^2, r != this (HAC 14.16)
function bnpSquareTo(r) {
var x = this.abs();
var x_array = x.array;
var r_array = r.array;
var i = (r.t = 2 * x.t);
while (--i >= 0) r_array[i] = 0;
for (i = 0; i < x.t - 1; ++i) {
var c = x.am(i, x_array[i], r, 2 * i, 0, 1);
if (
(r_array[i + x.t] += x.am(
i + 1,
2 * x_array[i],
r,
2 * i + 1,
c,
x.t - i - 1
)) >= BI_DV
) {
r_array[i + x.t] -= BI_DV;
r_array[i + x.t + 1] = 1;
}
}
if (r.t > 0) r_array[r.t - 1] += x.am(i, x_array[i], r, 2 * i, 0, 1);
r.s = 0;
r.clamp();
}
// (protected) divide this by m, quotient and remainder to q, r (HAC 14.20)
// r != q, this != m. q or r may be null.
function bnpDivRemTo(m, q, r) {
var pm = m.abs();
if (pm.t <= 0) return;
var pt = this.abs();
if (pt.t < pm.t) {
if (q != null) q.fromInt(0);
if (r != null) this.copyTo(r);
return;
}
if (r == null) r = nbi();
var y = nbi(),
ts = this.s,
ms = m.s;
var pm_array = pm.array;
var nsh = BI_DB - nbits(pm_array[pm.t - 1]); // normalize modulus
if (nsh > 0) {
pm.lShiftTo(nsh, y);
pt.lShiftTo(nsh, r);
} else {
pm.copyTo(y);
pt.copyTo(r);
}
var ys = y.t;
var y_array = y.array;
var y0 = y_array[ys - 1];
if (y0 == 0) return;
var yt = y0 * (1 << BI_F1) + (ys > 1 ? y_array[ys - 2] >> BI_F2 : 0);
var d1 = BI_FV / yt,
d2 = (1 << BI_F1) / yt,
e = 1 << BI_F2;
var i = r.t,
j = i - ys,
t = q == null ? nbi() : q;
y.dlShiftTo(j, t);
var r_array = r.array;
if (r.compareTo(t) >= 0) {
r_array[r.t++] = 1;
r.subTo(t, r);
}
BigInteger.ONE.dlShiftTo(ys, t);
t.subTo(y, y); // "negative" y so we can replace sub with am later
while (y.t < ys) y_array[y.t++] = 0;
while (--j >= 0) {
// Estimate quotient digit
var qd =
r_array[--i] == y0
? BI_DM
: Math.floor(r_array[i] * d1 + (r_array[i - 1] + e) * d2);
if ((r_array[i] += y.am(0, qd, r, j, 0, ys)) < qd) {
// Try it out
y.dlShiftTo(j, t);
r.subTo(t, r);
while (r_array[i] < --qd) r.subTo(t, r);
}
}
if (q != null) {
r.drShiftTo(ys, q);
if (ts != ms) BigInteger.ZERO.subTo(q, q);
}
r.t = ys;
r.clamp();
if (nsh > 0) r.rShiftTo(nsh, r); // Denormalize remainder
if (ts < 0) BigInteger.ZERO.subTo(r, r);
}
// (public) this mod a
function bnMod(a) {
var r = nbi();
this.abs().divRemTo(a, null, r);
if (this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r, r);
return r;
}
// Modular reduction using "classic" algorithm
function Classic(m) {
this.m = m;
}
function cConvert(x) {
if (x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m);
else return x;
}
function cRevert(x) {
return x;
}
function cReduce(x) {
x.divRemTo(this.m, null, x);
}
function cMulTo(x, y, r) {
x.multiplyTo(y, r);
this.reduce(r);
}
function cSqrTo(x, r) {
x.squareTo(r);
this.reduce(r);
}
Classic.prototype.convert = cConvert;
Classic.prototype.revert = cRevert;
Classic.prototype.reduce = cReduce;
Classic.prototype.mulTo = cMulTo;
Classic.prototype.sqrTo = cSqrTo;
// (protected) return "-1/this % 2^DB"; useful for Mont. reduction
// justification:
// xy == 1 (mod m)
// xy = 1+km
// xy(2-xy) = (1+km)(1-km)
// x[y(2-xy)] = 1-k^2m^2
// x[y(2-xy)] == 1 (mod m^2)
// if y is 1/x mod m, then y(2-xy) is 1/x mod m^2
// should reduce x and y(2-xy) by m^2 at each step to keep size bounded.
// JS multiply "overflows" differently from C/C++, so care is needed here.
function bnpInvDigit() {
var this_array = this.array;
if (this.t < 1) return 0;
var x = this_array[0];
if ((x & 1) == 0) return 0;
var y = x & 3; // y == 1/x mod 2^2
y = (y * (2 - (x & 0xf) * y)) & 0xf; // y == 1/x mod 2^4
y = (y * (2 - (x & 0xff) * y)) & 0xff; // y == 1/x mod 2^8
y = (y * (2 - (((x & 0xffff) * y) & 0xffff))) & 0xffff; // y == 1/x mod 2^16
// last step - calculate inverse mod DV directly;
// assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints
y = (y * (2 - ((x * y) % BI_DV))) % BI_DV; // y == 1/x mod 2^dbits
// we really want the negative inverse, and -DV < y < DV
return y > 0 ? BI_DV - y : -y;
}
// Montgomery reduction
function Montgomery(m) {
this.m = m;
this.mp = m.invDigit();
this.mpl = this.mp & 0x7fff;
this.mph = this.mp >> 15;
this.um = (1 << (BI_DB - 15)) - 1;
this.mt2 = 2 * m.t;
}
// xR mod m
function montConvert(x) {
var r = nbi();
x.abs().dlShiftTo(this.m.t, r);
r.divRemTo(this.m, null, r);
if (x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r, r);
return r;
}
// x/R mod m
function montRevert(x) {
var r = nbi();
x.copyTo(r);
this.reduce(r);
return r;
}
// x = x/R mod m (HAC 14.32)
function montReduce(x) {
var x_array = x.array;
while (x.t <= this.mt2)
// pad x so am has enough room later
x_array[x.t++] = 0;
for (var i = 0; i < this.m.t; ++i) {
// faster way of calculating u0 = x[i]*mp mod DV
var j = x_array[i] & 0x7fff;
var u0 =
(j * this.mpl +
(((j * this.mph + (x_array[i] >> 15) * this.mpl) & this.um) << 15)) &
BI_DM;
// use am to combine the multiply-shift-add into one call
j = i + this.m.t;
x_array[j] += this.m.am(0, u0, x, i, 0, this.m.t);
// propagate carry
while (x_array[j] >= BI_DV) {
x_array[j] -= BI_DV;
x_array[++j]++;
}
}
x.clamp();
x.drShiftTo(this.m.t, x);
if (x.compareTo(this.m) >= 0) x.subTo(this.m, x);
}
// r = "x^2/R mod m"; x != r
function montSqrTo(x, r) {
x.squareTo(r);
this.reduce(r);
}
// r = "xy/R mod m"; x,y != r
function montMulTo(x, y, r) {
x.multiplyTo(y, r);
this.reduce(r);
}
Montgomery.prototype.convert = montConvert;
Montgomery.prototype.revert = montRevert;
Montgomery.prototype.reduce = montReduce;
Montgomery.prototype.mulTo = montMulTo;
Montgomery.prototype.sqrTo = montSqrTo;
// (protected) true iff this is even
function bnpIsEven() {
var this_array = this.array;
return (this.t > 0 ? this_array[0] & 1 : this.s) == 0;
}
// (protected) this^e, e < 2^32, doing sqr and mul with "r" (HAC 14.79)
function bnpExp(e, z) {
if (e > 0xffffffff || e < 1) return BigInteger.ONE;
var r = nbi(),
r2 = nbi(),
g = z.convert(this),
i = nbits(e) - 1;
g.copyTo(r);
while (--i >= 0) {
z.sqrTo(r, r2);
if ((e & (1 << i)) > 0) z.mulTo(r2, g, r);
else {
var t = r;
r = r2;
r2 = t;
}
}
return z.revert(r);
}
// (public) this^e % m, 0 <= e < 2^32
function bnModPowInt(e, m) {
var z;
if (e < 256 || m.isEven()) z = new Classic(m);
else z = new Montgomery(m);
return this.exp(e, z);
}
// protected
BigInteger.prototype.copyTo = bnpCopyTo;
BigInteger.prototype.fromInt = bnpFromInt;
BigInteger.prototype.fromString = bnpFromString;
BigInteger.prototype.clamp = bnpClamp;
BigInteger.prototype.dlShiftTo = bnpDLShiftTo;
BigInteger.prototype.drShiftTo = bnpDRShiftTo;
BigInteger.prototype.lShiftTo = bnpLShiftTo;
BigInteger.prototype.rShiftTo = bnpRShiftTo;
BigInteger.prototype.subTo = bnpSubTo;
BigInteger.prototype.multiplyTo = bnpMultiplyTo;
BigInteger.prototype.squareTo = bnpSquareTo;
BigInteger.prototype.divRemTo = bnpDivRemTo;
BigInteger.prototype.invDigit = bnpInvDigit;
BigInteger.prototype.isEven = bnpIsEven;
BigInteger.prototype.exp = bnpExp;
// public
BigInteger.prototype.toString = bnToString;
BigInteger.prototype.negate = bnNegate;
BigInteger.prototype.abs = bnAbs;
BigInteger.prototype.compareTo = bnCompareTo;
BigInteger.prototype.bitLength = bnBitLength;
BigInteger.prototype.mod = bnMod;
BigInteger.prototype.modPowInt = bnModPowInt;
// "constants"
BigInteger.ZERO = nbv(0);
BigInteger.ONE = nbv(1);
// Copyright (c) 2005 Tom Wu
// All Rights Reserved.
// See "LICENSE" for details.
// Extended JavaScript BN functions, required for RSA private ops.
// (public)
function bnClone() {
var r = nbi();
this.copyTo(r);
return r;
}
// (public) return value as integer
function bnIntValue() {
var this_array = this.array;
if (this.s < 0) {
if (this.t == 1) return this_array[0] - BI_DV;
else if (this.t == 0) return -1;
} else if (this.t == 1) return this_array[0];
else if (this.t == 0) return 0;
// assumes 16 < DB < 32
return ((this_array[1] & ((1 << (32 - BI_DB)) - 1)) << BI_DB) | this_array[0];
}
// (public) return value as byte
function bnByteValue() {
var this_array = this.array;
return this.t == 0 ? this.s : (this_array[0] << 24) >> 24;
}
// (public) return value as short (assumes DB>=16)
function bnShortValue() {
var this_array = this.array;
return this.t == 0 ? this.s : (this_array[0] << 16) >> 16;
}
// (protected) return x s.t. r^x < DV
function bnpChunkSize(r) {
return Math.floor((Math.LN2 * BI_DB) / Math.log(r));
}
// (public) 0 if this == 0, 1 if this > 0
function bnSigNum() {
var this_array = this.array;
if (this.s < 0) return -1;
else if (this.t <= 0 || (this.t == 1 && this_array[0] <= 0)) return 0;
else return 1;
}
// (protected) convert to radix string
function bnpToRadix(b) {
if (b == null) b = 10;
if (this.signum() == 0 || b < 2 || b > 36) return "0";
var cs = this.chunkSize(b);
var a = Math.pow(b, cs);
var d = nbv(a),
y = nbi(),
z = nbi(),
r = "";
this.divRemTo(d, y, z);
while (y.signum() > 0) {
r = (a + z.intValue()).toString(b).substr(1) + r;
y.divRemTo(d, y, z);
}
return z.intValue().toString(b) + r;
}
// (protected) convert from radix string
function bnpFromRadix(s, b) {
this.fromInt(0);
if (b == null) b = 10;
var cs = this.chunkSize(b);
var d = Math.pow(b, cs),
mi = false,
j = 0,
w = 0;
for (var i = 0; i < s.length; ++i) {
var x = intAt(s, i);
if (x < 0) {
if (s.charAt(i) == "-" && this.signum() == 0) mi = true;
continue;
}
w = b * w + x;
if (++j >= cs) {
this.dMultiply(d);
this.dAddOffset(w, 0);
j = 0;
w = 0;
}
}
if (j > 0) {
this.dMultiply(Math.pow(b, j));
this.dAddOffset(w, 0);
}
if (mi) BigInteger.ZERO.subTo(this, this);
}
// (protected) alternate constructor
function bnpFromNumber(a, b, c) {
if ("number" == typeof b) {
// new BigInteger(int,int,RNG)
if (a < 2) this.fromInt(1);
else {
this.fromNumber(a, c);
if (!this.testBit(a - 1))
// force MSB set
this.bitwiseTo(BigInteger.ONE.shiftLeft(a - 1), op_or, this);
if (this.isEven()) this.dAddOffset(1, 0); // force odd
while (!this.isProbablePrime(b)) {
this.dAddOffset(2, 0);
if (this.bitLength() > a)
this.subTo(BigInteger.ONE.shiftLeft(a - 1), this);
}
}
} else {
// new BigInteger(int,RNG)
var x = new Array(),
t = a & 7;
x.length = (a >> 3) + 1;
b.nextBytes(x);
if (t > 0) x[0] &= (1 << t) - 1;
else x[0] = 0;
this.fromString(x, 256);
}
}
// (public) convert to bigendian byte array
function bnToByteArray() {
var this_array = this.array;
var i = this.t,
r = new Array();
r[0] = this.s;
var p = BI_DB - ((i * BI_DB) % 8),
d,
k = 0;
if (i-- > 0) {
if (p < BI_DB && (d = this_array[i] >> p) != (this.s & BI_DM) >> p)
r[k++] = d | (this.s << (BI_DB - p));
while (i >= 0) {
if (p < 8) {
d = (this_array[i] & ((1 << p) - 1)) << (8 - p);
d |= this_array[--i] >> (p += BI_DB - 8);
} else {
d = (this_array[i] >> (p -= 8)) & 0xff;
if (p <= 0) {
p += BI_DB;
--i;
}
}
if ((d & 0x80) != 0) d |= -256;
if (k == 0 && (this.s & 0x80) != (d & 0x80)) ++k;
if (k > 0 || d != this.s) r[k++] = d;
}
}
return r;
}
function bnEquals(a) {
return this.compareTo(a) == 0;
}
function bnMin(a) {
return this.compareTo(a) < 0 ? this : a;
}
function bnMax(a) {
return this.compareTo(a) > 0 ? this : a;
}
// (protected) r = this op a (bitwise)
function bnpBitwiseTo(a, op, r) {
var this_array = this.array;
var a_array = a.array;
var r_array = r.array;
var i,
f,
m = Math.min(a.t, this.t);
for (i = 0; i < m; ++i) r_array[i] = op(this_array[i], a_array[i]);
if (a.t < this.t) {
f = a.s & BI_DM;
for (i = m; i < this.t; ++i) r_array[i] = op(this_array[i], f);
r.t = this.t;
} else {
f = this.s & BI_DM;
for (i = m; i < a.t; ++i) r_array[i] = op(f, a_array[i]);
r.t = a.t;
}
r.s = op(this.s, a.s);
r.clamp();
}
// (public) this & a
function op_and(x, y) {
return x & y;
}
function bnAnd(a) {
var r = nbi();
this.bitwiseTo(a, op_and, r);
return r;
}
// (public) this | a
function op_or(x, y) {
return x | y;
}
function bnOr(a) {
var r = nbi();
this.bitwiseTo(a, op_or, r);
return r;
}
// (public) this ^ a
function op_xor(x, y) {
return x ^ y;
}
function bnXor(a) {
var r = nbi();
this.bitwiseTo(a, op_xor, r);
return r;
}
// (public) this & ~a
function op_andnot(x, y) {
return x & ~y;
}
function bnAndNot(a) {
var r = nbi();
this.bitwiseTo(a, op_andnot, r);
return r;
}
// (public) ~this
function bnNot() {
var this_array = this.array;
var r = nbi();
var r_array = r.array;
for (var i = 0; i < this.t; ++i) r_array[i] = BI_DM & ~this_array[i];
r.t = this.t;
r.s = ~this.s;
return r;
}
// (public) this << n
function bnShiftLeft(n) {
var r = nbi();
if (n < 0) this.rShiftTo(-n, r);
else this.lShiftTo(n, r);
return r;
}
// (public) this >> n
function bnShiftRight(n) {
var r = nbi();
if (n < 0) this.lShiftTo(-n, r);
else this.rShiftTo(n, r);
return r;
}
// return index of lowest 1-bit in x, x < 2^31
function lbit(x) {
if (x == 0) return -1;
var r = 0;
if ((x & 0xffff) == 0) {
x >>= 16;
r += 16;
}
if ((x & 0xff) == 0) {
x >>= 8;
r += 8;
}
if ((x & 0xf) == 0) {
x >>= 4;
r += 4;
}
if ((x & 3) == 0) {
x >>= 2;
r += 2;
}
if ((x & 1) == 0) ++r;
return r;
}
// (public) returns index of lowest 1-bit (or -1 if none)
function bnGetLowestSetBit() {
var this_array = this.array;
for (var i = 0; i < this.t; ++i)
if (this_array[i] != 0) return i * BI_DB + lbit(this_array[i]);
if (this.s < 0) return this.t * BI_DB;
return -1;
}
// return number of 1 bits in x
function cbit(x) {
var r = 0;
while (x != 0) {
x &= x - 1;
++r;
}
return r;
}
// (public) return number of set bits
function bnBitCount() {
var r = 0,
x = this.s & BI_DM;
for (var i = 0; i < this.t; ++i) r += cbit(this_array[i] ^ x);
return r;
}
// (public) true iff nth bit is set
function bnTestBit(n) {
var this_array = this.array;
var j = Math.floor(n / BI_DB);
if (j >= this.t) return this.s != 0;
return (this_array[j] & (1 << n % BI_DB)) != 0;
}
// (protected) this op (1<<n)
function bnpChangeBit(n, op) {
var r = BigInteger.ONE.shiftLeft(n);
this.bitwiseTo(r, op, r);
return r;
}
// (public) this | (1<<n)
function bnSetBit(n) {
return this.changeBit(n, op_or);
}
// (public) this & ~(1<<n)
function bnClearBit(n) {
return this.changeBit(n, op_andnot);
}
// (public) this ^ (1<<n)
function bnFlipBit(n) {
return this.changeBit(n, op_xor);
}
// (protected) r = this + a
function bnpAddTo(a, r) {
var this_array = this.array;
var a_array = a.array;
var r_array = r.array;
var i = 0,
c = 0,
m = Math.min(a.t, this.t);
while (i < m) {
c += this_array[i] + a_array[i];
r_array[i++] = c & BI_DM;
c >>= BI_DB;
}
if (a.t < this.t) {
c += a.s;
while (i < this.t) {
c += this_array[i];
r_array[i++] = c & BI_DM;
c >>= BI_DB;
}
c += this.s;
} else {
c += this.s;
while (i < a.t) {
c += a_array[i];
r_array[i++] = c & BI_DM;
c >>= BI_DB;
}
c += a.s;
}
r.s = c < 0 ? -1 : 0;
if (c > 0) r_array[i++] = c;
else if (c < -1) r_array[i++] = BI_DV + c;
r.t = i;
r.clamp();
}
// (public) this + a
function bnAdd(a) {
var r = nbi();
this.addTo(a, r);
return r;
}
// (public) this - a
function bnSubtract(a) {
var r = nbi();
this.subTo(a, r);
return r;
}
// (public) this * a
function bnMultiply(a) {
var r = nbi();
this.multiplyTo(a, r);
return r;
}
// (public) this / a
function bnDivide(a) {
var r = nbi();
this.divRemTo(a, r, null);
return r;
}
// (public) this % a
function bnRemainder(a) {
var r = nbi();
this.divRemTo(a, null, r);
return r;
}
// (public) [this/a,this%a]
function bnDivideAndRemainder(a) {
var q = nbi(),
r = nbi();
this.divRemTo(a, q, r);
return new Array(q, r);
}
// (protected) this *= n, this >= 0, 1 < n < DV
function bnpDMultiply(n) {
var this_array = this.array;
this_array[this.t] = this.am(0, n - 1, this, 0, 0, this.t);
++this.t;
this.clamp();
}
// (protected) this += n << w words, this >= 0
function bnpDAddOffset(n, w) {
var this_array = this.array;
while (this.t <= w) this_array[this.t++] = 0;
this_array[w] += n;
while (this_array[w] >= BI_DV) {
this_array[w] -= BI_DV;
if (++w >= this.t) this_array[this.t++] = 0;
++this_array[w];
}
}
// A "null" reducer
function NullExp() {}
function nNop(x) {
return x;
}
function nMulTo(x, y, r) {
x.multiplyTo(y, r);
}
function nSqrTo(x, r) {
x.squareTo(r);
}
NullExp.prototype.convert = nNop;
NullExp.prototype.revert = nNop;
NullExp.prototype.mulTo = nMulTo;
NullExp.prototype.sqrTo = nSqrTo;
// (public) this^e
function bnPow(e) {
return this.exp(e, new NullExp());
}
// (protected) r = lower n words of "this * a", a.t <= n
// "this" should be the larger one if appropriate.
function bnpMultiplyLowerTo(a, n, r) {
var r_array = r.array;
var a_array = a.array;
var i = Math.min(this.t + a.t, n);
r.s = 0; // assumes a,this >= 0
r.t = i;
while (i > 0) r_array[--i] = 0;
var j;
for (j = r.t - this.t; i < j; ++i)
r_array[i + this.t] = this.am(0, a_array[i], r, i, 0, this.t);
for (j = Math.min(a.t, n); i < j; ++i) this.am(0, a_array[i], r, i, 0, n - i);
r.clamp();
}
// (protected) r = "this * a" without lower n words, n > 0
// "this" should be the larger one if appropriate.
function bnpMultiplyUpperTo(a, n, r) {
var r_array = r.array;
var a_array = a.array;
--n;
var i = (r.t = this.t + a.t - n);
r.s = 0; // assumes a,this >= 0
while (--i >= 0) r_array[i] = 0;
for (i = Math.max(n - this.t, 0); i < a.t; ++i)
r_array[this.t + i - n] = this.am(
n - i,
a_array[i],
r,
0,
0,
this.t + i - n
);
r.clamp();
r.drShiftTo(1, r);
}
// Barrett modular reduction
function Barrett(m) {
// setup Barrett
this.r2 = nbi();
this.q3 = nbi();
BigInteger.ONE.dlShiftTo(2 * m.t, this.r2);
this.mu = this.r2.divide(m);
this.m = m;
}
function barrettConvert(x) {
if (x.s < 0 || x.t > 2 * this.m.t) return x.mod(this.m);
else if (x.compareTo(this.m) < 0) return x;
else {
var r = nbi();
x.copyTo(r);
this.reduce(r);
return r;
}
}
function barrettRevert(x) {
return x;
}
// x = x mod m (HAC 14.42)
function barrettReduce(x) {
x.drShiftTo(this.m.t - 1, this.r2);
if (x.t > this.m.t + 1) {
x.t = this.m.t + 1;
x.clamp();
}
this.mu.multiplyUpperTo(this.r2, this.m.t + 1, this.q3);
this.m.multiplyLowerTo(this.q3, this.m.t + 1, this.r2);
while (x.compareTo(this.r2) < 0) x.dAddOffset(1, this.m.t + 1);
x.subTo(this.r2, x);
while (x.compareTo(this.m) >= 0) x.subTo(this.m, x);
}
// r = x^2 mod m; x != r
function barrettSqrTo(x, r) {
x.squareTo(r);
this.reduce(r);
}
// r = x*y mod m; x,y != r
function barrettMulTo(x, y, r) {
x.multiplyTo(y, r);
this.reduce(r);
}
Barrett.prototype.convert = barrettConvert;
Barrett.prototype.revert = barrettRevert;
Barrett.prototype.reduce = barrettReduce;
Barrett.prototype.mulTo = barrettMulTo;
Barrett.prototype.sqrTo = barrettSqrTo;
// (public) this^e % m (HAC 14.85)
function bnModPow(e, m) {
var e_array = e.array;
var i = e.bitLength(),
k,
r = nbv(1),
z;
if (i <= 0) return r;
else if (i < 18) k = 1;
else if (i < 48) k = 3;
else if (i < 144) k = 4;
else if (i < 768) k = 5;
else k = 6;
if (i < 8) z = new Classic(m);
else if (m.isEven()) z = new Barrett(m);
else z = new Montgomery(m);
// precomputation
var g = new Array(),
n = 3,
k1 = k - 1,
km = (1 << k) - 1;
g[1] = z.convert(this);
if (k > 1) {
var g2 = nbi();
z.sqrTo(g[1], g2);
while (n <= km) {
g[n] = nbi();
z.mulTo(g2, g[n - 2], g[n]);
n += 2;
}
}
var j = e.t - 1,
w,
is1 = true,
r2 = nbi(),
t;
i = nbits(e_array[j]) - 1;
while (j >= 0) {
if (i >= k1) w = (e_array[j] >> (i - k1)) & km;
else {
w = (e_array[j] & ((1 << (i + 1)) - 1)) << (k1 - i);
if (j > 0) w |= e_array[j - 1] >> (BI_DB + i - k1);
}
n = k;
while ((w & 1) == 0) {
w >>= 1;
--n;
}
if ((i -= n) < 0) {
i += BI_DB;
--j;
}
if (is1) {
// ret == 1, don't bother squaring or multiplying it
g[w].copyTo(r);
is1 = false;
} else {
while (n > 1) {
z.sqrTo(r, r2);
z.sqrTo(r2, r);
n -= 2;
}
if (n > 0) z.sqrTo(r, r2);
else {
t = r;
r = r2;
r2 = t;
}
z.mulTo(r2, g[w], r);
}
while (j >= 0 && (e_array[j] & (1 << i)) == 0) {
z.sqrTo(r, r2);
t = r;
r = r2;
r2 = t;
if (--i < 0) {
i = BI_DB - 1;
--j;
}
}
}
return z.revert(r);
}
// (public) gcd(this,a) (HAC 14.54)
function bnGCD(a) {
var x = this.s < 0 ? this.negate() : this.clone();
var y = a.s < 0 ? a.negate() : a.clone();
if (x.compareTo(y) < 0) {
var t = x;
x = y;
y = t;
}
var i = x.getLowestSetBit(),
g = y.getLowestSetBit();
if (g < 0) return x;
if (i < g) g = i;
if (g > 0) {
x.rShiftTo(g, x);
y.rShiftTo(g, y);
}
while (x.signum() > 0) {
if ((i = x.getLowestSetBit()) > 0) x.rShiftTo(i, x);
if ((i = y.getLowestSetBit()) > 0) y.rShiftTo(i, y);
if (x.compareTo(y) >= 0) {
x.subTo(y, x);
x.rShiftTo(1, x);
} else {
y.subTo(x, y);
y.rShiftTo(1, y);
}
}
if (g > 0) y.lShiftTo(g, y);
return y;
}
// (protected) this % n, n < 2^26
function bnpModInt(n) {
var this_array = this.array;
if (n <= 0) return 0;
var d = BI_DV % n,
r = this.s < 0 ? n - 1 : 0;
if (this.t > 0)
if (d == 0) r = this_array[0] % n;
else for (var i = this.t - 1; i >= 0; --i) r = (d * r + this_array[i]) % n;
return r;
}
// (public) 1/this % m (HAC 14.61)
function bnModInverse(m) {
var ac = m.isEven();
if ((this.isEven() && ac) || m.signum() == 0) return BigInteger.ZERO;
var u = m.clone(),
v = this.clone();
var a = nbv(1),
b = nbv(0),
c = nbv(0),
d = nbv(1);
while (u.signum() != 0) {
while (u.isEven()) {
u.rShiftTo(1, u);
if (ac) {
if (!a.isEven() || !b.isEven()) {
a.addTo(this, a);
b.subTo(m, b);
}
a.rShiftTo(1, a);
} else if (!b.isEven()) b.subTo(m, b);
b.rShiftTo(1, b);
}
while (v.isEven()) {
v.rShiftTo(1, v);
if (ac) {
if (!c.isEven() || !d.isEven()) {
c.addTo(this, c);
d.subTo(m, d);
}
c.rShiftTo(1, c);
} else if (!d.isEven()) d.subTo(m, d);
d.rShiftTo(1, d);
}
if (u.compareTo(v) >= 0) {
u.subTo(v, u);
if (ac) a.subTo(c, a);
b.subTo(d, b);
} else {
v.subTo(u, v);
if (ac) c.subTo(a, c);
d.subTo(b, d);
}
}
if (v.compareTo(BigInteger.ONE) != 0) return BigInteger.ZERO;
if (d.compareTo(m) >= 0) return d.subtract(m);
if (d.signum() < 0) d.addTo(m, d);
else return d;
if (d.signum() < 0) return d.add(m);
else return d;
}
var lowprimes = [
2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71,
73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151,
157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233,
239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317,
331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419,
421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503,
509,
];
var lplim = (1 << 26) / lowprimes[lowprimes.length - 1];
// (public) test primality with certainty >= 1-.5^t
function bnIsProbablePrime(t) {
var i,
x = this.abs();
var x_array = x.array;
if (x.t == 1 && x_array[0] <= lowprimes[lowprimes.length - 1]) {
for (i = 0; i < lowprimes.length; ++i)
if (x_array[0] == lowprimes[i]) return true;
return false;
}
if (x.isEven()) return false;
i = 1;
while (i < lowprimes.length) {
var m = lowprimes[i],
j = i + 1;
while (j < lowprimes.length && m < lplim) m *= lowprimes[j++];
m = x.modInt(m);
while (i < j) if (m % lowprimes[i++] == 0) return false;
}
return x.millerRabin(t);
}
// (protected) true if probably prime (HAC 4.24, Miller-Rabin)
function bnpMillerRabin(t) {
var n1 = this.subtract(BigInteger.ONE);
var k = n1.getLowestSetBit();
if (k <= 0) return false;
var r = n1.shiftRight(k);
t = (t + 1) >> 1;
if (t > lowprimes.length) t = lowprimes.length;
var a = nbi();
for (var i = 0; i < t; ++i) {
a.fromInt(lowprimes[i]);
var y = a.modPow(r, this);
if (y.compareTo(BigInteger.ONE) != 0 && y.compareTo(n1) != 0) {
var j = 1;
while (j++ < k && y.compareTo(n1) != 0) {
y = y.modPowInt(2, this);
if (y.compareTo(BigInteger.ONE) == 0) return false;
}
if (y.compareTo(n1) != 0) return false;
}
}
return true;
}
// protected
BigInteger.prototype.chunkSize = bnpChunkSize;
BigInteger.prototype.toRadix = bnpToRadix;
BigInteger.prototype.fromRadix = bnpFromRadix;
BigInteger.prototype.fromNumber = bnpFromNumber;
BigInteger.prototype.bitwiseTo = bnpBitwiseTo;
BigInteger.prototype.changeBit = bnpChangeBit;
BigInteger.prototype.addTo = bnpAddTo;
BigInteger.prototype.dMultiply = bnpDMultiply;
BigInteger.prototype.dAddOffset = bnpDAddOffset;
BigInteger.prototype.multiplyLowerTo = bnpMultiplyLowerTo;
BigInteger.prototype.multiplyUpperTo = bnpMultiplyUpperTo;
BigInteger.prototype.modInt = bnpModInt;
BigInteger.prototype.millerRabin = bnpMillerRabin;
// public
BigInteger.prototype.clone = bnClone;
BigInteger.prototype.intValue = bnIntValue;
BigInteger.prototype.byteValue = bnByteValue;
BigInteger.prototype.shortValue = bnShortValue;
BigInteger.prototype.signum = bnSigNum;
BigInteger.prototype.toByteArray = bnToByteArray;
BigInteger.prototype.equals = bnEquals;
BigInteger.prototype.min = bnMin;
BigInteger.prototype.max = bnMax;
BigInteger.prototype.and = bnAnd;
BigInteger.prototype.or = bnOr;
BigInteger.prototype.xor = bnXor;
BigInteger.prototype.andNot = bnAndNot;
BigInteger.prototype.not = bnNot;
BigInteger.prototype.shiftLeft = bnShiftLeft;
BigInteger.prototype.shiftRight = bnShiftRight;
BigInteger.prototype.getLowestSetBit = bnGetLowestSetBit;
BigInteger.prototype.bitCount = bnBitCount;
BigInteger.prototype.testBit = bnTestBit;
BigInteger.prototype.setBit = bnSetBit;
BigInteger.prototype.clearBit = bnClearBit;
BigInteger.prototype.flipBit = bnFlipBit;
BigInteger.prototype.add = bnAdd;
BigInteger.prototype.subtract = bnSubtract;
BigInteger.prototype.multiply = bnMultiply;
BigInteger.prototype.divide = bnDivide;
BigInteger.prototype.remainder = bnRemainder;
BigInteger.prototype.divideAndRemainder = bnDivideAndRemainder;
BigInteger.prototype.modPow = bnModPow;
BigInteger.prototype.modInverse = bnModInverse;
BigInteger.prototype.pow = bnPow;
BigInteger.prototype.gcd = bnGCD;
BigInteger.prototype.isProbablePrime = bnIsProbablePrime;
// BigInteger interfaces not implemented in jsbn:
// BigInteger(int signum, byte[] magnitude)
// double doubleValue()
// float floatValue()
// int hashCode()
// long longValue()
// static BigInteger valueOf(long val)
// prng4.js - uses Arcfour as a PRNG
function Arcfour() {
this.i = 0;
this.j = 0;
this.S = new Array();
}
// Initialize arcfour context from key, an array of ints, each from [0..255]
function ARC4init(key) {
var i, j, t;
for (i = 0; i < 256; ++i) this.S[i] = i;
j = 0;
for (i = 0; i < 256; ++i) {
j = (j + this.S[i] + key[i % key.length]) & 255;
t = this.S[i];
this.S[i] = this.S[j];
this.S[j] = t;
}
this.i = 0;
this.j = 0;
}
function ARC4next() {
var t;
this.i = (this.i + 1) & 255;
this.j = (this.j + this.S[this.i]) & 255;
t = this.S[this.i];
this.S[this.i] = this.S[this.j];
this.S[this.j] = t;
return this.S[(t + this.S[this.i]) & 255];
}
Arcfour.prototype.init = ARC4init;
Arcfour.prototype.next = ARC4next;
// Plug in your RNG constructor here
function prng_newstate() {
return new Arcfour();
}
// Pool size must be a multiple of 4 and greater than 32.
// An array of bytes the size of the pool will be passed to init()
var rng_psize = 256;
// Random number generator - requires a PRNG backend, e.g. prng4.js
// For best results, put code like
// <body onClick='rng_seed_time();' onKeyPress='rng_seed_time();'>
// in your main HTML document.
var rng_state;
var rng_pool;
var rng_pptr;
// Mix in a 32-bit integer into the pool
function rng_seed_int(x) {
rng_pool[rng_pptr++] ^= x & 255;
rng_pool[rng_pptr++] ^= (x >> 8) & 255;
rng_pool[rng_pptr++] ^= (x >> 16) & 255;
rng_pool[rng_pptr++] ^= (x >> 24) & 255;
if (rng_pptr >= rng_psize) rng_pptr -= rng_psize;
}
// Mix in the current time (w/milliseconds) into the pool
function rng_seed_time() {
// Use pre-computed date to avoid making the benchmark
// results dependent on the current date.
rng_seed_int(1122926989487);
}
// Initialize the pool with junk if needed.
if (rng_pool == null) {
rng_pool = new Array();
rng_pptr = 0;
var t;
while (rng_pptr < rng_psize) {
// extract some randomness from Math.random()
t = Math.floor(65536 * Math.random());
rng_pool[rng_pptr++] = t >>> 8;
rng_pool[rng_pptr++] = t & 255;
}
rng_pptr = 0;
rng_seed_time();
//rng_seed_int(window.screenX);
//rng_seed_int(window.screenY);
}
function rng_get_byte() {
if (rng_state == null) {
rng_seed_time();
rng_state = prng_newstate();
rng_state.init(rng_pool);
for (rng_pptr = 0; rng_pptr < rng_pool.length; ++rng_pptr)
rng_pool[rng_pptr] = 0;
rng_pptr = 0;
//rng_pool = null;
}
// TODO: allow reseeding after first request
return rng_state.next();
}
function rng_get_bytes(ba) {
var i;
for (i = 0; i < ba.length; ++i) ba[i] = rng_get_byte();
}
function SecureRandom() {}
SecureRandom.prototype.nextBytes = rng_get_bytes;
// Depends on jsbn.js and rng.js
// convert a (hex) string to a bignum object
function parseBigInt(str, r) {
return new BigInteger(str, r);
}
function linebrk(s, n) {
var ret = "";
var i = 0;
while (i + n < s.length) {
ret += s.substring(i, i + n) + "\n";
i += n;
}
return ret + s.substring(i, s.length);
}
function byte2Hex(b) {
if (b < 0x10) return "0" + b.toString(16);
else return b.toString(16);
}
// PKCS#1 (type 2, random) pad input string s to n bytes, and return a bigint
function pkcs1pad2(s, n) {
if (n < s.length + 11) {
alert("Message too long for RSA");
return null;
}
var ba = new Array();
var i = s.length - 1;
while (i >= 0 && n > 0) ba[--n] = s.charCodeAt(i--);
ba[--n] = 0;
var rng = new SecureRandom();
var x = new Array();
while (n > 2) {
// random non-zero pad
x[0] = 0;
while (x[0] == 0) rng.nextBytes(x);
ba[--n] = x[0];
}
ba[--n] = 2;
ba[--n] = 0;
return new BigInteger(ba);
}
// "empty" RSA key constructor
function RSAKey() {
this.n = null;
this.e = 0;
this.d = null;
this.p = null;
this.q = null;
this.dmp1 = null;
this.dmq1 = null;
this.coeff = null;
}
// Set the public key fields N and e from hex strings
function RSASetPublic(N, E) {
if (N != null && E != null && N.length > 0 && E.length > 0) {
this.n = parseBigInt(N, 16);
this.e = parseInt(E, 16);
} else alert("Invalid RSA public key");
}
// Perform raw public operation on "x": return x^e (mod n)
function RSADoPublic(x) {
return x.modPowInt(this.e, this.n);
}
// Return the PKCS#1 RSA encryption of "text" as an even-length hex string
function RSAEncrypt(text) {
var m = pkcs1pad2(text, (this.n.bitLength() + 7) >> 3);
if (m == null) return null;
var c = this.doPublic(m);
if (c == null) return null;
var h = c.toString(16);
if ((h.length & 1) == 0) return h;
else return "0" + h;
}
// Return the PKCS#1 RSA encryption of "text" as a Base64-encoded string
//function RSAEncryptB64(text) {
// var h = this.encrypt(text);
// if(h) return hex2b64(h); else return null;
//}
// protected
RSAKey.prototype.doPublic = RSADoPublic;
// public
RSAKey.prototype.setPublic = RSASetPublic;
RSAKey.prototype.encrypt = RSAEncrypt;
//RSAKey.prototype.encrypt_b64 = RSAEncryptB64;
// Depends on rsa.js and jsbn2.js
// Undo PKCS#1 (type 2, random) padding and, if valid, return the plaintext
function pkcs1unpad2(d, n) {
var b = d.toByteArray();
var i = 0;
while (i < b.length && b[i] == 0) ++i;
if (b.length - i != n - 1 || b[i] != 2) return null;
++i;
while (b[i] != 0) if (++i >= b.length) return null;
var ret = "";
while (++i < b.length) ret += String.fromCharCode(b[i]);
return ret;
}
// Set the private key fields N, e, and d from hex strings
function RSASetPrivate(N, E, D) {
if (N != null && E != null && N.length > 0 && E.length > 0) {
this.n = parseBigInt(N, 16);
this.e = parseInt(E, 16);
this.d = parseBigInt(D, 16);
} else alert("Invalid RSA private key");
}
// Set the private key fields N, e, d and CRT params from hex strings
function RSASetPrivateEx(N, E, D, P, Q, DP, DQ, C) {
if (N != null && E != null && N.length > 0 && E.length > 0) {
this.n = parseBigInt(N, 16);
this.e = parseInt(E, 16);
this.d = parseBigInt(D, 16);
this.p = parseBigInt(P, 16);
this.q = parseBigInt(Q, 16);
this.dmp1 = parseBigInt(DP, 16);
this.dmq1 = parseBigInt(DQ, 16);
this.coeff = parseBigInt(C, 16);
} else alert("Invalid RSA private key");
}
// Generate a new random private key B bits long, using public expt E
function RSAGenerate(B, E) {
var rng = new SecureRandom();
var qs = B >> 1;
this.e = parseInt(E, 16);
var ee = new BigInteger(E, 16);
for (;;) {
for (;;) {
this.p = new BigInteger(B - qs, 1, rng);
if (
this.p.subtract(BigInteger.ONE).gcd(ee).compareTo(BigInteger.ONE) ==
0 &&
this.p.isProbablePrime(10)
)
break;
}
for (;;) {
this.q = new BigInteger(qs, 1, rng);
if (
this.q.subtract(BigInteger.ONE).gcd(ee).compareTo(BigInteger.ONE) ==
0 &&
this.q.isProbablePrime(10)
)
break;
}
if (this.p.compareTo(this.q) <= 0) {
var t = this.p;
this.p = this.q;
this.q = t;
}
var p1 = this.p.subtract(BigInteger.ONE);
var q1 = this.q.subtract(BigInteger.ONE);
var phi = p1.multiply(q1);
if (phi.gcd(ee).compareTo(BigInteger.ONE) == 0) {
this.n = this.p.multiply(this.q);
this.d = ee.modInverse(phi);
this.dmp1 = this.d.mod(p1);
this.dmq1 = this.d.mod(q1);
this.coeff = this.q.modInverse(this.p);
break;
}
}
}
// Perform raw private operation on "x": return x^d (mod n)
function RSADoPrivate(x) {
if (this.p == null || this.q == null) return x.modPow(this.d, this.n);
// TODO: re-calculate any missing CRT params
var xp = x.mod(this.p).modPow(this.dmp1, this.p);
var xq = x.mod(this.q).modPow(this.dmq1, this.q);
while (xp.compareTo(xq) < 0) xp = xp.add(this.p);
return xp
.subtract(xq)
.multiply(this.coeff)
.mod(this.p)
.multiply(this.q)
.add(xq);
}
// Return the PKCS#1 RSA decryption of "ctext".
// "ctext" is an even-length hex string and the output is a plain string.
function RSADecrypt(ctext) {
var c = parseBigInt(ctext, 16);
var m = this.doPrivate(c);
if (m == null) return null;
return pkcs1unpad2(m, (this.n.bitLength() + 7) >> 3);
}
// Return the PKCS#1 RSA decryption of "ctext".
// "ctext" is a Base64-encoded string and the output is a plain string.
//function RSAB64Decrypt(ctext) {
// var h = b64tohex(ctext);
// if(h) return this.decrypt(h); else return null;
//}
// protected
RSAKey.prototype.doPrivate = RSADoPrivate;
// public
RSAKey.prototype.setPrivate = RSASetPrivate;
RSAKey.prototype.setPrivateEx = RSASetPrivateEx;
RSAKey.prototype.generate = RSAGenerate;
RSAKey.prototype.decrypt = RSADecrypt;
//RSAKey.prototype.b64_decrypt = RSAB64Decrypt;
nValue =
"a5261939975948bb7a58dffe5ff54e65f0498f9175f5a09288810b8975871e99af3b5dd94057b0fc07535f5f97444504fa35169d461d0d30cf0192e307727c065168c788771c561a9400fb49175e9e6aa4e23fe11af69e9412dd23b0cb6684c4c2429bce139e848ab26d0829073351f4acd36074eafd036a5eb83359d2a698d3";
eValue = "10001";
dValue =
"8e9912f6d3645894e8d38cb58c0db81ff516cf4c7e5a14c7f1eddb1459d2cded4d8d293fc97aee6aefb861859c8b6a3d1dfe710463e1f9ddc72048c09751971c4a580aa51eb523357a3cc48d31cfad1d4a165066ed92d4748fb6571211da5cb14bc11b6e2df7c1a559e6d5ac1cd5c94703a22891464fba23d0d965086277a161";
pValue =
"d090ce58a92c75233a6486cb0a9209bf3583b64f540c76f5294bb97d285eed33aec220bde14b2417951178ac152ceab6da7090905b478195498b352048f15e7d";
qValue =
"cab575dc652bb66df15a0359609d51d1db184750c00c6698b90ef3465c99655103edbf0d54c56aec0ce3c4d22592338092a126a0cc49f65a4a30d222b411e58f";
dmp1Value =
"1a24bca8e273df2f0e47c199bbf678604e7df7215480c77c8db39f49b000ce2cf7500038acfff5433b7d582a01f1826e6f4d42e1c57f5e1fef7b12aabc59fd25";
dmq1Value =
"3d06982efbbe47339e1f6d36b1216b8a741d410b0c662f54f7118b27b9a4ec9d914337eb39841d8666f3034408cf94f5b62f11c402fc994fe15a05493150d9fd";
coeffValue =
"3a3e731acd8960b7ff9eb81a7ff93bd1cfa74cbd56987db58b4594fb09c09084db1734c8143f98b602b981aaa9243ca28deb69b5b280ee8dcee0fd2625e53250";
setupEngine(am3, 28);
var TEXT =
"The quick brown fox jumped over the extremely lazy frog! " +
"Now is the time for all good men to come to the party.";
var encrypted;
function encrypt() {
var RSA = new RSAKey();
RSA.setPublic(nValue, eValue);
RSA.setPrivateEx(
nValue,
eValue,
dValue,
pValue,
qValue,
dmp1Value,
dmq1Value,
coeffValue
);
encrypted = RSA.encrypt(TEXT);
}
function decrypt() {
var RSA = new RSAKey();
RSA.setPublic(nValue, eValue);
RSA.setPrivateEx(
nValue,
eValue,
dValue,
pValue,
qValue,
dmp1Value,
dmq1Value,
coeffValue
);
var decrypted = RSA.decrypt(encrypted);
if (decrypted != TEXT) {
throw new Error("Crypto operation failed");
}
}
================================================
FILE: benchmarks/v8-v7/deltablue.js
================================================
// Copyright 2008 the V8 project authors. All rights reserved.
// Copyright 1996 John Maloney and Mario Wolczko.
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// This implementation of the DeltaBlue benchmark is derived
// from the Smalltalk implementation by John Maloney and Mario
// Wolczko. Some parts have been translated directly, whereas
// others have been modified more aggresively to make it feel
// more like a JavaScript program.
var DeltaBlue = new BenchmarkSuite("DeltaBlue", 66118, [
new Benchmark("DeltaBlue", deltaBlue),
]);
/**
* A JavaScript implementation of the DeltaBlue constraint-solving
* algorithm, as described in:
*
* "The DeltaBlue Algorithm: An Incremental Constraint Hierarchy Solver"
* Bjorn N. Freeman-Benson and John Maloney
* January 1990 Communications of the ACM,
* also available as University of Washington TR 89-08-06.
*
* Beware: this benchmark is written in a grotesque style where
* the constraint model is built by side-effects from constructors.
* I've kept it this way to avoid deviating too much from the original
* implementation.
*/
/* --- O b j e c t M o d e l --- */
Object.prototype.inheritsFrom = function (shuper) {
function Inheriter() {}
Inheriter.prototype = shuper.prototype;
this.prototype = new Inheriter();
this.superConstructor = shuper;
};
function OrderedCollection() {
this.elms = new Array();
}
OrderedCollection.prototype.add = function (elm) {
this.elms.push(elm);
};
OrderedCollection.prototype.at = function (index) {
return this.elms[index];
};
OrderedCollection.prototype.size = function () {
return this.elms.length;
};
OrderedCollection.prototype.removeFirst = function () {
return this.elms.pop();
};
OrderedCollection.prototype.remove = function (elm) {
var index = 0,
skipped = 0;
for (var i = 0; i < this.elms.length; i++) {
var value = this.elms[i];
if (value != elm) {
this.elms[index] = value;
index++;
} else {
skipped++;
}
}
for (var i = 0; i < skipped; i++) this.elms.pop();
};
/* --- *
* S t r e n g t h
* --- */
/**
* Strengths are used to measure the relative importance of constraints.
* New strengths may be inserted in the strength hierarchy without
* disrupting current constraints. Strengths cannot be created outside
* this class, so pointer comparison can be used for value comparison.
*/
function Strength(strengthValue, name) {
this.strengthValue = strengthValue;
this.name = name;
}
Strength.stronger = function (s1, s2) {
return s1.strengthValue < s2.strengthValue;
};
Strength.weaker = function (s1, s2) {
return s1.strengthValue > s2.strengthValue;
};
Strength.weakestOf = function (s1, s2) {
return this.weaker(s1, s2) ? s1 : s2;
};
Strength.strongest = function (s1, s2) {
return this.stronger(s1, s2) ? s1 : s2;
};
Strength.prototype.nextWeaker = function () {
switch (this.strengthValue) {
case 0:
return Strength.WEAKEST;
case 1:
return Strength.WEAK_DEFAULT;
case 2:
return Strength.NORMAL;
case 3:
return Strength.STRONG_DEFAULT;
case 4:
return Strength.PREFERRED;
case 5:
return Strength.REQUIRED;
}
};
// Strength constants.
Strength.REQUIRED = new Strength(0, "required");
Strength.STONG_PREFERRED = new Strength(1, "strongPreferred");
Strength.PREFERRED = new Strength(2, "preferred");
Strength.STRONG_DEFAULT = new Strength(3, "strongDefault");
Strength.NORMAL = new Strength(4, "normal");
Strength.WEAK_DEFAULT = new Strength(5, "weakDefault");
Strength.WEAKEST = new Strength(6, "weakest");
/* --- *
* C o n s t r a i n t
* --- */
/**
* An abstract class representing a system-maintainable relationship
* (or "constraint") between a set of variables. A constraint supplies
* a strength instance variable; concrete subclasses provide a means
* of storing the constrained variables and other information required
* to represent a constraint.
*/
function Constraint(strength) {
this.strength = strength;
}
/**
* Activate this constraint and attempt to satisfy it.
*/
Constraint.prototype.addConstraint = function () {
this.addToGraph();
planner.incrementalAdd(this);
};
/**
* Attempt to find a way to enforce this constraint. If successful,
* record the solution, perhaps modifying the current dataflow
* graph. Answer the constraint that this constraint overrides, if
* there is one, or nil, if there isn't.
* Assume: I am not already satisfied.
*/
Constraint.prototype.satisfy = function (mark) {
this.chooseMethod(mark);
if (!this.isSatisfied()) {
if (this.strength == Strength.REQUIRED)
alert("Could not satisfy a required constraint!");
return null;
}
this.markInputs(mark);
var out = this.output();
var overridden = out.determinedBy;
if (overridden != null) overridden.markUnsatisfied();
out.determinedBy = this;
if (!planner.addPropagate(this, mark)) alert("Cycle encountered");
out.mark = mark;
return overridden;
};
Constraint.prototype.destroyConstraint = function () {
if (this.isSatisfied()) planner.incrementalRemove(this);
else this.removeFromGraph();
};
/**
* Normal constraints are not input constraints. An input constraint
* is one that depends on external state, such as the mouse, the
* keybord, a clock
gitextract_jm62atds/ ├── .cargo/ │ └── config.toml ├── .fleet/ │ └── settings.json ├── .github/ │ ├── dependabot.yml │ ├── pull_request_template.md │ └── workflows/ │ ├── build-modules.yml │ ├── build.yml │ ├── ci.yml │ ├── publish.yml │ └── release.yml ├── .gitignore ├── .gitmodules ├── .prettierignore ├── .vscode/ │ ├── launch.json │ └── settings.json ├── .yarnrc.yml ├── API.md ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── Cargo.toml ├── GOVERNANCE.md ├── LICENSE ├── MAINTAINERS.md ├── Makefile ├── NOTICE ├── README.md ├── THIRD_PARTY_LICENSES ├── benchmarks/ │ └── v8-v7/ │ ├── README.txt │ ├── base.js │ ├── crypto.js │ ├── deltablue.js │ ├── earley-boyer.js │ ├── index.js │ ├── navier-stokes.js │ ├── raytrace.js │ ├── regexp.js │ ├── richards.js │ └── splay.js ├── build.mjs ├── example/ │ ├── clear-ddb-table.mjs │ ├── functions/ │ │ ├── build.mjs │ │ ├── package.json │ │ ├── src/ │ │ │ ├── api.ts │ │ │ ├── hello.mjs │ │ │ ├── non-included-sdk.mjs │ │ │ ├── react/ │ │ │ │ ├── App.css │ │ │ │ ├── App.tsx │ │ │ │ ├── CreateTodo.tsx │ │ │ │ ├── TodoItem.tsx │ │ │ │ ├── TodoList.css │ │ │ │ ├── TodoList.tsx │ │ │ │ ├── index.html │ │ │ │ └── index.tsx │ │ │ ├── ssr.ts │ │ │ ├── types.d.ts │ │ │ ├── v2.js │ │ │ ├── v3-lib.mjs │ │ │ ├── v3-mono.mjs │ │ │ ├── v3-s3.mjs │ │ │ └── v3.mjs │ │ └── tsconfig.json │ ├── infrastructure/ │ │ ├── cdk.json │ │ ├── package.json │ │ ├── src/ │ │ │ └── index.ts │ │ └── tsconfig.json │ ├── llrt-sam/ │ │ ├── .gitignore │ │ ├── README.md │ │ ├── hello-world/ │ │ │ ├── app.ts │ │ │ ├── package.json │ │ │ └── tsconfig.json │ │ ├── samconfig.toml │ │ └── template.yaml │ ├── llrt-sam-container-image/ │ │ ├── .gitignore │ │ ├── README.md │ │ ├── events/ │ │ │ └── event.json │ │ ├── hello-world/ │ │ │ ├── Dockerfile │ │ │ └── app.mjs │ │ ├── samconfig.toml │ │ └── template.yaml │ └── register-hooks/ │ ├── hooks/ │ │ ├── calc.js │ │ ├── fs.js │ │ ├── http.js │ │ └── v8.js │ ├── simple-server.js │ ├── simple-server.sh │ ├── src/ │ │ └── http.js │ ├── test.js │ └── test.sh ├── fixtures/ │ ├── a.js │ ├── b.js │ ├── c.cjs │ ├── cjs-handler.cjs │ ├── d.cjs │ ├── define-property-export.cjs │ ├── empty.js │ ├── empty.lrt │ ├── export-function.cjs │ ├── fs/ │ │ └── readdir/ │ │ ├── readdir.js │ │ └── recursive/ │ │ └── readdir.js │ ├── handler.mjs │ ├── hello.js │ ├── hello.txt │ ├── import.cjs │ ├── import.js │ ├── local.mjs │ ├── node_modules/ │ │ ├── elem-aws-lambda-powertools/ │ │ │ ├── commons/ │ │ │ │ ├── lib/ │ │ │ │ │ ├── cjs/ │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ └── typeUtils.js │ │ │ │ │ └── esm/ │ │ │ │ │ ├── index.js │ │ │ │ │ └── typeUtils.js │ │ │ │ └── package.json │ │ │ └── jmespath/ │ │ │ ├── lib/ │ │ │ │ ├── cjs/ │ │ │ │ │ └── index.js │ │ │ │ └── esm/ │ │ │ │ └── index.js │ │ │ └── package.json │ │ ├── elem-debug/ │ │ │ ├── package.json │ │ │ └── src/ │ │ │ └── browser.js │ │ ├── elem-hono/ │ │ │ ├── dist/ │ │ │ │ ├── cjs/ │ │ │ │ │ └── utils/ │ │ │ │ │ └── url.js │ │ │ │ └── index.js │ │ │ └── package.json │ │ ├── elem-lodash.merge/ │ │ │ ├── index.js │ │ │ └── package.json │ │ ├── elem-react-dom/ │ │ │ ├── cjs/ │ │ │ │ ├── react-dom-server.edge.development.js │ │ │ │ └── react-dom.development.js │ │ │ ├── index.js │ │ │ ├── package.json │ │ │ └── server.edge.js │ │ └── elem-uuid/ │ │ ├── dist/ │ │ │ └── commonjs-browser/ │ │ │ └── index.js │ │ └── package.json │ ├── package.json │ ├── primitive-handler.mjs │ ├── prop-export.cjs │ ├── referenced-exports.cjs │ ├── require.mjs │ ├── sdk-handler.mjs │ ├── sdk-runtime-init.mjs │ ├── test1245/ │ │ ├── index.js │ │ ├── main/ │ │ │ └── foo.js │ │ └── package.json │ ├── test903/ │ │ ├── bar.mjs │ │ └── foo.mjs │ ├── test_modules/ │ │ ├── test-aws-lambda-powertools-jmespath.js │ │ ├── test-debug.js │ │ ├── test-elem-hono.js │ │ ├── test-lodash.merge.js │ │ ├── test-react-dom.js │ │ └── test-uuid.js │ ├── throw.js │ ├── throwing-handler.mjs │ ├── throwing-init-handler.mjs │ └── tla-webcall-handler.mjs ├── index.mjs ├── lambda-server.js ├── libs/ │ ├── llrt_build/ │ │ ├── Cargo.toml │ │ └── src/ │ │ └── lib.rs │ ├── llrt_compression/ │ │ ├── Cargo.toml │ │ └── src/ │ │ └── lib.rs │ ├── llrt_context/ │ │ ├── Cargo.toml │ │ └── src/ │ │ └── lib.rs │ ├── llrt_dns_cache/ │ │ ├── Cargo.toml │ │ └── src/ │ │ └── lib.rs │ ├── llrt_encoding/ │ │ ├── Cargo.toml │ │ ├── build.rs │ │ └── src/ │ │ └── lib.rs │ ├── llrt_hooking/ │ │ ├── Cargo.toml │ │ └── src/ │ │ └── lib.rs │ ├── llrt_json/ │ │ ├── Cargo.toml │ │ ├── benches/ │ │ │ └── json.rs │ │ ├── build.rs │ │ └── src/ │ │ ├── escape.rs │ │ ├── lib.rs │ │ ├── parse.rs │ │ └── stringify.rs │ ├── llrt_logging/ │ │ ├── Cargo.toml │ │ └── src/ │ │ └── lib.rs │ ├── llrt_numbers/ │ │ ├── Cargo.toml │ │ ├── benches/ │ │ │ └── numbers.rs │ │ └── src/ │ │ └── lib.rs │ ├── llrt_test/ │ │ ├── Cargo.toml │ │ └── src/ │ │ └── lib.rs │ ├── llrt_test_tls/ │ │ ├── Cargo.toml │ │ ├── data/ │ │ │ ├── generate.sh │ │ │ ├── root.pem │ │ │ ├── server.key │ │ │ └── server.pem │ │ └── src/ │ │ ├── api.rs │ │ ├── config.rs │ │ ├── lib.rs │ │ └── server.rs │ └── llrt_utils/ │ ├── Cargo.toml │ └── src/ │ ├── any_of.rs │ ├── bytearray_buffer.rs │ ├── bytes.rs │ ├── class.rs │ ├── clone.rs │ ├── ctx.rs │ ├── error.rs │ ├── error_messages.rs │ ├── fs.rs │ ├── hash.rs │ ├── io.rs │ ├── latch.rs │ ├── lib.rs │ ├── macros.rs │ ├── mc_oneshot.rs │ ├── module.rs │ ├── object.rs │ ├── option.rs │ ├── primordials.rs │ ├── provider.rs │ ├── result.rs │ ├── reuse_list.rs │ ├── signals.rs │ ├── string.rs │ ├── sysinfo.rs │ └── time.rs ├── linker/ │ ├── ar │ ├── cc │ ├── cc-aarch64-linux-gnu │ ├── cc-aarch64-linux-musl │ ├── cc-x86_64-linux-gnu │ ├── cc-x86_64-linux-musl │ ├── cxx │ ├── cxx-aarch64-linux-gnu │ ├── cxx-aarch64-linux-musl │ ├── cxx-x86_64-linux-gnu │ ├── cxx-x86_64-linux-musl │ └── ranlib ├── llrt/ │ ├── Cargo.toml │ └── src/ │ ├── base.rs │ ├── main.c │ ├── main.rs │ ├── minimal_tracer.rs │ └── repl.rs ├── llrt_core/ │ ├── Cargo.toml │ ├── build.rs │ └── src/ │ ├── builtins_inspect.rs │ ├── bytecode.rs │ ├── compiler.rs │ ├── compiler_common.rs │ ├── environment.rs │ ├── http.rs │ ├── lib.rs │ ├── libs.rs │ ├── modules/ │ │ ├── console.rs │ │ ├── embedded/ │ │ │ ├── loader.rs │ │ │ ├── mod.rs │ │ │ └── resolver.rs │ │ ├── js/ │ │ │ ├── @llrt/ │ │ │ │ ├── expect/ │ │ │ │ │ ├── jest-asymmetric-matchers.ts │ │ │ │ │ ├── jest-expect.ts │ │ │ │ │ ├── jest-utils.ts │ │ │ │ │ └── stringify.ts │ │ │ │ └── test/ │ │ │ │ ├── CircularBuffer.ts │ │ │ │ ├── Color.ts │ │ │ │ ├── SocketClient.ts │ │ │ │ ├── index.ts │ │ │ │ ├── shared.ts │ │ │ │ └── worker.ts │ │ │ ├── llrt.d.ts │ │ │ ├── stream/ │ │ │ │ └── promises.ts │ │ │ └── stream.ts │ │ ├── llrt/ │ │ │ ├── hex.rs │ │ │ ├── mod.rs │ │ │ ├── qjs.rs │ │ │ ├── util.rs │ │ │ └── xml.rs │ │ └── mod.rs │ ├── runtime_client.rs │ ├── security.rs │ └── vm.rs ├── llrt_modules/ │ ├── Cargo.toml │ ├── README.md │ └── src/ │ ├── lib.rs │ ├── module/ │ │ ├── loader.rs │ │ ├── mod.rs │ │ ├── require.rs │ │ └── resolver.rs │ ├── module_builder.rs │ └── package/ │ ├── loader.rs │ ├── mod.rs │ └── resolver.rs ├── modules/ │ ├── llrt_abort/ │ │ ├── Cargo.toml │ │ └── src/ │ │ ├── abort_controller.rs │ │ ├── abort_signal.rs │ │ └── lib.rs │ ├── llrt_assert/ │ │ ├── Cargo.toml │ │ └── src/ │ │ └── lib.rs │ ├── llrt_async_hooks/ │ │ ├── Cargo.toml │ │ └── src/ │ │ ├── finalization_registry.rs │ │ └── lib.rs │ ├── llrt_buffer/ │ │ ├── Cargo.toml │ │ └── src/ │ │ ├── array_buffer_view.rs │ │ ├── blob.rs │ │ ├── buffer.rs │ │ ├── file.rs │ │ └── lib.rs │ ├── llrt_child_process/ │ │ ├── Cargo.toml │ │ └── src/ │ │ └── lib.rs │ ├── llrt_console/ │ │ ├── Cargo.toml │ │ └── src/ │ │ └── lib.rs │ ├── llrt_crypto/ │ │ ├── Cargo.toml │ │ └── src/ │ │ ├── crc32.rs │ │ ├── hash.rs │ │ ├── lib.rs │ │ ├── provider/ │ │ │ ├── graviola.rs │ │ │ ├── mod.rs │ │ │ ├── openssl.rs │ │ │ ├── ring.rs │ │ │ └── rust/ │ │ │ ├── aes_variants.rs │ │ │ └── mod.rs │ │ └── subtle/ │ │ ├── crypto_key.rs │ │ ├── derive.rs │ │ ├── derive_algorithm.rs │ │ ├── digest.rs │ │ ├── encryption.rs │ │ ├── encryption_algorithm.rs │ │ ├── export_key.rs │ │ ├── generate_key.rs │ │ ├── import_key.rs │ │ ├── key_algorithm.rs │ │ ├── mod.rs │ │ ├── sign.rs │ │ ├── sign_algorithm.rs │ │ ├── stubs.rs │ │ ├── verify.rs │ │ └── wrapping.rs │ ├── llrt_dgram/ │ │ ├── Cargo.toml │ │ ├── README.md │ │ └── src/ │ │ ├── lib.rs │ │ └── socket.rs │ ├── llrt_dns/ │ │ ├── Cargo.toml │ │ └── src/ │ │ ├── lib.rs │ │ └── lookup.rs │ ├── llrt_events/ │ │ ├── Cargo.toml │ │ └── src/ │ │ ├── custom_event.rs │ │ ├── event.rs │ │ ├── event_target.rs │ │ └── lib.rs │ ├── llrt_exceptions/ │ │ ├── Cargo.toml │ │ └── src/ │ │ └── lib.rs │ ├── llrt_fetch/ │ │ ├── Cargo.toml │ │ └── src/ │ │ ├── body.rs │ │ ├── fetch.rs │ │ ├── form_data.rs │ │ ├── headers.rs │ │ ├── incoming.rs │ │ ├── lib.rs │ │ ├── request.rs │ │ ├── response.rs │ │ └── security.rs │ ├── llrt_fs/ │ │ ├── Cargo.toml │ │ └── src/ │ │ ├── access.rs │ │ ├── chmod.rs │ │ ├── file_handle.rs │ │ ├── lib.rs │ │ ├── mkdir.rs │ │ ├── open.rs │ │ ├── read_dir.rs │ │ ├── read_file.rs │ │ ├── rename.rs │ │ ├── rm.rs │ │ ├── stats.rs │ │ ├── symlink.rs │ │ └── write_file.rs │ ├── llrt_http/ │ │ ├── Cargo.toml │ │ └── src/ │ │ ├── agent.rs │ │ ├── client.rs │ │ ├── config.rs │ │ └── lib.rs │ ├── llrt_intl/ │ │ ├── Cargo.toml │ │ ├── README.md │ │ └── src/ │ │ ├── cldr_data.rs │ │ ├── date_time_format.rs │ │ ├── lib.rs │ │ └── pattern_formatter.rs │ ├── llrt_navigator/ │ │ ├── Cargo.toml │ │ └── src/ │ │ └── lib.rs │ ├── llrt_net/ │ │ ├── Cargo.toml │ │ └── src/ │ │ ├── lib.rs │ │ ├── security.rs │ │ ├── server.rs │ │ └── socket.rs │ ├── llrt_os/ │ │ ├── Cargo.toml │ │ └── src/ │ │ ├── lib.rs │ │ ├── network.rs │ │ ├── statistics.rs │ │ ├── unix.rs │ │ └── windows.rs │ ├── llrt_path/ │ │ ├── Cargo.toml │ │ ├── benches/ │ │ │ └── slash_replacement.rs │ │ └── src/ │ │ └── lib.rs │ ├── llrt_perf_hooks/ │ │ ├── Cargo.toml │ │ └── src/ │ │ ├── lib.rs │ │ └── performance.rs │ ├── llrt_process/ │ │ ├── Cargo.toml │ │ └── src/ │ │ └── lib.rs │ ├── llrt_stream/ │ │ ├── Cargo.toml │ │ └── src/ │ │ ├── lib.rs │ │ ├── readable.rs │ │ └── writable.rs │ ├── llrt_stream_web/ │ │ ├── Cargo.toml │ │ └── src/ │ │ ├── lib.rs │ │ ├── queuing_strategy/ │ │ │ ├── byte_length.rs │ │ │ ├── count.rs │ │ │ └── mod.rs │ │ ├── readable/ │ │ │ ├── byob_reader.rs │ │ │ ├── byte_controller.rs │ │ │ ├── controller.rs │ │ │ ├── default_controller.rs │ │ │ ├── default_reader.rs │ │ │ ├── iterator.rs │ │ │ ├── mod.rs │ │ │ ├── objects.rs │ │ │ ├── reader.rs │ │ │ └── stream/ │ │ │ ├── algorithms.rs │ │ │ ├── mod.rs │ │ │ ├── pipe.rs │ │ │ ├── source.rs │ │ │ └── tee.rs │ │ ├── readable_writable_pair.rs │ │ ├── utils/ │ │ │ ├── mod.rs │ │ │ ├── promise.rs │ │ │ └── queue.rs │ │ └── writable/ │ │ ├── default_controller.rs │ │ ├── default_writer.rs │ │ ├── mod.rs │ │ ├── objects.rs │ │ ├── stream/ │ │ │ ├── mod.rs │ │ │ └── sink.rs │ │ └── writer.rs │ ├── llrt_string_decoder/ │ │ ├── Cargo.toml │ │ └── src/ │ │ ├── lib.rs │ │ └── string_decoder.rs │ ├── llrt_temporal/ │ │ ├── Cargo.toml │ │ └── src/ │ │ ├── duration.rs │ │ ├── instant.rs │ │ ├── lib.rs │ │ ├── now.rs │ │ ├── plain_date.rs │ │ ├── plain_date_time.rs │ │ ├── plain_time.rs │ │ ├── utils/ │ │ │ ├── date.rs │ │ │ ├── date_time.rs │ │ │ ├── mod.rs │ │ │ ├── round/ │ │ │ │ ├── date_time.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── span.rs │ │ │ │ ├── time.rs │ │ │ │ ├── timestamp.rs │ │ │ │ └── zoned.rs │ │ │ ├── span.rs │ │ │ ├── time.rs │ │ │ ├── total/ │ │ │ │ ├── mod.rs │ │ │ │ └── span.rs │ │ │ └── zoned.rs │ │ └── zoned_date_time.rs │ ├── llrt_timers/ │ │ ├── Cargo.toml │ │ └── src/ │ │ └── lib.rs │ ├── llrt_tls/ │ │ ├── Cargo.toml │ │ └── src/ │ │ ├── lib.rs │ │ ├── no_verification.rs │ │ ├── openssl_config.rs │ │ └── rustls_config.rs │ ├── llrt_tty/ │ │ ├── Cargo.toml │ │ └── src/ │ │ └── lib.rs │ ├── llrt_url/ │ │ ├── Cargo.toml │ │ └── src/ │ │ ├── lib.rs │ │ ├── url_class.rs │ │ └── url_search_params.rs │ ├── llrt_util/ │ │ ├── Cargo.toml │ │ └── src/ │ │ ├── lib.rs │ │ ├── text_decoder.rs │ │ └── text_encoder.rs │ └── llrt_zlib/ │ ├── Cargo.toml │ └── src/ │ ├── brotli.rs │ ├── lib.rs │ ├── zlib.rs │ └── zstd.rs ├── pack ├── package.json ├── rustfmt.toml ├── sdk.cfg ├── shims/ │ ├── @aws-crypto/ │ │ ├── crc32.js │ │ ├── crc32c.js │ │ ├── index.js │ │ ├── sha1-browser.js │ │ └── sha256-browser.js │ ├── @smithy/ │ │ ├── abort-controller.js │ │ ├── split-stream.js │ │ ├── util-base64.js │ │ ├── util-hex-encoding.js │ │ └── util-utf8.js │ ├── collect-stream-body.js │ ├── create-read-stream.js │ ├── is-streaming.js │ ├── mnemonist/ │ │ └── lru-cache.js │ ├── sdk-stream-mixin.js │ ├── stream-collector.js │ └── string-hasher.js ├── tests/ │ ├── e2e/ │ │ ├── IntegTestResourcesStack.template.yml │ │ ├── README.md │ │ ├── cognito_identity.e2e.test.ts │ │ ├── dynamodb.e2e.test.ts │ │ └── s3.e2e.test.ts │ ├── unit/ │ │ ├── assert.test.ts │ │ ├── async_hooks.test.ts │ │ ├── asynchronous-processing-discipline.test.ts │ │ ├── buffer.test.ts │ │ ├── child_process.test.ts │ │ ├── clone.test.ts │ │ ├── compile.test.ts │ │ ├── console.test.ts │ │ ├── crypto.subtle.test.ts │ │ ├── crypto.test.ts │ │ ├── date.test.ts │ │ ├── dgram.test.ts │ │ ├── dns.test.ts │ │ ├── encoding.test.ts │ │ ├── events.test.ts │ │ ├── exceptions.test.ts │ │ ├── executable.test.ts │ │ ├── fetch.formdata.test.ts │ │ ├── fetch.headers.test.ts │ │ ├── fetch.request.test.ts │ │ ├── fetch.response.test.ts │ │ ├── fetch.test.ts │ │ ├── fs.test.ts │ │ ├── import.test.ts │ │ ├── intl.test.ts │ │ ├── jest-expect.test.ts │ │ ├── json.test.ts │ │ ├── llrt.qjs.test.ts │ │ ├── llrt.xml.test.ts │ │ ├── module.test.ts │ │ ├── navigator.test.ts │ │ ├── net.test.ts │ │ ├── numbers.test.ts │ │ ├── os.test.ts │ │ ├── path.test.ts │ │ ├── perf_hooks.test.ts │ │ ├── performance.test.ts │ │ ├── process.test.ts │ │ ├── require.test.ts │ │ ├── socket.test.ts │ │ ├── stream.test.ts │ │ ├── string_decoder.test.ts │ │ ├── symbol-to-string-tag.test.ts │ │ ├── temporal.duration.test.ts │ │ ├── temporal.instant.test.ts │ │ ├── temporal.now.test.ts │ │ ├── temporal.plaindate.test.ts │ │ ├── temporal.plaindatetime.test.ts │ │ ├── temporal.plaintime.test.ts │ │ ├── temporal.zoneddatetime.test.ts │ │ ├── test-utils.ts │ │ ├── timers.test.ts │ │ ├── tty.test.ts │ │ ├── url.test.ts │ │ ├── util.test.ts │ │ └── zlib.test.ts │ └── wpt/ │ ├── FileAPI/ │ │ └── support/ │ │ ├── Blob.js │ │ └── send-file-formdata-helper.js │ ├── FileAPI.blob.test.ts │ ├── FileAPI.file.test.ts │ ├── FileAPI.harness.js │ ├── README.md │ ├── WebCryptoAPI.derive_bits_keys.test.ts │ ├── WebCryptoAPI.digest.test.ts │ ├── WebCryptoAPI.harness.js │ ├── WebCryptoAPI.test.ts │ ├── common/ │ │ ├── gc.js │ │ ├── get-host-info.sub.js │ │ └── subset-tests.js │ ├── console.harness.js │ ├── console.test.ts │ ├── encoding/ │ │ └── resources/ │ │ ├── decoding-helpers.js │ │ └── encodings.js │ ├── encoding.harness.js │ ├── encoding.test.ts │ ├── fetch/ │ │ └── api/ │ │ ├── cors/ │ │ │ └── resources/ │ │ │ └── not-cors-safelisted.json │ │ ├── request/ │ │ │ ├── request-cache.js │ │ │ └── request-error.js │ │ └── resources/ │ │ ├── data.json │ │ ├── keepalive-helper.js │ │ ├── keepalive-worker.js │ │ ├── sw-intercept-abort.js │ │ ├── sw-intercept.js │ │ └── utils.js │ ├── fetch.api.abort.test.ts │ ├── fetch.api.basic.test.ts │ ├── fetch.api.body.test.ts │ ├── fetch.api.headers.test.ts │ ├── fetch.api.request.test.ts │ ├── fetch.api.response.test.ts │ ├── fetch.harness.js │ ├── hr-time.harness.js │ ├── hr-time.test.ts │ ├── resources/ │ │ ├── idlharness.js │ │ └── testharness.js │ ├── streams/ │ │ └── resources/ │ │ ├── recording-streams.js │ │ ├── rs-test-templates.js │ │ ├── rs-utils.js │ │ └── test-utils.js │ ├── streams.harness.js │ ├── streams.piping.test.ts │ ├── streams.readable-byte-streams.test.ts │ ├── streams.readable-streams.test.ts │ ├── streams.writable-streams.test.ts │ ├── url/ │ │ └── resources/ │ │ ├── IdnaTestV2-removed.json │ │ ├── IdnaTestV2.json │ │ ├── percent-encoding.json │ │ ├── setters_tests.json │ │ ├── toascii.json │ │ ├── urltestdata-javascript-only.json │ │ └── urltestdata.json │ ├── url.harness.js │ ├── url.test.ts │ ├── webidl-harness.js │ └── webidl.ecmascript-binding.es-exceptions.test.ts ├── tsconfig.json ├── types/ │ ├── .eslintrc.cjs │ ├── abort.d.ts │ ├── assert.d.ts │ ├── async_hooks.d.ts │ ├── buffer.d.ts │ ├── child_process.d.ts │ ├── console.d.ts │ ├── crypto.d.ts │ ├── dgram.d.ts │ ├── dns.d.ts │ ├── dom-events.d.ts │ ├── events.d.ts │ ├── exceptions.d.ts │ ├── fetch.d.ts │ ├── fs/ │ │ └── promises.d.ts │ ├── fs.d.ts │ ├── globals.d.ts │ ├── https.d.ts │ ├── index.d.ts │ ├── module.d.ts │ ├── navigator.d.ts │ ├── net.d.ts │ ├── os.d.ts │ ├── package.json │ ├── path.d.ts │ ├── perf_hooks.d.ts │ ├── process.d.ts │ ├── stream/ │ │ └── web.d.ts │ ├── stream.d.ts │ ├── string_decoder.d.ts │ ├── timers.d.ts │ ├── timezone.d.ts │ ├── tsconfig.json │ ├── tty.d.ts │ ├── url.d.ts │ ├── util.d.ts │ └── zlib.d.ts ├── vitest.config.mjs └── wpt_errors.txt
Showing preview only (385K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (4642 symbols across 381 files)
FILE: benchmarks/v8-v7/base.js
function Benchmark (line 36) | function Benchmark(name, run, setup, tearDown) {
function BenchmarkResult (line 46) | function BenchmarkResult(benchmark, time) {
function BenchmarkSuite (line 61) | function BenchmarkSuite(name, reference, benchmarks) {
function RunStep (line 102) | function RunStep() {
function Measure (line 187) | function Measure(data) {
function RunNextSetup (line 231) | function RunNextSetup() {
function RunNextBenchmark (line 245) | function RunNextBenchmark() {
function RunNextTearDown (line 256) | function RunNextTearDown() {
FILE: benchmarks/v8-v7/crypto.js
function BigInteger (line 56) | function BigInteger(a, b, c) {
function nbi (line 65) | function nbi() {
function am1 (line 77) | function am1(i, x, w, j, c, n) {
function am2 (line 91) | function am2(i, x, w, j, c, n) {
function am3 (line 109) | function am3(i, x, w, j, c, n) {
function am4 (line 128) | function am4(i, x, w, j, c, n) {
function int2char (line 175) | function int2char(n) {
function intAt (line 178) | function intAt(s, i) {
function bnpCopyTo (line 184) | function bnpCopyTo(r) {
function bnpFromInt (line 194) | function bnpFromInt(x) {
function nbv (line 204) | function nbv(i) {
function bnpFromString (line 211) | function bnpFromString(s, b) {
function bnpClamp (line 254) | function bnpClamp() {
function bnToString (line 261) | function bnToString(b) {
function bnNegate (line 301) | function bnNegate() {
function bnAbs (line 308) | function bnAbs() {
function bnCompareTo (line 313) | function bnCompareTo(a) {
function nbits (line 327) | function nbits(x) {
function bnBitLength (line 354) | function bnBitLength() {
function bnpDLShiftTo (line 363) | function bnpDLShiftTo(n, r) {
function bnpDRShiftTo (line 374) | function bnpDRShiftTo(n, r) {
function bnpLShiftTo (line 383) | function bnpLShiftTo(n, r) {
function bnpRShiftTo (line 404) | function bnpRShiftTo(n, r) {
function bnpSubTo (line 427) | function bnpSubTo(a, r) {
function bnpMultiplyTo (line 465) | function bnpMultiplyTo(a, r) {
function bnpSquareTo (line 483) | function bnpSquareTo(r) {
function bnpDivRemTo (line 513) | function bnpDivRemTo(m, q, r) {
function bnMod (line 581) | function bnMod(a) {
function Classic (line 589) | function Classic(m) {
function cConvert (line 592) | function cConvert(x) {
function cRevert (line 596) | function cRevert(x) {
function cReduce (line 599) | function cReduce(x) {
function cMulTo (line 602) | function cMulTo(x, y, r) {
function cSqrTo (line 606) | function cSqrTo(x, r) {
function bnpInvDigit (line 627) | function bnpInvDigit() {
function Montgomery (line 644) | function Montgomery(m) {
function montConvert (line 654) | function montConvert(x) {
function montRevert (line 663) | function montRevert(x) {
function montReduce (line 671) | function montReduce(x) {
function montSqrTo (line 698) | function montSqrTo(x, r) {
function montMulTo (line 704) | function montMulTo(x, y, r) {
function bnpIsEven (line 716) | function bnpIsEven() {
function bnpExp (line 722) | function bnpExp(e, z) {
function bnModPowInt (line 742) | function bnModPowInt(e, m) {
function bnClone (line 785) | function bnClone() {
function bnIntValue (line 792) | function bnIntValue() {
function bnByteValue (line 804) | function bnByteValue() {
function bnShortValue (line 810) | function bnShortValue() {
function bnpChunkSize (line 816) | function bnpChunkSize(r) {
function bnSigNum (line 821) | function bnSigNum() {
function bnpToRadix (line 829) | function bnpToRadix(b) {
function bnpFromRadix (line 847) | function bnpFromRadix(s, b) {
function bnpFromNumber (line 877) | function bnpFromNumber(a, b, c) {
function bnToByteArray (line 906) | function bnToByteArray() {
function bnEquals (line 936) | function bnEquals(a) {
function bnMin (line 939) | function bnMin(a) {
function bnMax (line 942) | function bnMax(a) {
function bnpBitwiseTo (line 947) | function bnpBitwiseTo(a, op, r) {
function op_and (line 969) | function op_and(x, y) {
function bnAnd (line 972) | function bnAnd(a) {
function op_or (line 979) | function op_or(x, y) {
function bnOr (line 982) | function bnOr(a) {
function op_xor (line 989) | function op_xor(x, y) {
function bnXor (line 992) | function bnXor(a) {
function op_andnot (line 999) | function op_andnot(x, y) {
function bnAndNot (line 1002) | function bnAndNot(a) {
function bnNot (line 1009) | function bnNot() {
function bnShiftLeft (line 1021) | function bnShiftLeft(n) {
function bnShiftRight (line 1029) | function bnShiftRight(n) {
function lbit (line 1037) | function lbit(x) {
function bnGetLowestSetBit (line 1061) | function bnGetLowestSetBit() {
function cbit (line 1070) | function cbit(x) {
function bnBitCount (line 1080) | function bnBitCount() {
function bnTestBit (line 1088) | function bnTestBit(n) {
function bnpChangeBit (line 1096) | function bnpChangeBit(n, op) {
function bnSetBit (line 1103) | function bnSetBit(n) {
function bnClearBit (line 1108) | function bnClearBit(n) {
function bnFlipBit (line 1113) | function bnFlipBit(n) {
function bnpAddTo (line 1118) | function bnpAddTo(a, r) {
function bnAdd (line 1155) | function bnAdd(a) {
function bnSubtract (line 1162) | function bnSubtract(a) {
function bnMultiply (line 1169) | function bnMultiply(a) {
function bnDivide (line 1176) | function bnDivide(a) {
function bnRemainder (line 1183) | function bnRemainder(a) {
function bnDivideAndRemainder (line 1190) | function bnDivideAndRemainder(a) {
function bnpDMultiply (line 1198) | function bnpDMultiply(n) {
function bnpDAddOffset (line 1206) | function bnpDAddOffset(n, w) {
function NullExp (line 1218) | function NullExp() {}
function nNop (line 1219) | function nNop(x) {
function nMulTo (line 1222) | function nMulTo(x, y, r) {
function nSqrTo (line 1225) | function nSqrTo(x, r) {
function bnPow (line 1235) | function bnPow(e) {
function bnpMultiplyLowerTo (line 1241) | function bnpMultiplyLowerTo(a, n, r) {
function bnpMultiplyUpperTo (line 1257) | function bnpMultiplyUpperTo(a, n, r) {
function Barrett (line 1278) | function Barrett(m) {
function barrettConvert (line 1287) | function barrettConvert(x) {
function barrettRevert (line 1298) | function barrettRevert(x) {
function barrettReduce (line 1303) | function barrettReduce(x) {
function barrettSqrTo (line 1317) | function barrettSqrTo(x, r) {
function barrettMulTo (line 1323) | function barrettMulTo(x, y, r) {
function bnModPow (line 1335) | function bnModPow(e, m) {
function bnGCD (line 1423) | function bnGCD(a) {
function bnpModInt (line 1455) | function bnpModInt(n) {
function bnModInverse (line 1467) | function bnModInverse(m) {
function bnIsProbablePrime (line 1529) | function bnIsProbablePrime(t) {
function bnpMillerRabin (line 1551) | function bnpMillerRabin(t) {
function Arcfour (line 1634) | function Arcfour() {
function ARC4init (line 1641) | function ARC4init(key) {
function ARC4next (line 1655) | function ARC4next() {
function prng_newstate (line 1669) | function prng_newstate() {
function rng_seed_int (line 1687) | function rng_seed_int(x) {
function rng_seed_time (line 1696) | function rng_seed_time() {
function rng_get_byte (line 1719) | function rng_get_byte() {
function rng_get_bytes (line 1733) | function rng_get_bytes(ba) {
function SecureRandom (line 1738) | function SecureRandom() {}
function parseBigInt (line 1744) | function parseBigInt(str, r) {
function linebrk (line 1748) | function linebrk(s, n) {
function byte2Hex (line 1758) | function byte2Hex(b) {
function pkcs1pad2 (line 1764) | function pkcs1pad2(s, n) {
function RSAKey (line 1787) | function RSAKey() {
function RSASetPublic (line 1799) | function RSASetPublic(N, E) {
function RSADoPublic (line 1807) | function RSADoPublic(x) {
function RSAEncrypt (line 1812) | function RSAEncrypt(text) {
function pkcs1unpad2 (line 1838) | function pkcs1unpad2(d, n) {
function RSASetPrivate (line 1851) | function RSASetPrivate(N, E, D) {
function RSASetPrivateEx (line 1860) | function RSASetPrivateEx(N, E, D, P, Q, DP, DQ, C) {
function RSAGenerate (line 1874) | function RSAGenerate(B, E) {
function RSADoPrivate (line 1918) | function RSADoPrivate(x) {
function RSADecrypt (line 1936) | function RSADecrypt(ctext) {
function encrypt (line 1983) | function encrypt() {
function decrypt (line 1999) | function decrypt() {
FILE: benchmarks/v8-v7/deltablue.js
function Inheriter (line 46) | function Inheriter() {}
function OrderedCollection (line 52) | function OrderedCollection() {
function Strength (line 97) | function Strength(strengthValue, name) {
function Constraint (line 155) | function Constraint(strength) {
function UnaryConstraint (line 213) | function UnaryConstraint(v, strength) {
function StayConstraint (line 295) | function StayConstraint(v, str) {
function EditConstraint (line 313) | function EditConstraint(v, str) {
function BinaryConstraint (line 343) | function BinaryConstraint(var1, var2, strength) {
function ScaleConstraint (line 462) | function ScaleConstraint(src, scale, offset, dest, strength) {
function EqualityConstraint (line 522) | function EqualityConstraint(var1, var2, strength) {
function Variable (line 545) | function Variable(name, initialValue) {
function Planner (line 578) | function Planner() {
function Plan (line 760) | function Plan() {
function chainTest (line 800) | function chainTest(n) {
function projectionTest (line 834) | function projectionTest(n) {
function change (line 864) | function change(v, newValue) {
function deltaBlue (line 879) | function deltaBlue() {
FILE: benchmarks/v8-v7/earley-boyer.js
function sc_print_debug (line 50) | function sc_print_debug() {
function sc_alert (line 60) | function sc_alert() {
function sc_typeof (line 73) | function sc_typeof(x) {
function sc_error (line 78) | function sc_error() {
function sc_raise (line 89) | function sc_raise(obj) {
function sc_withHandlerLambda (line 94) | function sc_withHandlerLambda(handler, body) {
function sc_putpropBang (line 106) | function sc_putpropBang(sym, key, val) {
function sc_getprop (line 116) | function sc_getprop(sym, key) {
function sc_rempropBang (line 125) | function sc_rempropBang(sym, key) {
function sc_any2String (line 131) | function sc_any2String(o) {
function sc_isEqv (line 139) | function sc_isEqv(o1, o2) {
function sc_isEq (line 147) | function sc_isEq(o1, o2) {
function sc_isNumber (line 154) | function sc_isNumber(n) {
function sc_isComplex (line 161) | function sc_isComplex(n) {
function sc_isReal (line 168) | function sc_isReal(n) {
function sc_isRational (line 175) | function sc_isRational(n) {
function sc_isInteger (line 182) | function sc_isInteger(n) {
function sc_isExact (line 191) | function sc_isExact(n) {
function sc_isInexact (line 199) | function sc_isInexact(n) {
function sc_equal (line 207) | function sc_equal(x) {
function sc_less (line 217) | function sc_less(x) {
function sc_greater (line 229) | function sc_greater(x, y) {
function sc_lessEqual (line 241) | function sc_lessEqual(x, y) {
function sc_greaterEqual (line 253) | function sc_greaterEqual(x, y) {
function sc_isZero (line 265) | function sc_isZero(x) {
function sc_isPositive (line 273) | function sc_isPositive(x) {
function sc_isNegative (line 281) | function sc_isNegative(x) {
function sc_isOdd (line 289) | function sc_isOdd(x) {
function sc_isEven (line 297) | function sc_isEven(x) {
function sc_plus (line 309) | function sc_plus() {
function sc_multi (line 318) | function sc_multi() {
function sc_minus (line 327) | function sc_minus(x) {
function sc_div (line 339) | function sc_div(x) {
function sc_quotient (line 354) | function sc_quotient(x, y) {
function sc_remainder (line 361) | function sc_remainder(x, y) {
function sc_modulo (line 368) | function sc_modulo(x, y) {
function sc_euclid_gcd (line 375) | function sc_euclid_gcd(a, b) {
function sc_gcd (line 404) | function sc_gcd() {
function sc_lcm (line 412) | function sc_lcm() {
function sc_exact2inexact (line 475) | function sc_exact2inexact(x) {
function sc_inexact2exact (line 482) | function sc_inexact2exact(x) {
function sc_number2jsstring (line 486) | function sc_number2jsstring(x, radix) {
function sc_jsstring2number (line 491) | function sc_jsstring2number(s, radix) {
function sc_not (line 520) | function sc_not(b) {
function sc_isBoolean (line 527) | function sc_isBoolean(b) {
function sc_Pair (line 531) | function sc_Pair(car, cdr) {
function sc_isPair (line 572) | function sc_isPair(p) {
function sc_isPairEqual (line 576) | function sc_isPairEqual(p1, p2, comp) {
function sc_cons (line 583) | function sc_cons(car, cdr) {
function sc_consStar (line 588) | function sc_consStar() {
function sc_car (line 598) | function sc_car(p) {
function sc_cdr (line 605) | function sc_cdr(p) {
function sc_setCarBang (line 612) | function sc_setCarBang(p, val) {
function sc_setCdrBang (line 619) | function sc_setCdrBang(p, val) {
function sc_caar (line 626) | function sc_caar(p) {
function sc_cadr (line 632) | function sc_cadr(p) {
function sc_cdar (line 638) | function sc_cdar(p) {
function sc_cddr (line 644) | function sc_cddr(p) {
function sc_caaar (line 650) | function sc_caaar(p) {
function sc_cadar (line 656) | function sc_cadar(p) {
function sc_caadr (line 662) | function sc_caadr(p) {
function sc_caddr (line 668) | function sc_caddr(p) {
function sc_cdaar (line 674) | function sc_cdaar(p) {
function sc_cdadr (line 680) | function sc_cdadr(p) {
function sc_cddar (line 686) | function sc_cddar(p) {
function sc_cdddr (line 692) | function sc_cdddr(p) {
function sc_caaaar (line 698) | function sc_caaaar(p) {
function sc_caadar (line 704) | function sc_caadar(p) {
function sc_caaadr (line 710) | function sc_caaadr(p) {
function sc_caaddr (line 716) | function sc_caaddr(p) {
function sc_cdaaar (line 722) | function sc_cdaaar(p) {
function sc_cdadar (line 728) | function sc_cdadar(p) {
function sc_cdaadr (line 734) | function sc_cdaadr(p) {
function sc_cdaddr (line 740) | function sc_cdaddr(p) {
function sc_cadaar (line 746) | function sc_cadaar(p) {
function sc_caddar (line 752) | function sc_caddar(p) {
function sc_cadadr (line 758) | function sc_cadadr(p) {
function sc_cadddr (line 764) | function sc_cadddr(p) {
function sc_cddaar (line 770) | function sc_cddaar(p) {
function sc_cdddar (line 776) | function sc_cdddar(p) {
function sc_cddadr (line 782) | function sc_cddadr(p) {
function sc_cddddr (line 788) | function sc_cddddr(p) {
function sc_lastPair (line 793) | function sc_lastPair(l) {
function sc_isNull (line 808) | function sc_isNull(o) {
function sc_isList (line 815) | function sc_isList(o) {
function sc_list (line 833) | function sc_list() {
function sc_iota (line 841) | function sc_iota(num, init) {
function sc_makeList (line 849) | function sc_makeList(nbEls, fill) {
function sc_length (line 856) | function sc_length(l) {
function sc_remq (line 866) | function sc_remq(o, l) {
function sc_remqBang (line 880) | function sc_remqBang(o, l) {
function sc_delete (line 901) | function sc_delete(o, l) {
function sc_deleteBang (line 915) | function sc_deleteBang(o, l) {
function sc_reverseAppendBang (line 935) | function sc_reverseAppendBang(l1, l2) {
function sc_dualAppend (line 946) | function sc_dualAppend(l1, l2) {
function sc_append (line 954) | function sc_append() {
function sc_dualAppendBang (line 962) | function sc_dualAppendBang(l1, l2) {
function sc_appendBang (line 972) | function sc_appendBang() {
function sc_reverse (line 980) | function sc_reverse(l1) {
function sc_reverseBang (line 990) | function sc_reverseBang(l) {
function sc_listTail (line 995) | function sc_listTail(l, k) {
function sc_listRef (line 1004) | function sc_listRef(l, k) {
function sc_memq (line 1024) | function sc_memq(o, l) {
function sc_memv (line 1032) | function sc_memv(o, l) {
function sc_member (line 1040) | function sc_member(o, l) {
function sc_assq (line 1063) | function sc_assq(o, al) {
function sc_assv (line 1071) | function sc_assv(o, al) {
function sc_assoc (line 1079) | function sc_assoc(o, al) {
function sc_isCharStringEqual (line 1088) | function sc_isCharStringEqual(cs1, cs2) {
function sc_isCharStringLess (line 1091) | function sc_isCharStringLess(cs1, cs2) {
function sc_isCharStringGreater (line 1094) | function sc_isCharStringGreater(cs1, cs2) {
function sc_isCharStringLessEqual (line 1097) | function sc_isCharStringLessEqual(cs1, cs2) {
function sc_isCharStringGreaterEqual (line 1100) | function sc_isCharStringGreaterEqual(cs1, cs2) {
function sc_isCharStringCIEqual (line 1103) | function sc_isCharStringCIEqual(cs1, cs2) {
function sc_isCharStringCILess (line 1106) | function sc_isCharStringCILess(cs1, cs2) {
function sc_isCharStringCIGreater (line 1109) | function sc_isCharStringCIGreater(cs1, cs2) {
function sc_isCharStringCILessEqual (line 1112) | function sc_isCharStringCILessEqual(cs1, cs2) {
function sc_isCharStringCIGreaterEqual (line 1115) | function sc_isCharStringCIGreaterEqual(cs1, cs2) {
function sc_Char (line 1119) | function sc_Char(c) {
function sc_isChar (line 1232) | function sc_isChar(c) {
function sc_isCharOfClass (line 1292) | function sc_isCharOfClass(c, cl) {
function sc_isCharAlphabetic (line 1298) | function sc_isCharAlphabetic(c) {
function sc_isCharNumeric (line 1308) | function sc_isCharNumeric(c) {
function sc_isCharWhitespace (line 1314) | function sc_isCharWhitespace(c) {
function sc_isCharUpperCase (line 1324) | function sc_isCharUpperCase(c) {
function sc_isCharLowerCase (line 1331) | function sc_isCharLowerCase(c) {
function sc_char2integer (line 1338) | function sc_char2integer(c) {
function sc_integer2char (line 1344) | function sc_integer2char(n) {
function sc_charUpcase (line 1351) | function sc_charUpcase(c) {
function sc_charDowncase (line 1357) | function sc_charDowncase(c) {
function sc_makeJSStringOfLength (line 1361) | function sc_makeJSStringOfLength(k, c) {
function sc_makejsString (line 1376) | function sc_makejsString(k, c) {
function sc_jsstring2list (line 1383) | function sc_jsstring2list(s) {
function sc_list2jsstring (line 1390) | function sc_list2jsstring(l) {
function sc_isVector (line 1420) | function sc_isVector(v) {
function sc_isVectorEqual (line 1425) | function sc_isVectorEqual(v1, v2, comp) {
function sc_makeVector (line 1432) | function sc_makeVector(size, fill) {
function sc_vector (line 1441) | function sc_vector() {
function sc_vectorLength (line 1450) | function sc_vectorLength(v) {
function sc_vectorRef (line 1457) | function sc_vectorRef(v, pos) {
function sc_vectorSetBang (line 1464) | function sc_vectorSetBang(v, pos, val) {
function sc_vector2list (line 1469) | function sc_vector2list(a) {
function sc_list2vector (line 1476) | function sc_list2vector(l) {
function sc_vectorFillBang (line 1486) | function sc_vectorFillBang(a, fill) {
function sc_copyVector (line 1491) | function sc_copyVector(a, len) {
function sc_vectorCopy (line 1503) | function sc_vectorCopy(a, start, end) {
function sc_vectorCopyBang (line 1508) | function sc_vectorCopyBang(target, tstart, source, sstart, send) {
function sc_isProcedure (line 1530) | function sc_isProcedure(o) {
function sc_apply (line 1535) | function sc_apply(proc) {
function sc_map (line 1548) | function sc_map(proc, l1) {
function sc_mapBang (line 1565) | function sc_mapBang(proc, l1) {
function sc_forEach (line 1583) | function sc_forEach(proc, l1) {
function sc_filter (line 1600) | function sc_filter(proc, l1) {
function sc_filterBang (line 1614) | function sc_filterBang(proc, l1) {
function sc_filterMap1 (line 1629) | function sc_filterMap1(proc, l1) {
function sc_filterMap2 (line 1638) | function sc_filterMap2(proc, l1, l2) {
function sc_filterMap (line 1650) | function sc_filterMap(proc, l1, l2, l3) {
function sc_any (line 1669) | function sc_any(proc, l) {
function sc_anyPred (line 1682) | function sc_anyPred(proc, l) {
function sc_every (line 1687) | function sc_every(proc, l) {
function sc_everyPred (line 1701) | function sc_everyPred(proc, l) {
function sc_force (line 1710) | function sc_force(o) {
function sc_makePromise (line 1715) | function sc_makePromise(proc) {
function sc_Values (line 1730) | function sc_Values(values) {
function sc_values (line 1737) | function sc_values() {
function sc_callWithValues (line 1743) | function sc_callWithValues(producer, consumer) {
function sc_dynamicWind (line 1751) | function sc_dynamicWind(before, thunk, after) {
function sc_Struct (line 1766) | function sc_Struct(name) {
function sc_makeStruct (line 1777) | function sc_makeStruct(name) {
function sc_isStruct (line 1785) | function sc_isStruct(o) {
function sc_isStructNamed (line 1793) | function sc_isStructNamed(name, s) {
function sc_getStructField (line 1800) | function sc_getStructField(s, name, field) {
function sc_setStructFieldBang (line 1807) | function sc_setStructFieldBang(s, name, field, val) {
function sc_bitNot (line 1814) | function sc_bitNot(x) {
function sc_bitAnd (line 1821) | function sc_bitAnd(x, y) {
function sc_bitOr (line 1828) | function sc_bitOr(x, y) {
function sc_bitXor (line 1835) | function sc_bitXor(x, y) {
function sc_bitLsh (line 1842) | function sc_bitLsh(x, y) {
function sc_bitRsh (line 1849) | function sc_bitRsh(x, y) {
function sc_bitUrsh (line 1856) | function sc_bitUrsh(x, y) {
function sc_jsField (line 1863) | function sc_jsField(o, field) {
function sc_setJsFieldBang (line 1870) | function sc_setJsFieldBang(o, field, val) {
function sc_deleteJsFieldBang (line 1877) | function sc_deleteJsFieldBang(o, field) {
function sc_jsCall (line 1884) | function sc_jsCall(o, fun) {
function sc_jsMethodCall (line 1893) | function sc_jsMethodCall(o, field) {
function sc_jsNew (line 1902) | function sc_jsNew(c) {
function sc_pregexp (line 1913) | function sc_pregexp(re) {
function sc_pregexpMatch (line 1918) | function sc_pregexpMatch(re, s) {
function sc_pregexpReplace (line 1936) | function sc_pregexpReplace(re, s1, s2) {
function sc_pregexpReplaceAll (line 1952) | function sc_pregexpReplaceAll(re, s1, s2) {
function sc_pregexpSplit (line 1968) | function sc_pregexpSplit(re, s) {
function sc_random (line 1985) | function sc_random(n) {
function sc_currentDate (line 1992) | function sc_currentDate() {
function sc_Hashtable (line 1996) | function sc_Hashtable() {}
function sc_HashtableElement (line 2002) | function sc_HashtableElement(key, val) {
function sc_makeHashtable (line 2010) | function sc_makeHashtable() {
function sc_hashtablePutBang (line 2015) | function sc_hashtablePutBang(ht, key, val) {
function sc_hashtableGet (line 2021) | function sc_hashtableGet(ht, key) {
function sc_hashtableForEach (line 2028) | function sc_hashtableForEach(ht, f) {
function sc_hashtableContains (line 2037) | function sc_hashtableContains(ht, key) {
function sc_hash (line 2045) | function sc_hash(o) {
function sc_counterHash (line 2055) | function sc_counterHash() {
function sc_Trampoline (line 2063) | function sc_Trampoline(args, maxTailCalls) {
function sc_bindExitLambda (line 2082) | function sc_bindExitLambda(proc) {
function sc_BindExitException (line 2097) | function sc_BindExitException() {
function sc_EOF (line 2111) | function sc_EOF() {}
function sc_Port (line 2114) | function sc_Port() {}
function sc_InputPort (line 2118) | function sc_InputPort() {}
function sc_ErrorInputPort (line 2138) | function sc_ErrorInputPort() {}
function sc_StringInputPort (line 2149) | function sc_StringInputPort(jsStr) {
function sc_Token (line 2163) | function sc_Token(type, val, pos) {
function sc_Tokenizer (line 2191) | function sc_Tokenizer(port) {
function isNumberChar (line 2208) | function isNumberChar(c) {
function isIdOrNumberChar (line 2211) | function isIdOrNumberChar(c) {
function isWhitespace (line 2217) | function isWhitespace(c) {
function isWhitespaceOrEOF (line 2220) | function isWhitespaceOrEOF(c) {
function readString (line 2224) | function readString() {
function readIdOrNumber (line 2303) | function readIdOrNumber(firstChar) {
function skipWhitespaceAndComments (line 2310) | function skipWhitespaceAndComments() {
function readDot (line 2326) | function readDot() {
function readSharp (line 2331) | function readSharp() {
function sc_Reader (line 2442) | function sc_Reader(tokenizer) {
function readList (line 2447) | function readList(listBeginType) {
function readQuote (line 2490) | function readQuote() {
function readVector (line 2493) | function readVector() {
function storeRefence (line 2509) | function storeRefence(nb) {
function readReference (line 2515) | function readReference(nb) {
function sc_read (line 2558) | function sc_read(port) {
function sc_readChar (line 2566) | function sc_readChar(port) {
function sc_peekChar (line 2574) | function sc_peekChar(port) {
function sc_isCharReady (line 2584) | function sc_isCharReady(port) {
function sc_closeInputPort (line 2593) | function sc_closeInputPort(p) {
function sc_isInputPort (line 2601) | function sc_isInputPort(o) {
function sc_isEOFObject (line 2609) | function sc_isEOFObject(o) {
function sc_currentInputPort (line 2616) | function sc_currentInputPort() {
function sc_callWithInputFile (line 2622) | function sc_callWithInputFile(s, proc) {
function sc_callWithOutputFile (line 2627) | function sc_callWithOutputFile(s, proc) {
function sc_withInputFromFile (line 2632) | function sc_withInputFromFile(s, thunk) {
function sc_withOutputToFile (line 2637) | function sc_withOutputToFile(s, thunk) {
function sc_openInputFile (line 2642) | function sc_openInputFile(s) {
function sc_openOutputFile (line 2647) | function sc_openOutputFile(s) {
function sc_basename (line 2653) | function sc_basename(p) {
function sc_dirname (line 2661) | function sc_dirname(p) {
function sc_withInputFromPort (line 2671) | function sc_withInputFromPort(p, thunk) {
function sc_withInputFromString (line 2682) | function sc_withInputFromString(s, thunk) {
function sc_withOutputToPort (line 2690) | function sc_withOutputToPort(p, thunk) {
function sc_withOutputToString (line 2701) | function sc_withOutputToString(thunk) {
function sc_withOutputToProcedure (line 2708) | function sc_withOutputToProcedure(proc, thunk) {
function sc_openOutputString (line 2718) | function sc_openOutputString() {
function sc_openInputString (line 2723) | function sc_openInputString(str) {
function sc_OutputPort (line 2729) | function sc_OutputPort() {}
function sc_StringOutputPort (line 2738) | function sc_StringOutputPort() {
function sc_getOutputString (line 2750) | function sc_getOutputString(sp) {
function sc_ErrorOutputPort (line 2754) | function sc_ErrorOutputPort() {}
function sc_GenericOutputPort (line 2763) | function sc_GenericOutputPort(appendJSString, close) {
function sc_isOutputPort (line 2773) | function sc_isOutputPort(o) {
function sc_closeOutputPort (line 2780) | function sc_closeOutputPort(p) {
function sc_write (line 2787) | function sc_write(o, p) {
function sc_toWriteString (line 2794) | function sc_toWriteString(o) {
function sc_escapeWriteString (line 2804) | function sc_escapeWriteString(s) {
function sc_display (line 2874) | function sc_display(o, p) {
function sc_toDisplayString (line 2881) | function sc_toDisplayString(o) {
function sc_newline (line 2894) | function sc_newline(p) {
function sc_writeChar (line 2904) | function sc_writeChar(c, p) {
function sc_writeCircle (line 2914) | function sc_writeCircle(o, p) {
function sc_toWriteCircleString (line 2921) | function sc_toWriteCircleString(o) {
function sc_prepWriteCircle (line 2929) | function sc_prepWriteCircle(o, symb, nbPointer) {
function sc_genToWriteCircleString (line 2950) | function sc_genToWriteCircleString(o, symb) {
function sc_print (line 3035) | function sc_print(s) {
function sc_format (line 3047) | function sc_format(s, args) {
function sc_jsstring2string (line 3172) | function sc_jsstring2string(s) {
function sc_jsstring2symbol (line 3179) | function sc_jsstring2symbol(s) {
function sc_string2jsstring (line 3186) | function sc_string2jsstring(s) {
function sc_symbol2jsstring (line 3193) | function sc_symbol2jsstring(s) {
function sc_keyword2jsstring (line 3200) | function sc_keyword2jsstring(k) {
function sc_jsstring2keyword (line 3207) | function sc_jsstring2keyword(s) {
function sc_isKeyword (line 3214) | function sc_isKeyword(s) {
function sc_isEqual (line 3231) | function sc_isEqual(o1, o2) {
function sc_number2symbol (line 3240) | function sc_number2symbol(x, radix) {
function sc_symbol2number (line 3248) | function sc_symbol2number(s, radix) {
function sc_string2integer (line 3259) | function sc_string2integer(s, radix) {
function sc_string2real (line 3267) | function sc_string2real(s) {
function sc_isSymbol (line 3274) | function sc_isSymbol(s) {
function sc_symbol2string (line 3281) | function sc_symbol2string(s) {
function sc_string2symbol (line 3288) | function sc_string2symbol(s) {
function sc_symbolAppend (line 3295) | function sc_symbolAppend() {
function sc_char2string (line 3304) | function sc_char2string(c) {
function sc_char2symbol (line 3311) | function sc_char2symbol(c) {
function sc_isString (line 3318) | function sc_isString(s) {
function sc_string (line 3326) | function sc_string() {
function sc_stringLength (line 3334) | function sc_stringLength(s) {
function sc_stringRef (line 3339) | function sc_stringRef(s, k) {
function sc_isStringEqual (line 3351) | function sc_isStringEqual(s1, s2) {
function sc_isStringLess (line 3358) | function sc_isStringLess(s1, s2) {
function sc_isStringGreater (line 3365) | function sc_isStringGreater(s1, s2) {
function sc_isStringLessEqual (line 3372) | function sc_isStringLessEqual(s1, s2) {
function sc_isStringGreaterEqual (line 3379) | function sc_isStringGreaterEqual(s1, s2) {
function sc_isStringCIEqual (line 3386) | function sc_isStringCIEqual(s1, s2) {
function sc_isStringCILess (line 3393) | function sc_isStringCILess(s1, s2) {
function sc_isStringCIGreater (line 3400) | function sc_isStringCIGreater(s1, s2) {
function sc_isStringCILessEqual (line 3407) | function sc_isStringCILessEqual(s1, s2) {
function sc_isStringCIGreaterEqual (line 3414) | function sc_isStringCIGreaterEqual(s1, s2) {
function sc_substring (line 3421) | function sc_substring(s, start, end) {
function sc_isSubstring_at (line 3427) | function sc_isSubstring_at(s1, s2, i) {
function sc_stringAppend (line 3434) | function sc_stringAppend() {
function sc_stringCopy (line 3447) | function sc_stringCopy(s) {
function sc_keyword2string (line 3458) | function sc_keyword2string(o) {
function sc_string2keyword (line 3465) | function sc_string2keyword(o) {
function RunBenchmark (line 8764) | function RunBenchmark(name, count, run, warn) {
FILE: benchmarks/v8-v7/index.js
function PrintResult (line 42) | function PrintResult(name, result) {
function PrintError (line 46) | function PrintError(name, error) {
function PrintScore (line 51) | function PrintScore(score) {
FILE: benchmarks/v8-v7/navier-stokes.js
function runNavierStokes (line 38) | function runNavierStokes() {
function setupNavierStokes (line 42) | function setupNavierStokes() {
function tearDownNavierStokes (line 51) | function tearDownNavierStokes() {
function addPoints (line 55) | function addPoints(field) {
function prepareFrame (line 70) | function prepareFrame(field) {
function FluidField (line 81) | function FluidField(canvas) {
FILE: benchmarks/v8-v7/raytrace.js
function renderScene (line 864) | function renderScene() {
FILE: benchmarks/v8-v7/regexp.js
function RegExpSetup (line 45) | function RegExpSetup() {
function RegExpRun (line 50) | function RegExpRun() {
function RegExpTearDown (line 54) | function RegExpTearDown() {
function computeInputVariants (line 61) | function computeInputVariants(str, n) {
function RegExpBenchmark (line 74) | function RegExpBenchmark() {
FILE: benchmarks/v8-v7/richards.js
function runRichards (line 44) | function runRichards() {
function Scheduler (line 100) | function Scheduler() {
function TaskControlBlock (line 261) | function TaskControlBlock(link, id, priority, queue, task) {
function IdleTask (line 369) | function IdleTask(scheduler, v1, count) {
function DeviceTask (line 397) | function DeviceTask(scheduler) {
function WorkerTask (line 425) | function WorkerTask(scheduler, v1, v2) {
function HandlerTask (line 460) | function HandlerTask(scheduler) {
function Packet (line 516) | function Packet(link, id, kind) {
FILE: benchmarks/v8-v7/splay.js
function GeneratePayloadTree (line 47) | function GeneratePayloadTree(depth, tag) {
function GenerateKey (line 61) | function GenerateKey() {
function InsertNewNode (line 67) | function InsertNewNode() {
function SplaySetup (line 78) | function SplaySetup() {
function SplayTearDown (line 83) | function SplayTearDown() {
function SplayRun (line 104) | function SplayRun() {
function SplayTree (line 122) | function SplayTree() {}
FILE: build.mjs
constant TMP_DIR (line 10) | const TMP_DIR = `.tmp-llrt-aws-sdk`;
constant SRC_DIR (line 11) | const SRC_DIR = path.join("llrt_core", "src", "modules", "js");
constant TESTS_DIR (line 12) | const TESTS_DIR = "tests";
constant TESTS_SUB_DIR (line 13) | const TESTS_SUB_DIR = process.env.TEST_SUB_DIR || "unit";
constant OUT_DIR (line 14) | const OUT_DIR = "bundle/js";
constant SHIMS (line 15) | const SHIMS = new Map();
constant SDK_BUNDLE_MODE (line 16) | const SDK_BUNDLE_MODE = process.env.SDK_BUNDLE_MODE || "NONE";
function readFilesRecursive (line 18) | async function readFilesRecursive(dir, filePredicate) {
constant TEST_FILES (line 34) | const TEST_FILES = await readFilesRecursive(
constant AWS_JSON_SHARED_COMMAND_REGEX (line 41) | const AWS_JSON_SHARED_COMMAND_REGEX =
constant AWS_JSON_SHARED_COMMAND_REGEX2 (line 43) | const AWS_JSON_SHARED_COMMAND_REGEX2 =
constant MINIFY_JS (line 45) | const MINIFY_JS = process.env.JS_MINIFY !== "0";
constant SDK_UTILS_PACKAGE (line 46) | const SDK_UTILS_PACKAGE = "sdk-utils";
constant ENTRYPOINTS (line 47) | const ENTRYPOINTS = [
constant ES_BUILD_OPTIONS (line 54) | const ES_BUILD_OPTIONS = {
constant SDK_DATA (line 120) | const SDK_DATA = await parseSdkData();
constant ADDITIONAL_PACKAGES (line 122) | const ADDITIONAL_PACKAGES = [
constant REPLACEMENT_PACKAGES (line 167) | const REPLACEMENT_PACKAGES = {
constant SERVICE_ENDPOINTS_BY_PACKAGE (line 175) | const SERVICE_ENDPOINTS_BY_PACKAGE = {};
constant CLIENTS_BY_SDK (line 176) | const CLIENTS_BY_SDK = {};
constant SDKS_BY_SDK_PACKAGES (line 177) | const SDKS_BY_SDK_PACKAGES = {};
constant SDK_PACKAGES (line 178) | const SDK_PACKAGES = [...ADDITIONAL_PACKAGES];
function parseSdkData (line 191) | async function parseSdkData() {
function resolveDefaultsModeConfigWrapper (line 221) | function resolveDefaultsModeConfigWrapper(config) {
function defaultEndpointResolver (line 241) | function defaultEndpointResolver(endpointParams, context = {}) {
constant WRAPPERS (line 268) | const WRAPPERS = [
function executeClientCommand (line 276) | function executeClientCommand(command, optionsOrCb, cb) {
constant ENDPOINT_CACHE_KEY_LOOKUP (line 288) | const ENDPOINT_CACHE_KEY_LOOKUP = {
constant ENDPOINT_CACHE_KEY_LOOKUP_NAME (line 300) | const ENDPOINT_CACHE_KEY_LOOKUP_NAME = Object.keys({
function calculateEndpointCacheKey (line 304) | function calculateEndpointCacheKey(obj) {
function codeToRegex (line 316) | function codeToRegex(fn, includeSignature = false) {
constant AWS_SDK_PLUGIN (line 342) | const AWS_SDK_PLUGIN = {
method setup (line 344) | setup(build) {
function esbuildShimPlugin (line 516) | function esbuildShimPlugin(shims) {
method setup (line 546) | setup(build) {
function rmTmpDir (line 553) | async function rmTmpDir() {
function createOutputDirectories (line 560) | async function createOutputDirectories() {
function loadShims (line 567) | async function loadShims() {
function buildLibrary (line 592) | async function buildLibrary() {
function buildSdks (line 629) | async function buildSdks() {
FILE: example/clear-ddb-table.mjs
constant DDB_CLIENT (line 9) | const DDB_CLIENT = new DynamoDBClient({});
constant TABLE_ARN (line 11) | const TABLE_ARN = process.argv[2];
function extractRegionAndTableName (line 27) | function extractRegionAndTableName(arn) {
class AsyncProcessor (line 45) | class AsyncProcessor {
method constructor (line 46) | constructor(producerFunction, consumerFunction) {
method emptyJob (line 51) | static emptyJob() {
method process (line 61) | async process() {
function deleteItems (line 109) | async function deleteItems(tableName, primaryKey, keys) {
function clearDynamoDBTable (line 147) | async function clearDynamoDBTable() {
function getPrimaryKey (line 194) | async function getPrimaryKey(tableName) {
FILE: example/functions/build.mjs
constant OUTDIR (line 5) | const OUTDIR = "build";
function buildReact (line 9) | async function buildReact() {
function buildExternalSdkFunction (line 47) | async function buildExternalSdkFunction() {
FILE: example/functions/src/api.ts
constant CLIENT (line 19) | const CLIENT = new DynamoDBClient({});
constant DOCUMENT_CLIENT (line 20) | const DOCUMENT_CLIENT = DynamoDBDocumentClient.from(CLIENT as any);
constant API (line 37) | const API = {
FILE: example/functions/src/react/App.tsx
type Props (line 5) | type Props = {
function App (line 10) | function App({ todoItems = [], releaseName = "" }: Props) {
FILE: example/functions/src/react/CreateTodo.tsx
type Props (line 1) | type Props = {
function CreateTodo (line 5) | function CreateTodo({ onCreate }: Props) {
FILE: example/functions/src/react/TodoItem.tsx
type Props (line 3) | type Props = {
function TodoItem (line 9) | function TodoItem({
FILE: example/functions/src/react/TodoList.tsx
type Props (line 6) | type Props = {
type Todo (line 10) | type Todo = {
constant BASE_URL (line 17) | const BASE_URL = `${(globalThis.window && window.location.href) || "/"}a...
constant API (line 19) | const API = {
function TodoList (line 55) | function TodoList({ items: initialItems }: Props) {
FILE: example/functions/src/ssr.ts
type Method (line 8) | type Method = "GET" | "POST" | "PUT" | "DELETE";
type ResponseOptions (line 10) | type ResponseOptions = {
constant ASSET_CACHE (line 17) | const ASSET_CACHE: Record<string, string> = {};
constant MIME_TYPES (line 18) | const MIME_TYPES = {
class HttpError (line 32) | class HttpError extends Error {
method constructor (line 34) | constructor(status: number, message: string) {
FILE: example/register-hooks/hooks/calc.js
method resolve (line 4) | resolve(specifier, context, nextResolve) {
method load (line 13) | load(url, context, nextLoad) {
FILE: example/register-hooks/hooks/fs.js
method resolve (line 4) | resolve(specifier, context, nextResolve) {
method load (line 15) | load(url, context, nextLoad) {
FILE: example/register-hooks/hooks/http.js
method resolve (line 5) | resolve(specifier, context, nextResolve) {
method load (line 14) | load(url, context, nextLoad) {
FILE: example/register-hooks/hooks/v8.js
method resolve (line 4) | resolve(specifier, context, nextResolve) {
method load (line 13) | load(url, context, nextLoad) {
FILE: example/register-hooks/src/http.js
function createServer (line 58) | function createServer(listener) {
FILE: fixtures/node_modules/elem-uuid/dist/commonjs-browser/index.js
function require1 (line 7) | function require1(hello) {
FILE: fixtures/require.mjs
function main (line 1) | async function main() {
FILE: fixtures/test1245/index.js
function bar (line 1) | function bar() {
FILE: fixtures/test903/bar.mjs
function bar (line 1) | function bar() {
FILE: fixtures/test_modules/test-uuid.js
function _interopRequireDefault (line 4) | function _interopRequireDefault(e) {
FILE: lambda-server.js
constant PORT (line 4) | const PORT = 3000;
constant BASE_PATH (line 5) | const BASE_PATH = "/2018-06-01/runtime";
constant ARGS (line 6) | const ARGS = process.argv.slice(2);
FILE: libs/llrt_build/src/lib.rs
function set_nightly_cfg (line 1) | pub fn set_nightly_cfg() {
FILE: libs/llrt_compression/src/lib.rs
function encoder (line 11) | pub fn encoder<R: Read>(r: R, level: i32) -> Result<ZstdEncoder<'static,...
function decoder (line 15) | pub fn decoder<R: Read>(r: R) -> Result<ZstdDecoder<'static, BufReader<R...
function encoder (line 27) | pub fn encoder<R: Read>(r: R, level: Compression) -> DeflateEncoder<R> {
function decoder (line 31) | pub fn decoder<R: Read>(r: R) -> DeflateDecoder<R> {
function encoder (line 43) | pub fn encoder<R: Read>(r: R, level: Compression) -> GzEncoder<R> {
function decoder (line 47) | pub fn decoder<R: Read>(r: R) -> GzDecoder<R> {
function encoder (line 59) | pub fn encoder<R: Read>(r: R, level: Compression) -> ZlibEncoder<R> {
function decoder (line 63) | pub fn decoder<R: Read>(r: R) -> ZlibDecoder<R> {
function encoder (line 74) | pub fn encoder<R: BufRead>(r: R) -> BrotliEncoder<R> {
function decoder (line 78) | pub fn decoder<R: BufRead>(r: R) -> BrotliDecoder<R> {
function encoder (line 89) | pub fn encoder<R: Read>(r: R) -> BrotliEncoder<R> {
function decoder (line 93) | pub fn decoder<R: Read>(r: R) -> BrotliDecoder<R> {
FILE: libs/llrt_context/src/lib.rs
type CtxExtension (line 15) | pub trait CtxExtension<'js> {
method spawn_exit (line 18) | fn spawn_exit<F, R>(&self, future: F) -> Result<Receiver<R>>
method spawn_exit_simple (line 23) | fn spawn_exit_simple<F>(&self, future: F)
function spawn_exit (line 29) | fn spawn_exit<F, R>(&self, future: F) -> Result<Receiver<R>>
function spawn_exit_simple (line 55) | fn spawn_exit_simple<F>(&self, future: F)
function handle_spawn_error (line 68) | fn handle_spawn_error<'js>(ctx: &Ctx<'js>, err: CaughtError<'js>, stack:...
function set_spawn_error_handler (line 87) | pub fn set_spawn_error_handler<F>(handler: F)
FILE: libs/llrt_dns_cache/src/lib.rs
type SocketAddrs (line 20) | pub struct SocketAddrs {
type Item (line 25) | type Item = SocketAddr;
method next (line 27) | fn next(&mut self) -> Option<SocketAddr> {
type CacheEntry (line 33) | struct CacheEntry {
type CacheConcurrencyGuard (line 39) | struct CacheConcurrencyGuard {
method new (line 44) | fn new(permits: u8) -> Self {
type CachedDnsResolver (line 53) | pub struct CachedDnsResolver {
type Response (line 60) | type Response = SocketAddrs;
type Error (line 61) | type Error = io::Error;
type Future (line 62) | type Future = Pin<Box<dyn Future<Output = std::io::Result<Self::Respon...
method poll_ready (line 64) | fn poll_ready(&mut self, _cx: &mut task::Context<'_>) -> Poll<std::io:...
method call (line 68) | fn call(&mut self, name: Name) -> Self::Future {
method new (line 126) | pub fn new() -> Self {
method with_options (line 130) | pub fn with_options(size: usize, concurrency: u8, ttl: u64) -> Self {
method into_http_connector (line 138) | pub fn into_http_connector(self) -> HttpConnector<Self> {
method default (line 120) | fn default() -> Self {
FILE: libs/llrt_encoding/build.rs
function main (line 3) | fn main() {
FILE: libs/llrt_encoding/src/lib.rs
type Encoder (line 9) | pub enum Encoder {
method from_optional_str (line 58) | pub fn from_optional_str(encoding: Option<&str>) -> Result<Self, Strin...
method from_str (line 66) | pub fn from_str(encoding: &str) -> Result<Self, String> {
method encode_to_string (line 73) | pub fn encode_to_string(&self, bytes: &[u8], lossy: bool) -> Result<St...
method encode (line 84) | pub fn encode(&self, bytes: &[u8]) -> Result<Vec<u8>, String> {
method decode (line 92) | pub fn decode<'a, T: Into<Cow<'a, [u8]>>>(&self, bytes: T) -> Result<V...
method decode_from_string (line 102) | pub fn decode_from_string(&self, string: String) -> Result<Vec<u8>, St...
method as_label (line 118) | pub fn as_label(&self) -> &str {
constant ENCODING_MAP (line 18) | const ENCODING_MAP: phf::Map<&'static str, Encoder> = phf::phf_map! {
function bytes_to_hex (line 130) | pub fn bytes_to_hex(bytes: &[u8]) -> Vec<u8> {
function bytes_from_hex (line 134) | pub fn bytes_from_hex<'a, T: Into<Cow<'a, [u8]>>>(hex_bytes: T) -> Resul...
function bytes_from_b64 (line 138) | pub fn bytes_from_b64<'a, T: Into<Cow<'a, [u8]>>>(base64_bytes: T) -> Re...
function bytes_to_b64_string (line 160) | pub fn bytes_to_b64_string(bytes: &[u8]) -> String {
function bytes_to_b64_url_safe_string (line 164) | pub fn bytes_to_b64_url_safe_string(bytes: &[u8]) -> String {
function bytes_from_b64_url_safe (line 168) | pub fn bytes_from_b64_url_safe(bytes: &[u8]) -> Result<Vec<u8>, String> {
function bytes_to_b64 (line 174) | pub fn bytes_to_b64(bytes: &[u8]) -> Vec<u8> {
function bytes_to_hex_string (line 178) | pub fn bytes_to_hex_string(bytes: &[u8]) -> String {
function bytes_to_utf8_string (line 182) | pub fn bytes_to_utf8_string(bytes: &[u8], lossy: bool) -> Result<String,...
type Endian (line 191) | pub enum Endian {
function bytes_to_utf16_string (line 196) | pub fn bytes_to_utf16_string(bytes: &[u8], endian: Endian, lossy: bool) ...
FILE: libs/llrt_hooking/src/lib.rs
type HookType (line 13) | pub enum HookType {
function invoke_async_hook (line 19) | pub fn invoke_async_hook(
function register_finalization_registry (line 72) | pub fn register_finalization_registry<'js>(
FILE: libs/llrt_json/benches/json.rs
function generate_json (line 15) | fn generate_json(child_json: &str, size: usize) -> String {
function criterion_benchmark (line 37) | pub fn criterion_benchmark(c: &mut Criterion) {
FILE: libs/llrt_json/build.rs
function main (line 1) | fn main() {
FILE: libs/llrt_json/src/escape.rs
constant ESCAPE_LEN (line 29) | const ESCAPE_LEN: usize = 34;
function write_surrogate_escape (line 32) | fn write_surrogate_escape(result: &mut String, bytes: &[u8], i: usize) -...
function escape_json (line 55) | pub fn escape_json(bytes: &[u8]) -> String {
function process_byte (line 62) | fn process_byte(
function escape_json_string_simple (line 91) | pub fn escape_json_string_simple(result: &mut String, bytes: &[u8]) {
function escape_json_string (line 118) | pub fn escape_json_string(result: &mut String, bytes: &[u8]) {
function escape_json_simple (line 127) | fn escape_json_simple() {
function escape_json_quotes (line 132) | fn escape_json_quotes() {
function escape_json_backslash (line 137) | fn escape_json_backslash() {
function escape_json_newline (line 142) | fn escape_json_newline() {
function escape_json_tab (line 147) | fn escape_json_tab() {
function escape_json_unicode (line 152) | fn escape_json_unicode() {
function escape_json_special_characters (line 160) | fn escape_json_special_characters() {
function escape_json_mixed_characters (line 168) | fn escape_json_mixed_characters() {
FILE: libs/llrt_json/src/lib.rs
function redefine_static_methods (line 16) | pub fn redefine_static_methods(ctx: &Ctx<'_>) -> Result<()> {
function json_parser (line 66) | async fn json_parser() {
function json_parse_non_string (line 93) | async fn json_parse_non_string() {
function json_stringify_undefined (line 114) | async fn json_stringify_undefined() {
function json_stringify_objects (line 138) | async fn json_stringify_objects() {
function huge_numbers (line 150) | async fn huge_numbers() {
function json_circular_ref (line 170) | async fn json_circular_ref() {
FILE: libs/llrt_json/src/parse.rs
function json_parse_string (line 8) | pub fn json_parse_string<'js>(ctx: Ctx<'js>, bytes: ObjectBytes<'js>) ->...
function json_parse (line 13) | pub fn json_parse<'js, T: Into<Vec<u8>>>(ctx: &Ctx<'js>, json: T) -> Res...
function static_node_to_value (line 52) | fn static_node_to_value<'js>(ctx: &Ctx<'js>, node: StaticNode) -> Result...
function parse_node (line 62) | fn parse_node<'js>(ctx: &Ctx<'js>, tape: &[Node], index: usize) -> Resul...
FILE: libs/llrt_json/src/stringify.rs
constant CIRCULAR_REF_DETECTION_DEPTH (line 12) | const CIRCULAR_REF_DETECTION_DEPTH: usize = 20;
type StringifyContext (line 14) | struct StringifyContext<'a, 'js> {
function json_stringify (line 31) | pub fn json_stringify<'js>(ctx: &Ctx<'js>, value: Value<'js>) -> Result<...
function json_stringify_replacer (line 36) | pub fn json_stringify_replacer<'js>(
function json_stringify_replacer_space (line 44) | pub fn json_stringify_replacer_space<'js>(
function write_indentation (line 118) | fn write_indentation(result: &mut String, indentation: Option<&str>, dep...
function run_to_json (line 127) | fn run_to_json<'js>(
type PrimitiveStatus (line 165) | enum PrimitiveStatus<'js> {
function run_replacer (line 173) | fn run_replacer<'js>(
function write_primitive (line 197) | fn write_primitive<'js>(
function write_primitive2 (line 208) | fn write_primitive2<'js>(
function write_indented_separator (line 312) | fn write_indented_separator(
function detect_circular_reference (line 327) | fn detect_circular_reference(
function append_value (line 386) | fn append_value(context: &mut StringifyContext<'_, '_>, add_comma: bool)...
function write_key (line 399) | fn write_key(string: &mut String, key: &str, indent: bool) {
function write_sep (line 409) | fn write_sep(result: &mut String, add_comma: bool, has_indentation: bool) {
function write_string (line 419) | fn write_string(string: &mut String, value: &str) {
function get_key_or_index (line 426) | fn get_key_or_index<'a>(
function iterate (line 434) | fn iterate<'js>(
FILE: libs/llrt_logging/src/lib.rs
constant NEWLINE (line 34) | pub const NEWLINE: char = '\n';
constant CARRIAGE_RETURN (line 35) | pub const CARRIAGE_RETURN: char = '\r';
constant SPACING (line 36) | const SPACING: char = ' ';
constant CIRCULAR (line 37) | const CIRCULAR: &str = "[Circular]";
constant TIME_FORMAT (line 38) | pub const TIME_FORMAT: &str = "%Y-%m-%dT%H:%M:%S%.3fZ";
constant MAX_INDENTATION_LEVEL (line 40) | const MAX_INDENTATION_LEVEL: usize = 4;
constant MAX_EXPANSION_DEPTH (line 41) | const MAX_EXPANSION_DEPTH: usize = 4;
constant INDENTATION_LOOKUP (line 42) | const INDENTATION_LOOKUP: [&str; MAX_INDENTATION_LEVEL + 1] =
method push (line 68) | fn push(self, value: &mut String) {
method reset (line 73) | fn reset(value: &mut String) {
type LogLevel (line 93) | pub enum LogLevel {
method to_string (line 115) | pub fn to_string(&self) -> String {
method from_str (line 127) | pub fn from_str(s: &str) -> Self {
type PushByte (line 102) | trait PushByte {
method push_byte (line 103) | fn push_byte(&mut self, byte: u8);
method push_byte (line 107) | fn push_byte(&mut self, byte: u8) {
type FormatOptions (line 140) | pub struct FormatOptions<'js> {
function new (line 153) | pub fn new(ctx: &Ctx<'js>, color: bool, newline: bool) -> Result<Self> {
function format_plain (line 182) | pub fn format_plain<'js>(ctx: Ctx<'js>, newline: bool, args: Rest<Value<...
function format (line 186) | pub fn format<'js>(ctx: &Ctx<'js>, newline: bool, args: Rest<Value<'js>>...
function format_values (line 190) | pub fn format_values<'js>(
function build_formatted_string (line 202) | pub fn build_formatted_string<'js>(
function format_raw (line 301) | fn format_raw<'js>(
function format_raw_inner (line 310) | fn format_raw_inner<'js>(
function get_lossy_string (line 606) | pub fn get_lossy_string(string_value: Value) -> Result<String> {
function format_raw_string (line 633) | fn format_raw_string(result: &mut String, value: String, options: &Forma...
function format_raw_string_inner (line 637) | fn format_raw_string_inner(result: &mut String, value: String, quoted: b...
function write_object (line 650) | fn write_object<'js>(
function write_sep (line 790) | fn write_sep(result: &mut String, add_comma: bool, has_indentation: bool...
function push_indentation (line 807) | fn push_indentation(result: &mut String, depth: usize) {
function replace_newline_with_carriage_return (line 811) | pub fn replace_newline_with_carriage_return(result: &mut str) {
function replace_invalid_utf8_and_utf16 (line 823) | fn replace_invalid_utf8_and_utf16(bytes: &[u8]) -> String {
function print_error_and_exit (line 917) | pub fn print_error_and_exit<'js>(ctx: &Ctx<'js>, err: CaughtError<'js>) ...
function print_error (line 940) | fn print_error<'js>(ctx: &Ctx<'js>, args: Rest<Value<'js>>) -> Result<()> {
FILE: libs/llrt_numbers/benches/numbers.rs
function criterion_benchmark (line 18) | fn criterion_benchmark(c: &mut Criterion) {
FILE: libs/llrt_numbers/src/lib.rs
constant DIGITS (line 11) | const DIGITS: &[u8] = b"0123456789abcdefghijklmnopqrstuvwxyz";
constant BUF_SIZE (line 12) | const BUF_SIZE: usize = 80;
constant BIN_MAX_DIGITS (line 13) | const BIN_MAX_DIGITS: usize = 64;
constant OCT_MAX_DIGITS (line 14) | const OCT_MAX_DIGITS: usize = 21;
function redefine_prototype (line 16) | pub fn redefine_prototype(ctx: &Ctx<'_>) -> Result<()> {
function to_dec (line 25) | pub fn to_dec(number: i64) -> String {
function to_base_less_than_10 (line 30) | pub fn to_base_less_than_10(buf: &mut [u8], num: i64, base: i64) -> Stri...
function i64_to_base_n (line 56) | pub fn i64_to_base_n(number: i64, radix: u8) -> String {
function internal_i64_to_base_n (line 88) | fn internal_i64_to_base_n(buf: &mut [u8], number: i64, radix: u8) -> usi...
function next_up (line 108) | fn next_up(num: f64) -> f64 {
function fractional_to_base (line 129) | fn fractional_to_base(buf: &mut [u8], mut index: usize, mut number: f64,...
function f64_to_base_n (line 180) | fn f64_to_base_n(number: f64, radix: u8) -> String {
function float_to_string (line 222) | pub fn float_to_string(float: f64) -> String {
function get_nonfinite (line 228) | fn get_nonfinite<'a>(bits: u64) -> &'a str {
function check_radix (line 242) | fn check_radix(ctx: &Ctx, radix: u8) -> Result<()> {
function number_to_string (line 249) | fn number_to_string<'js>(
function test_base_conversions (line 294) | fn test_base_conversions() {
FILE: libs/llrt_test/src/lib.rs
function given_file (line 16) | pub async fn given_file(content: &str) -> PathBuf {
type TestResolver (line 23) | struct TestResolver;
method resolve (line 26) | fn resolve(&mut self, _ctx: &Ctx<'_>, base: &str, name: &str) -> Result<...
function given_runtime (line 39) | pub async fn given_runtime() -> (AsyncRuntime, AsyncContext) {
function test_async_with (line 48) | pub async fn test_async_with<F>(func: F)
type TestOptions (line 57) | pub struct TestOptions {
method new (line 62) | pub fn new() -> Self {
method no_pending_jobs (line 66) | pub fn no_pending_jobs(mut self) -> Self {
function test_async_with_opts (line 72) | pub async fn test_async_with_opts<F>(func: F, options: TestOptions)
function test_sync_with (line 89) | pub async fn test_sync_with<F>(func: F)
function call_test (line 98) | pub async fn call_test<'js, T, A>(ctx: &Ctx<'js>, module: &Module<'js, E...
function call_test_err (line 106) | pub async fn call_test_err<'js, T, A>(
type ModuleEvaluator (line 125) | pub struct ModuleEvaluator;
method eval_js (line 128) | pub async fn eval_js<'js>(
method eval_rust (line 138) | pub async fn eval_rust<'js, M>(ctx: Ctx<'js>, name: &str) -> Result<Mo...
FILE: libs/llrt_test_tls/src/api.rs
function echo (line 5) | pub(crate) async fn echo(req: Request<Incoming>) -> Result<Response<Full...
FILE: libs/llrt_test_tls/src/config.rs
type FileType (line 4) | pub enum FileType {
method default_path (line 11) | pub fn default_path(&self) -> PathBuf {
type MockServerCerts (line 22) | pub struct MockServerCerts {
method load_default (line 29) | pub async fn load_default() -> Result<Self, Box<dyn std::error::Error ...
FILE: libs/llrt_test_tls/src/lib.rs
type MockServer (line 26) | pub struct MockServer {
method start (line 33) | pub async fn start() -> Result<Self, Box<dyn std::error::Error + Send ...
method address (line 57) | pub fn address(&self) -> SocketAddr {
method ca (line 61) | pub fn ca(&self) -> &str {
method drop (line 67) | fn drop(&mut self) {
FILE: libs/llrt_test_tls/src/server.rs
function get_crypto_provider (line 42) | fn get_crypto_provider() -> Arc<rustls::crypto::CryptoProvider> {
function get_crypto_provider (line 47) | fn get_crypto_provider() -> Arc<rustls::crypto::CryptoProvider> {
function get_crypto_provider (line 52) | fn get_crypto_provider() -> Arc<rustls::crypto::CryptoProvider> {
function run (line 57) | pub(super) async fn run(
function run (line 105) | pub(super) async fn run(
FILE: libs/llrt_utils/src/any_of.rs
function test_any_of_string_number (line 155) | fn test_any_of_string_number() {
function test_any_of_fallback (line 178) | fn test_any_of_fallback() {
function test_any_of_into_js (line 194) | fn test_any_of_into_js() {
function test_any_of_methods (line 212) | fn test_any_of_methods() {
function test_any_of_mutable_methods (line 241) | fn test_any_of_mutable_methods() {
function test_any_of_error_propagation (line 258) | fn test_any_of_error_propagation() {
function test_any_of_conversion_order (line 278) | fn test_any_of_conversion_order() {
FILE: libs/llrt_utils/src/bytearray_buffer.rs
type BytearrayBuffer (line 15) | pub struct BytearrayBuffer {
method new (line 25) | pub fn new(capacity: usize) -> Self {
method len (line 38) | pub fn len(&self) -> usize {
method is_empty (line 42) | pub fn is_empty(&self) -> bool {
method write_forced (line 47) | pub fn write_forced(&self, item: &[u8]) {
method write (line 55) | pub async fn write(&self, item: &mut [u8]) -> usize {
method is_closed (line 86) | pub fn is_closed(&self) -> bool {
method close (line 90) | pub async fn close(&self) {
method clear (line 97) | pub async fn clear(&self) {
method read (line 107) | pub fn read(&self, desired_size: Option<usize>) -> Option<Vec<u8>> {
function clear_while_writing (line 151) | async fn clear_while_writing() {
function write_one_at_a_time (line 164) | async fn write_one_at_a_time() {
function queue (line 196) | async fn queue() {
FILE: libs/llrt_utils/src/bytes.rs
type ObjectBytes (line 16) | pub enum ObjectBytes<'js> {
type Changed (line 33) | type Changed<'to> = ObjectBytes<'to>;
function trace (line 37) | fn trace<'a>(&self, tracer: Tracer<'a, 'js>) {
function into_js (line 56) | fn into_js(self, ctx: &Ctx<'js>) -> Result<Value<'js>> {
type Error (line 78) | type Error = Rc<str>;
function try_from (line 79) | fn try_from(value: ObjectBytes<'js>) -> std::result::Result<Self, Self::...
type Error (line 85) | type Error = Rc<str>;
function try_from (line 86) | fn try_from(value: &'a ObjectBytes<'js>) -> std::result::Result<Self, Se...
function from_js (line 92) | fn from_js(ctx: &Ctx<'js>, value: Value<'js>) -> Result<Self> {
function from (line 98) | pub fn from(ctx: &Ctx<'js>, value: &Value<'js>) -> Result<Self> {
function from_offset (line 102) | pub fn from_offset(
function as_bytes (line 134) | pub fn as_bytes(&self, ctx: &Ctx<'js>) -> Result<&[u8]> {
function as_bytes_inner (line 138) | fn as_bytes_inner(&self) -> std::result::Result<&[u8], Rc<str>> {
function into_bytes (line 156) | pub fn into_bytes(self, ctx: &Ctx<'_>) -> Result<Vec<u8>> {
function into_bytes_inner (line 160) | fn into_bytes_inner(self) -> std::result::Result<Vec<u8>, Rc<str>> {
function from_array_buffer (line 167) | pub fn from_array_buffer(obj: &Object<'js>) -> Result<Option<ObjectBytes...
function get_array_buffer (line 220) | pub fn get_array_buffer(&self) -> Result<Option<(ArrayBuffer<'js>, usize...
function get_start_end_indexes (line 310) | pub fn get_start_end_indexes(
function get_array_bytes (line 328) | pub fn get_array_bytes(
function get_coerced_string_bytes (line 349) | pub fn get_coerced_string_bytes(
function bytes_from_js_string (line 360) | fn bytes_from_js_string(string: String, offset: usize, length: Option<us...
function get_string_bytes (line 366) | pub fn get_string_bytes(
function bytes_to_typed_array (line 378) | pub fn bytes_to_typed_array<'js>(ctx: Ctx<'js>, bytes: &[u8]) -> Result<...
FILE: libs/llrt_utils/src/class.rs
type IteratorDef (line 14) | pub trait IteratorDef<'js>
method js_entries (line 18) | fn js_entries(&self, ctx: Ctx<'js>) -> Result<Array<'js>>;
method js_iterator (line 20) | fn js_iterator(&self, ctx: Ctx<'js>) -> Result<Value<'js>> {
function get_class_name (line 28) | pub fn get_class_name(value: &Value) -> Result<Option<String>> {
function get_class (line 35) | pub fn get_class<'js, C>(provided: &Value<'js>) -> Result<Option<Class<'...
type CustomInspectExtension (line 49) | pub trait CustomInspectExtension<'js> {
method define_with_custom_inspect (line 50) | fn define_with_custom_inspect(globals: &Object<'js>) -> Result<()>;
type CustomInspect (line 53) | pub trait CustomInspect<'js>
method custom_inspect (line 57) | fn custom_inspect(&self, ctx: Ctx<'js>) -> Result<Object<'js>>;
function define_with_custom_inspect (line 64) | fn define_with_custom_inspect(globals: &Object<'js>) -> Result<()> {
FILE: libs/llrt_utils/src/clone.rs
type StackItem (line 18) | enum StackItem<'js> {
type ObjectType (line 24) | enum ObjectType {
type TapeValue (line 30) | enum TapeValue<'js> {
type TapeItem (line 38) | struct TapeItem<'js> {
function structured_clone (line 45) | pub fn structured_clone<'js>(
function append_buffer (line 277) | fn append_buffer<'js>(
function append_collection (line 300) | fn append_collection<'js>(
function check_circular (line 324) | fn check_circular(
function append_transfer_value (line 344) | fn append_transfer_value<'js>(
function append_circular (line 368) | fn append_circular(
function append_ctor_value (line 394) | fn append_ctor_value<'js>(
function clone (line 423) | async fn clone() {
function clone_circular (line 470) | async fn clone_circular() {
FILE: libs/llrt_utils/src/ctx.rs
type CtxExt (line 5) | pub trait CtxExt {
method get_script_or_module_name (line 6) | fn get_script_or_module_name(&self) -> Result<String>;
method get_script_or_module_name (line 10) | fn get_script_or_module_name(&self) -> Result<String> {
FILE: libs/llrt_utils/src/error.rs
type ErrorExtensions (line 5) | pub trait ErrorExtensions<'js> {
method into_value (line 6) | fn into_value(self, ctx: &Ctx<'js>) -> Result<Value<'js>>;
method into_value (line 10) | fn into_value(self, ctx: &Ctx<'js>) -> Result<Value<'js>> {
function into_value (line 16) | fn into_value(self, ctx: &Ctx<'js>) -> Result<Value<'js>> {
FILE: libs/llrt_utils/src/error_messages.rs
constant ERROR_MSG_NOT_ARRAY_BUFFER (line 1) | pub const ERROR_MSG_NOT_ARRAY_BUFFER: &str = "Not an ArrayBuffer";
constant ERROR_MSG_ARRAY_BUFFER_DETACHED (line 2) | pub const ERROR_MSG_ARRAY_BUFFER_DETACHED: &str = "ArrayBuffer is detach...
constant ERROR_MSG_BROADCAST_LAGGED (line 3) | pub const ERROR_MSG_BROADCAST_LAGGED: &str = "Lagged too much behind";
FILE: libs/llrt_utils/src/fs.rs
type DirectoryWalker (line 7) | pub struct DirectoryWalker<T>
function new (line 21) | pub fn new(root: PathBuf, filter: T) -> Self {
function set_recursive (line 30) | pub fn set_recursive(&mut self, recursive: bool) {
function walk (line 34) | pub async fn walk(&mut self) -> io::Result<Option<(PathBuf, Metadata)>> {
function walk_sync (line 52) | pub fn walk_sync(&mut self) -> io::Result<Option<(PathBuf, Metadata)>> {
function append_stack (line 70) | async fn append_stack(&mut self, dir: &PathBuf) -> io::Result<()> {
function append_stack_sync (line 87) | fn append_stack_sync(&mut self, dir: &PathBuf) -> io::Result<()> {
FILE: libs/llrt_utils/src/hash.rs
function default_hash (line 4) | pub fn default_hash<T: Hash + ?Sized>(v: &T) -> usize {
FILE: libs/llrt_utils/src/latch.rs
type Latch (line 8) | pub struct Latch {
method increment (line 14) | pub fn increment(&self) {
method decrement (line 18) | pub fn decrement(&self) {
method wait (line 25) | pub async fn wait(&self) {
FILE: libs/llrt_utils/src/lib.rs
constant VERSION (line 32) | pub const VERSION: &str = env!("CARGO_PKG_VERSION");
FILE: libs/llrt_utils/src/mc_oneshot.rs
type Shared (line 17) | pub struct Shared<T> {
type Sender (line 24) | pub struct Sender<T: Clone>(Arc<Shared<T>>);
type Target (line 27) | type Target = Arc<Shared<T>>;
method deref (line 28) | fn deref(&self) -> &Self::Target {
function trace (line 34) | fn trace<'a>(&self, tracer: Tracer<'a, 'js>) {
function send (line 44) | pub fn send(&self, value: T) {
function subscribe (line 52) | pub fn subscribe(&self) -> Receiver<T> {
type Receiver (line 58) | pub struct Receiver<T: Clone>(Arc<Shared<T>>);
type Target (line 61) | type Target = Arc<Shared<T>>;
method deref (line 62) | fn deref(&self) -> &Self::Target {
function recv (line 68) | pub async fn recv(&self) -> T {
function channel (line 76) | pub fn channel<T: Clone>() -> (Sender<T>, Receiver<T>) {
function test (line 91) | async fn test() {
FILE: libs/llrt_utils/src/module.rs
type ModuleInfo (line 8) | pub struct ModuleInfo<T: ModuleDef> {
function export_default (line 13) | pub fn export_default<'js, F>(ctx: &Ctx<'js>, exports: &Exports<'js>, f:...
FILE: libs/llrt_utils/src/object.rs
type ObjectExt (line 12) | pub trait ObjectExt<'js> {
method get_optional (line 13) | fn get_optional<K: IntoAtom<'js> + Clone, V: FromJs<'js>>(&self, k: K)...
method get_required (line 14) | fn get_required<K: AsRef<str>, V: FromJs<'js>>(
method into_object_or_throw (line 19) | fn into_object_or_throw(self, ctx: &Ctx<'js>, object_name: &'static str)
function get_optional (line 24) | fn get_optional<K: IntoAtom<'js> + Clone, V: FromJs<'js> + Sized>(
function get_required (line 31) | fn get_required<K: AsRef<str>, V: FromJs<'js>>(
function into_object_or_throw (line 45) | fn into_object_or_throw(self, _: &Ctx<'js>, _: &'static str) -> Result<O...
function get_optional (line 51) | fn get_optional<K: IntoAtom<'js> + Clone, V: FromJs<'js>>(&self, k: K) -...
function get_required (line 58) | fn get_required<K: AsRef<str>, V: FromJs<'js>>(
function into_object_or_throw (line 68) | fn into_object_or_throw(
function not_a_object_error (line 78) | pub fn not_a_object_error(ctx: &Ctx<'_>, object_name: &str) -> Error {
type CreateSymbol (line 82) | pub trait CreateSymbol<'js> {
method for_description (line 83) | fn for_description(ctx: &Ctx<'js>, description: &str) -> Result<Symbol...
function for_description (line 87) | fn for_description(ctx: &Ctx<'js>, description: &str) -> Result<Symbol<'...
type Proxy (line 94) | pub struct Proxy<'js> {
function into_js (line 100) | fn into_js(self, ctx: &Ctx<'js>) -> Result<Value<'js>> {
function new (line 108) | pub fn new(ctx: Ctx<'js>) -> Result<Self> {
function with_target (line 116) | pub fn with_target(ctx: Ctx<'js>, target: Value<'js>) -> Result<Self> {
function setter (line 121) | pub fn setter<T, P>(&self, setter: Func<T, P>) -> Result<()>
function getter (line 129) | pub fn getter<T, P>(&self, getter: Func<T, P>) -> Result<()>
function map_to_entries (line 138) | pub fn map_to_entries<'js, K, V, M>(ctx: &Ctx<'js>, map: M) -> Result<Ar...
function array_to_btree_map (line 155) | pub fn array_to_btree_map<'js>(
function object_from_entries (line 164) | pub fn object_from_entries<'js>(ctx: &Ctx<'js>, array: Array<'js>) -> Re...
FILE: libs/llrt_utils/src/option.rs
type Undefined (line 9) | pub struct Undefined<T>(pub Option<T>);
function from_js (line 12) | fn from_js(ctx: &Ctx<'js>, value: Value<'js>) -> Result<Self> {
function into_js (line 22) | fn into_js(self, ctx: &Ctx<'js>) -> Result<Value<'js>> {
method default (line 31) | fn default() -> Self {
type Changed (line 37) | type Changed<'to> = Undefined<T::Changed<'to>>;
function trace (line 41) | fn trace<'a>(&self, tracer: Tracer<'a, 'js>) {
type Null (line 49) | pub struct Null<T>(pub Option<T>);
function from_js (line 52) | fn from_js(ctx: &Ctx<'js>, value: Value<'js>) -> Result<Self> {
function into_js (line 62) | fn into_js(self, ctx: &Ctx<'js>) -> Result<Value<'js>> {
type Changed (line 71) | type Changed<'to> = Null<T::Changed<'to>>;
function trace (line 75) | fn trace<'a>(&self, tracer: Tracer<'a, 'js>) {
type NullableOpt (line 81) | pub struct NullableOpt<T>(pub Option<T>);
function param_requirement (line 84) | fn param_requirement() -> ParamRequirement {
function from_param (line 88) | fn from_param<'a>(params: &mut ParamsAccessor<'a, 'js>) -> Result<Self> {
FILE: libs/llrt_utils/src/primordials.rs
type BasePrimordials (line 11) | pub struct BasePrimordials<'js> {
type Primordial (line 48) | pub trait Primordial<'js>
method get (line 52) | fn get<'a>(ctx: &'a Ctx<'js>) -> Result<UserDataGuard<'a, Self>> {
method init (line 66) | fn init<'a>(ctx: &'a Ctx<'js>) -> Result<()> {
method new (line 74) | fn new(ctx: &Ctx<'js>) -> Result<Self>;
function new (line 78) | fn new(ctx: &Ctx<'js>) -> Result<Self> {
FILE: libs/llrt_utils/src/provider.rs
type ProviderType (line 4) | pub enum ProviderType {
FILE: libs/llrt_utils/src/result.rs
type ResultExt (line 9) | pub trait ResultExt<T> {
method or_throw_msg (line 10) | fn or_throw_msg(self, ctx: &Ctx, msg: &str) -> Result<T>;
method or_throw_range (line 11) | fn or_throw_range(self, ctx: &Ctx, msg: &str) -> Result<T>;
method or_throw_type (line 12) | fn or_throw_type(self, ctx: &Ctx, msg: &str) -> Result<T>;
method or_throw (line 13) | fn or_throw(self, ctx: &Ctx) -> Result<T>;
type OptionExt (line 16) | pub trait OptionExt<T> {
method and_then_ok (line 17) | fn and_then_ok<U, E, F>(self, f: F) -> StdResult<Option<U>, E>
method unwrap_or_else_ok (line 21) | fn unwrap_or_else_ok<E, F>(self, f: F) -> StdResult<T, E>
function or_throw_msg (line 27) | fn or_throw_msg(self, ctx: &Ctx, msg: &str) -> Result<T> {
function or_throw_range (line 37) | fn or_throw_range(self, ctx: &Ctx, msg: &str) -> Result<T> {
function or_throw_type (line 49) | fn or_throw_type(self, ctx: &Ctx, msg: &str) -> Result<T> {
function or_throw (line 61) | fn or_throw(self, ctx: &Ctx) -> Result<T> {
function or_throw_msg (line 67) | fn or_throw_msg(self, ctx: &Ctx, msg: &str) -> Result<T> {
function or_throw_range (line 71) | fn or_throw_range(self, ctx: &Ctx, msg: &str) -> Result<T> {
function or_throw_type (line 75) | fn or_throw_type(self, ctx: &Ctx, msg: &str) -> Result<T> {
function or_throw (line 79) | fn or_throw(self, ctx: &Ctx) -> Result<T> {
function and_then_ok (line 85) | fn and_then_ok<U, E, F>(self, f: F) -> StdResult<Option<U>, E>
function unwrap_or_else_ok (line 95) | fn unwrap_or_else_ok<E, F>(self, f: F) -> StdResult<T, E>
FILE: libs/llrt_utils/src/reuse_list.rs
type ReuseList (line 4) | pub struct ReuseList<T> {
method fmt (line 13) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
function new (line 22) | pub fn new() -> Self {
function is_empty (line 27) | pub fn is_empty(&self) -> bool {
function with_capacity (line 32) | pub fn with_capacity(capacity: usize) -> Self {
function append (line 42) | pub fn append(&mut self, item: T) -> usize {
function remove (line 63) | pub fn remove(&mut self, index: usize) -> Option<T> {
function get (line 82) | pub fn get(&self, index: usize) -> Option<&T> {
function get_mut (line 90) | pub fn get_mut(&mut self, index: usize) -> Option<&mut T> {
function capacity (line 98) | pub fn capacity(&self) -> usize {
function len (line 102) | pub fn len(&self) -> usize {
function iter (line 106) | pub fn iter(&self) -> impl Iterator<Item = &T> {
function iter_mut (line 110) | pub fn iter_mut(&mut self) -> impl Iterator<Item = &mut T> {
function clear (line 115) | pub fn clear(&mut self) {
function optimize (line 123) | pub fn optimize(&mut self) {
function test_new (line 144) | fn test_new() {
function test_with_capacity (line 153) | fn test_with_capacity() {
function test_append (line 162) | fn test_append() {
function test_remove (line 176) | fn test_remove() {
function test_reuse_slots (line 194) | fn test_reuse_slots() {
function test_get (line 210) | fn test_get() {
function test_get_mut (line 223) | fn test_get_mut() {
function test_iter (line 238) | fn test_iter() {
function test_iter_mut (line 252) | fn test_iter_mut() {
function test_multiple_removes (line 269) | fn test_multiple_removes() {
function test_optimize (line 317) | fn test_optimize() {
FILE: libs/llrt_utils/src/signals.rs
function parse_signal (line 46) | pub fn parse_signal(signal: Option<Value<'_>>) -> Result<i32> {
function kill_process_raw (line 90) | pub fn kill_process_raw(pid: u32, signal: i32) -> io::Result<()> {
function kill_process_raw (line 101) | pub fn kill_process_raw(pid: u32, signal: i32) -> io::Result<()> {
function kill (line 127) | pub fn kill(ctx: &Ctx<'_>, pid: u32, signal: Opt<Value<'_>>) -> Result<b...
FILE: libs/llrt_utils/src/string.rs
function get_string (line 4) | pub fn get_string(value: &Value<'_>) -> Result<Option<String>> {
function get_coerced_string (line 12) | pub fn get_coerced_string(value: &Value<'_>) -> Option<String> {
FILE: libs/llrt_utils/src/sysinfo.rs
constant PLATFORM (line 2) | pub const PLATFORM: &str = "darwin";
constant PLATFORM (line 4) | pub const PLATFORM: &str = "win32";
constant PLATFORM (line 6) | pub const PLATFORM: &str = std::env::consts::OS;
constant ARCH (line 9) | pub const ARCH: &str = "x64";
constant ARCH (line 11) | pub const ARCH: &str = "arm64";
constant ARCH (line 13) | pub const ARCH: &str = std::env::consts::ARCH;
FILE: libs/llrt_utils/src/time.rs
function now_nanos (line 13) | pub fn now_nanos() -> u64 {
function now_millis (line 25) | pub fn now_millis() -> i64 {
function origin_nanos (line 37) | pub fn origin_nanos() -> u64 {
function init (line 42) | pub fn init() {
FILE: llrt/src/main.c
function memfd_create_syscall (line 29) | int memfd_create_syscall(const char *name, unsigned flags)
function initLoggingFlag (line 41) | void initLoggingFlag()
function getTimestamp (line 48) | void getTimestamp(char *timestampBuffer)
function printLog (line 61) | void printLog(const char *level, const char *format, va_list args)
function logInfo (line 71) | void logInfo(const char *format, ...)
function logWarn (line 84) | void logWarn(const char *format, ...)
function logError (line 97) | void logError(const char *format, ...)
function calculateSum (line 109) | static uint32_t calculateSum(uint32_t *array, uint8_t size)
function micro_seconds (line 119) | static double micro_seconds()
type DecompressThreadArgs (line 126) | typedef struct
function readData (line 153) | static void readData(
function decompress (line 177) | static void decompress(char **uncompressedData, uint32_t *uncompressedSi...
function main (line 249) | int main(int argc, char *argv[])
FILE: llrt/src/main.rs
function main (line 52) | async fn main() -> Result<ExitCode, Box<dyn Error + Send + Sync>> {
constant VERSION_STRING (line 72) | pub const VERSION_STRING: &str = concat!("LLRT v", VERSION, " (", PLATFO...
function print_version (line 74) | fn print_version() {
function usage (line 78) | fn usage() {
function start_runtime (line 116) | async fn start_runtime(vm: &Vm) {
function start_cli (line 129) | async fn start_cli(vm: &Vm) {
function run_tests (line 310) | async fn run_tests(vm: &Vm, args: &[std::string::String]) -> Result<(), ...
FILE: llrt/src/minimal_tracer.rs
type StringVisitor (line 16) | pub struct StringVisitor<'a> {
function new (line 20) | pub(crate) fn new(string: &'a mut String) -> Self {
method record_debug (line 26) | fn record_debug(&mut self, field: &Field, value: &dyn fmt::Debug) {
type LogFilter (line 35) | struct LogFilter {
type MinimalTracer (line 40) | pub struct MinimalTracer {
method register (line 57) | pub fn register() -> Result<(), tracing::subscriber::SetGlobalDefaultE...
function string_to_level (line 45) | fn string_to_level(string: &str) -> Option<Level> {
method enabled (line 91) | fn enabled(&self, metadata: &tracing::Metadata<'_>) -> bool {
method new_span (line 119) | fn new_span(&self, _span: &span::Attributes<'_>) -> span::Id {
method record (line 123) | fn record(&self, _span: &span::Id, _values: &span::Record<'_>) {}
method record_follows_from (line 125) | fn record_follows_from(&self, _span: &span::Id, _follows: &span::Id) {}
method event (line 127) | fn event(&self, event: &tracing::Event<'_>) {
method enter (line 143) | fn enter(&self, _span: &span::Id) {}
method exit (line 145) | fn exit(&self, _span: &span::Id) {}
FILE: llrt/src/repl.rs
function process_input (line 32) | async fn process_input(ctx: &Ctx<'_>, input: &str, tty: bool) -> String {
function run_repl (line 60) | pub(crate) async fn run_repl(ctx: &AsyncContext) {
function write_history (line 232) | fn write_history(history: &VecDeque<String>, history_file: Option<&Path>) {
function test_process_input (line 254) | async fn test_process_input() {
FILE: llrt_core/build.rs
constant BUNDLE_JS_DIR (line 20) | const BUNDLE_JS_DIR: &str = "../bundle/js";
function main (line 38) | fn main() -> StdResult<(), Box<dyn Error>> {
function generate_sdk_client_endpoint_map (line 56) | fn generate_sdk_client_endpoint_map(out_dir: &str) -> StdResult<(), Box<...
function generate_bytecode_cache (line 95) | fn generate_bytecode_cache(out_dir: &str) -> StdResult<(), Box<dyn Error...
function compress_bytecode (line 226) | fn compress_bytecode(dictionary_path: String, source_files: Vec<String>)...
function generate_compression_dictionary (line 273) | fn generate_compression_dictionary(
FILE: llrt_core/src/builtins_inspect.rs
function init (line 10) | pub fn init(ctx: &Ctx<'_>) -> Result<()> {
function map_inspect (line 43) | fn map_inspect<'js>(ctx: Ctx<'js>, this: This<Object<'js>>) -> Result<Ob...
function set_inspect (line 69) | fn set_inspect<'js>(ctx: Ctx<'js>, this: This<Object<'js>>) -> Result<Ob...
function dataview_inspect (line 94) | fn dataview_inspect<'js>(ctx: Ctx<'js>, this: This<Object<'js>>) -> Resu...
function arraybuffer_inspect (line 102) | fn arraybuffer_inspect<'js>(ctx: Ctx<'js>, this: This<Object<'js>>) -> R...
FILE: llrt_core/src/bytecode.rs
constant BYTECODE_VERSION (line 4) | pub const BYTECODE_VERSION: &str = "lrt01";
constant BYTECODE_COMPRESSED (line 5) | pub const BYTECODE_COMPRESSED: u8 = b'c';
constant BYTECODE_UNCOMPRESSED (line 6) | pub const BYTECODE_UNCOMPRESSED: u8 = b'u';
constant BYTECODE_SELF_CONTAINED_EXECUTABLE_MARKER (line 7) | pub const BYTECODE_SELF_CONTAINED_EXECUTABLE_MARKER: &[u8] = "lrtx".as_b...
constant SIGNATURE_LENGTH (line 19) | pub const SIGNATURE_LENGTH: usize = BYTECODE_VERSION.len() + 1;
function add_bytecode_header (line 22) | pub fn add_bytecode_header(bytes: Vec<u8>, file_size: Option<u32>) -> Ve...
FILE: llrt_core/src/compiler.rs
function compress_module (line 17) | fn compress_module(bytes: &[u8]) -> io::Result<Vec<u8>> {
function compile_file (line 26) | pub async fn compile_file(
FILE: llrt_core/src/compiler_common.rs
type DummyLoader (line 5) | pub struct DummyLoader;
method load (line 8) | fn load<'js>(
type DummyResolver (line 17) | pub struct DummyResolver;
method resolve (line 20) | fn resolve(
function human_file_size (line 30) | pub fn human_file_size(size: usize) -> String {
FILE: llrt_core/src/environment.rs
constant ENV_LLRT_NET_ALLOW (line 5) | pub const ENV_LLRT_NET_ALLOW: &str = "LLRT_NET_ALLOW";
constant ENV_LLRT_NET_DENY (line 6) | pub const ENV_LLRT_NET_DENY: &str = "LLRT_NET_DENY";
constant ENV_LLRT_NET_POOL_IDLE_TIMEOUT (line 7) | pub const ENV_LLRT_NET_POOL_IDLE_TIMEOUT: &str = "LLRT_NET_POOL_IDLE_TIM...
constant ENV_LLRT_HTTP_VERSION (line 8) | pub const ENV_LLRT_HTTP_VERSION: &str = "LLRT_HTTP_VERSION";
constant ENV_LLRT_TLS_VERSION (line 9) | pub const ENV_LLRT_TLS_VERSION: &str = "LLRT_TLS_VERSION";
constant ENV_LLRT_EXTRA_CA_CERTS (line 10) | pub const ENV_LLRT_EXTRA_CA_CERTS: &str = "LLRT_EXTRA_CA_CERTS";
constant ENV_LLRT_LOG (line 13) | pub const ENV_LLRT_LOG: &str = "LLRT_LOG";
constant ENV_LLRT_GC_THRESHOLD_MB (line 16) | pub const ENV_LLRT_GC_THRESHOLD_MB: &str = "LLRT_GC_THRESHOLD_MB";
constant ENV_LLRT_SDK_CONNECTION_WARMUP (line 19) | pub const ENV_LLRT_SDK_CONNECTION_WARMUP: &str = "LLRT_SDK_CONNECTION_WA...
constant ENV_LLRT_REGISTER_HOOKS (line 22) | pub const ENV_LLRT_REGISTER_HOOKS: &str = "LLRT_REGISTER_HOOKS";
FILE: llrt_core/src/http.rs
function init (line 22) | pub fn init() -> StdResult<(), Box<dyn std::error::Error + Send + Sync>> {
function build_pool_idle_timeout (line 45) | fn build_pool_idle_timeout() -> Option<u64> {
function build_extra_ca_certs (line 63) | fn build_extra_ca_certs() -> StdResult<Option<Vec<CertificateDer<'static...
function build_tls_versions (line 80) | fn build_tls_versions() -> Vec<&'static SupportedProtocolVersion> {
function build_tls_version_openssl (line 88) | fn build_tls_version_openssl() -> Option<openssl::ssl::SslVersion> {
function build_http_version (line 95) | fn build_http_version() -> HttpVersion {
FILE: llrt_core/src/modules/console.rs
function lambda_mode_initializer (line 36) | fn lambda_mode_initializer() {
type Console (line 48) | pub struct Console {}
method new (line 53) | pub fn new() -> Self {
method log (line 58) | pub fn log<'js>(&self, ctx: Ctx<'js>, args: Rest<Value<'js>>) -> Resul...
method clear (line 61) | pub fn clear(&self) {
method debug (line 64) | pub fn debug<'js>(&self, ctx: Ctx<'js>, args: Rest<Value<'js>>) -> Res...
method info (line 67) | pub fn info<'js>(&self, ctx: Ctx<'js>, args: Rest<Value<'js>>) -> Resu...
method trace (line 70) | pub fn trace<'js>(&self, ctx: Ctx<'js>, args: Rest<Value<'js>>) -> Res...
method error (line 73) | pub fn error<'js>(&self, ctx: Ctx<'js>, args: Rest<Value<'js>>) -> Res...
method warn (line 76) | pub fn warn<'js>(&self, ctx: Ctx<'js>, args: Rest<Value<'js>>) -> Resu...
method assert (line 79) | pub fn assert<'js>(
function log_fatal (line 89) | pub fn log_fatal<'js>(ctx: Ctx<'js>, args: Rest<Value<'js>>) -> Result<(...
function log_error (line 93) | pub fn log_error<'js>(ctx: Ctx<'js>, args: Rest<Value<'js>>) -> Result<(...
function log_warn (line 97) | fn log_warn<'js>(ctx: Ctx<'js>, args: Rest<Value<'js>>) -> Result<()> {
function log_debug (line 101) | fn log_debug<'js>(ctx: Ctx<'js>, args: Rest<Value<'js>>) -> Result<()> {
function log_trace (line 105) | fn log_trace<'js>(ctx: Ctx<'js>, args: Rest<Value<'js>>) -> Result<()> {
function log_assert (line 109) | fn log_assert<'js>(ctx: Ctx<'js>, expression: bool, args: Rest<Value<'js...
function log (line 116) | fn log<'js>(ctx: Ctx<'js>, args: Rest<Value<'js>>) -> Result<()> {
function clear (line 120) | fn clear() {
function write_log (line 127) | fn write_log<'js, T>(
function write_lambda_log (line 174) | fn write_lambda_log<'js>(
type ConsoleModule (line 328) | pub struct ConsoleModule;
method declare (line 331) | fn declare(declare: &Declarations) -> Result<()> {
method evaluate (line 338) | fn evaluate<'js>(ctx: &Ctx<'js>, exports: &Exports<'js>) -> Result<()> {
function from (line 348) | fn from(val: ConsoleModule) -> Self {
function init (line 356) | pub fn init(ctx: &Ctx<'_>) -> Result<()> {
function json_log_format (line 390) | async fn json_log_format() {
function standard_log_format (line 473) | async fn standard_log_format() {
FILE: llrt_core/src/modules/embedded/loader.rs
type EmbeddedLoader (line 24) | pub struct EmbeddedLoader;
method load_bytecode_module (line 27) | pub fn load_bytecode_module<'js>(ctx: Ctx<'js>, buf: &[u8]) -> Result<...
method uncompressed_size (line 33) | pub fn uncompressed_size(input: &[u8]) -> StdResult<(usize, &[u8]), io...
method get_module_bytecode (line 41) | fn get_module_bytecode(input: &[u8]) -> Result<Vec<u8>> {
method get_bytecode_signature (line 55) | fn get_bytecode_signature(input: &[u8]) -> StdResult<(&[u8], bool, &[u...
method normalize_name (line 90) | fn normalize_name(name: &str) -> (bool, bool, &str, &str) {
method load_module (line 110) | fn load_module<'js>(name: &str, ctx: &Ctx<'js>) -> Result<(Module<'js>...
method load (line 142) | fn load<'js>(&mut self, ctx: &Ctx<'js>, name: &str) -> Result<Module<'js...
function init_client_connection (line 155) | fn init_client_connection(ctx: &Ctx<'_>, specifier: &str) -> Result<()> {
function init_client_connection (line 174) | fn init_client_connection(ctx: &Ctx<'_>, specifier: &str) -> Result<()> {
FILE: llrt_core/src/modules/embedded/mod.rs
function init (line 18) | pub fn init(ctx: &Ctx) -> Result<()> {
FILE: llrt_core/src/modules/embedded/resolver.rs
type EmbeddedResolver (line 13) | pub struct EmbeddedResolver;
method resolve (line 17) | fn resolve(&mut self, _ctx: &Ctx, base: &str, name: &str) -> Result<Stri...
function embedded_resolve (line 29) | pub fn embedded_resolve<'a>(x: &'a str, y: &str) -> Result<Cow<'a, str>> {
FILE: llrt_core/src/modules/js/@llrt/expect/jest-asymmetric-matchers.ts
type AsymmetricMatcherInterface (line 33) | interface AsymmetricMatcherInterface {
method constructor (line 46) | constructor(
method [Symbol.for("chai/inspect")] (line 73) | [Symbol.for("chai/inspect")](options: { depth: number; truncate: number ...
class StringContaining (line 81) | class StringContaining extends AsymmetricMatcher<string> {
method constructor (line 82) | constructor(sample: string, inverse = false) {
method asymmetricMatch (line 88) | asymmetricMatch(other: string) {
method toString (line 94) | toString() {
method getExpectedType (line 98) | getExpectedType() {
class Anything (line 103) | class Anything extends AsymmetricMatcher<void> {
method asymmetricMatch (line 104) | asymmetricMatch(other: unknown) {
method toString (line 108) | toString() {
method toAsymmetricMatcher (line 112) | toAsymmetricMatcher() {
class ObjectContaining (line 117) | class ObjectContaining extends AsymmetricMatcher<
method constructor (line 120) | constructor(sample: Record<string, unknown>, inverse = false) {
method getPrototype (line 124) | getPrototype(obj: object) {
method hasProperty (line 132) | hasProperty(obj: object | null, property: string): boolean {
method asymmetricMatch (line 140) | asymmetricMatch(other: any) {
method toString (line 164) | toString() {
method getExpectedType (line 168) | getExpectedType() {
class ArrayContaining (line 173) | class ArrayContaining<T = unknown> extends AsymmetricMatcher<Array<T>> {
method constructor (line 174) | constructor(sample: Array<T>, inverse = false) {
method asymmetricMatch (line 178) | asymmetricMatch(other: Array<T>) {
method toString (line 196) | toString() {
method getExpectedType (line 200) | getExpectedType() {
class Any (line 205) | class Any extends AsymmetricMatcher<any> {
method constructor (line 206) | constructor(sample: unknown) {
method fnNameFor (line 216) | fnNameFor(func: Function) {
method asymmetricMatch (line 227) | asymmetricMatch(other: unknown) {
method toString (line 251) | toString() {
method getExpectedType (line 255) | getExpectedType() {
method toAsymmetricMatcher (line 269) | toAsymmetricMatcher() {
class StringMatching (line 274) | class StringMatching extends AsymmetricMatcher<RegExp> {
method constructor (line 275) | constructor(sample: string | RegExp, inverse = false) {
method asymmetricMatch (line 282) | asymmetricMatch(other: string) {
method toString (line 288) | toString() {
method getExpectedType (line 292) | getExpectedType() {
class CloseTo (line 297) | class CloseTo extends AsymmetricMatcher<number> {
method constructor (line 300) | constructor(sample: number, precision = 2, inverse = false) {
method asymmetricMatch (line 310) | asymmetricMatch(other: number) {
method toString (line 330) | toString() {
method getExpectedType (line 334) | override getExpectedType() {
method toAsymmetricMatcher (line 338) | override toAsymmetricMatcher(): string {
FILE: llrt_core/src/modules/js/@llrt/expect/jest-expect.ts
function def (line 53) | function def(
function assertTypes (line 626) | function assertTypes(
function recordAsyncExpect (line 639) | function recordAsyncExpect(
FILE: llrt_core/src/modules/js/@llrt/expect/jest-utils.ts
function isObject (line 27) | function isObject(item: unknown): boolean {
function equals (line 33) | function equals(
function isAsymmetric (line 45) | function isAsymmetric(obj: any) {
function hasAsymmetric (line 54) | function hasAsymmetric(obj: any, seen = new Set()): boolean {
function asymmetricMatch (line 66) | function asymmetricMatch(a: any, b: any) {
function eq (line 79) | function eq(
function keys (line 189) | function keys(obj: object, hasKey: (obj: object, key: string) => boolean) {
function hasDefinedKey (line 204) | function hasDefinedKey(obj: any, key: string) {
function hasKey (line 208) | function hasKey(obj: any, key: string) {
function isA (line 212) | function isA(typeName: string, value: unknown) {
function isDomNode (line 216) | function isDomNode(obj: any): boolean {
function fnNameFor (line 229) | function fnNameFor(func: Function) {
function getPrototype (line 238) | function getPrototype(obj: object) {
function hasProperty (line 246) | function hasProperty(obj: object | null, property: string): boolean {
constant IS_KEYED_SENTINEL (line 255) | const IS_KEYED_SENTINEL = "@@__IMMUTABLE_KEYED__@@";
constant IS_SET_SENTINEL (line 256) | const IS_SET_SENTINEL = "@@__IMMUTABLE_SET__@@";
constant IS_ORDERED_SENTINEL (line 257) | const IS_ORDERED_SENTINEL = "@@__IMMUTABLE_ORDERED__@@";
function isImmutableUnorderedKeyed (line 259) | function isImmutableUnorderedKeyed(maybeKeyed: any) {
function isImmutableUnorderedSet (line 267) | function isImmutableUnorderedSet(maybeSet: any) {
function hasIterator (line 284) | function hasIterator(object: any) {
function iterableEquality (line 288) | function iterableEquality(
function hasPropertyInObject (line 413) | function hasPropertyInObject(object: object, key: string): boolean {
function isObjectWithKeys (line 425) | function isObjectWithKeys(a: any) {
function subsetEquality (line 434) | function subsetEquality(
function typeEquality (line 477) | function typeEquality(a: any, b: any): boolean | undefined {
function arrayBufferEquality (line 484) | function arrayBufferEquality(
function sparseArrayEquality (line 514) | function sparseArrayEquality(
function generateToBeMessage (line 530) | function generateToBeMessage(
function pluralize (line 543) | function pluralize(word: string, count: number): string {
FILE: llrt_core/src/modules/js/@llrt/expect/stringify.ts
constant PLUGINS (line 43) | const PLUGINS = [
function stringify (line 52) | function stringify(
FILE: llrt_core/src/modules/js/@llrt/test/CircularBuffer.ts
class CircularBuffer (line 1) | class CircularBuffer {
method constructor (line 8) | constructor(maxSize: number, initialSize: number = maxSize / 8) {
method grow (line 17) | private grow(targetSize: number): void {
method clear (line 34) | clear() {
method append (line 39) | append(data: Uint8Array): void {
method getContent (line 73) | getContent(): Buffer {
FILE: llrt_core/src/modules/js/@llrt/test/Color.ts
constant NAMES (line 1) | const NAMES = [
type BgType (line 13) | type BgType<T extends string> = T extends `${infer A}${infer B}`
type BrightType (line 17) | type BrightType<T extends string> = `${T}Bright`;
type ColorNames (line 19) | type ColorNames = {
type Options (line 29) | type Options = {
class Color (line 39) | class Color {
method colorizer (line 73) | static colorizer(
type ColorizerReturnType (line 135) | type ColorizerReturnType = ((text: string) => string) & {
type ClassType (line 139) | type ClassType = typeof Color & {
FILE: llrt_core/src/modules/js/@llrt/test/SocketClient.ts
class SocketClient (line 4) | class SocketClient extends EventEmitter {
method constructor (line 16) | constructor(host: string, port: number) {
method connect (line 31) | public async connect(): Promise<void> {
method send (line 43) | public async send(data: string): Promise<Buffer> {
method processQueue (line 50) | private async processQueue(): Promise<void> {
method sendData (line 66) | private async sendData(data: string): Promise<void> {
method handleResponse (line 77) | private handleResponse(data: Buffer): void {
method close (line 85) | async close(): Promise<void> {
FILE: llrt_core/src/modules/js/@llrt/test/index.ts
constant IS_WINDOWS (line 9) | const IS_WINDOWS = platform() === "win32";
type TestOptions (line 14) | type TestOptions = {
type TestProps (line 18) | type TestProps = {
type TestResult (line 24) | type TestResult = TestProps & {
type SuiteResult (line 29) | type SuiteResult = TestProps & {
type RootSuite (line 36) | type RootSuite = TestProps & {
type WorkerData (line 42) | type WorkerData = {
class Color (line 58) | class Color {
type TestFailure (line 78) | type TestFailure = {
class TestServer (line 85) | class TestServer {
method constructor (line 126) | constructor(
method start (line 138) | public async start() {
method handleSocketConnected (line 161) | handleSocketConnected(socket: net.Socket) {
method spawnWorkers (line 216) | spawnWorkers() {
method spawnWorker (line 251) | private spawnWorker(id: number, file: string) {
method handleError (line 303) | handleError(code: number, error: Error, details?: any) {
method handleData (line 322) | handleData(
method handleWorkerCompleted (line 439) | private handleWorkerCompleted(workerId: number) {
method shutdown (line 486) | shutdown() {
method handleTestError (line 495) | handleTestError(workerId: number, error: any, ended: number) {
method tick (line 526) | private tick() {
method printResults (line 657) | private printResults() {
method printSuiteResult (line 714) | private printSuiteResult(result: SuiteResult, depth = 0): string {
method formattedError (line 733) | private formattedError(error: Error, indent: string = ""): string {
method elapsed (line 748) | static elapsed({
FILE: llrt_core/src/modules/js/@llrt/test/shared.ts
type SocketReqMsg (line 1) | type SocketReqMsg =
type ReadyReqMsg (line 9) | type ReadyReqMsg = {
type ErrorReqMsg (line 14) | type ErrorReqMsg = {
type ModuleReqMsg (line 22) | type ModuleReqMsg = {
type CompletedReqMsg (line 29) | type CompletedReqMsg = {
type EndReqMsg (line 33) | type EndReqMsg = {
type StartReqMsg (line 40) | type StartReqMsg = {
type SocketResponseMap (line 48) | type SocketResponseMap = {};
type SocketRes (line 50) | type SocketRes<T extends SocketReqMsg> = T extends {
FILE: llrt_core/src/modules/js/@llrt/test/worker.ts
type Test (line 7) | type Test = TestSettings & {
type TestSettings (line 12) | type TestSettings = {
type SuiteFunctionWithOptions (line 18) | type SuiteFunctionWithOptions = SuiteFunction & {
type SuiteFunction (line 23) | type SuiteFunction = (
type TestSuite (line 29) | type TestSuite = TestSettings &
type TestSetup (line 38) | type TestSetup = {
type RootSuite (line 45) | type RootSuite = TestSettings &
type MaybeAsyncFunction (line 54) | type MaybeAsyncFunction = () => Promise<void> | void;
type MessageTypeMap (line 56) | type MessageTypeMap = {
type MessagePayload (line 60) | type MessagePayload<T extends SocketReqMsg["type"]> = Omit<
type SocketReturnType (line 65) | type SocketReturnType<T> = T extends keyof SocketResponseMap
class TestAgent (line 69) | class TestAgent {
method createRootSuite (line 94) | static createRootSuite(): RootSuite {
method constructor (line 107) | constructor(workerId: number, serverPort: number) {
method createDescribe (line 127) | private createDescribe({
method createTestFunction (line 162) | private createTestFunction({
method runHook (line 195) | private async runHook(
method executeAsyncOrCallbackFn (line 214) | private async executeAsyncOrCallbackFn(
method sendWorkerId (line 255) | private sendWorkerId() {
method complete (line 261) | private async complete() {
method sendMessage (line 266) | private async sendMessage<T extends SocketReqMsg["type"]>(
method runTests (line 299) | private async runTests(testSuite: TestSuite, tests: Test[] = []) {
method start (line 341) | public async start(entry: string): Promise<void> {
method runSuite (line 423) | async runSuite(suite: TestSuite, started: number) {
method runRootSuite (line 459) | async runRootSuite() {
method connect (line 486) | async connect() {
FILE: llrt_core/src/modules/js/llrt.d.ts
class XMLParser (line 9) | class XMLParser {
class XmlText (line 29) | class XmlText {
method constructor (line 30) | constructor(private value: string) {}
class XmlNode (line 34) | class XmlNode {
type MemoryInfo (line 47) | interface MemoryInfo {
type Timezone (line 79) | interface Timezone {
FILE: llrt_core/src/modules/js/stream.ts
function Stream (line 34) | function Stream(this: any) {
function ondata (line 41) | function ondata(chunk: any) {
function ondrain (line 51) | function ondrain() {
function onend (line 67) | function onend() {
function onclose (line 74) | function onclose() {
function onerror (line 82) | function onerror(er: any) {
function cleanup (line 93) | function cleanup() {
FILE: llrt_core/src/modules/llrt/hex.rs
type LlrtHexModule (line 18) | pub struct LlrtHexModule;
method encode (line 21) | pub fn encode<'js>(ctx: Ctx<'js>, bytes: ObjectBytes<'js>) -> Result<S...
method decode (line 25) | pub fn decode(ctx: Ctx, encoded: String) -> Result<Value> {
method declare (line 34) | fn declare(declare: &Declarations) -> Result<()> {
method evaluate (line 41) | fn evaluate<'js>(ctx: &Ctx<'js>, exports: &Exports<'js>) -> Result<()> {
function from (line 53) | fn from(val: LlrtHexModule) -> Self {
FILE: llrt_core/src/modules/llrt/qjs.rs
function js_compute_memory_usage (line 15) | unsafe fn js_compute_memory_usage(ctx: &Ctx) -> qjs::JSMemoryUsage {
function compute_memory_usage (line 22) | fn compute_memory_usage(ctx: Ctx) -> Result<Value> {
type LlrtQjsModule (line 56) | pub struct LlrtQjsModule;
method declare (line 59) | fn declare(declare: &Declarations) -> Result<()> {
method evaluate (line 65) | fn evaluate<'js>(ctx: &Ctx<'js>, exports: &Exports<'js>) -> Result<()> {
function from (line 74) | fn from(val: LlrtQjsModule) -> Self {
FILE: llrt_core/src/modules/llrt/util.rs
function dimensions (line 15) | fn dimensions(ctx: Ctx<'_>) -> Result<Array<'_>> {
function load (line 30) | fn load<'js>(ctx: Ctx<'js>, filename: String, options: Opt<Object<'js>>)...
function print (line 48) | fn print(value: String, stdout: Opt<bool>) {
type LlrtUtilModule (line 56) | pub struct LlrtUtilModule;
method declare (line 59) | fn declare(declare: &Declarations) -> Result<()> {
method evaluate (line 67) | fn evaluate<'js>(ctx: &Ctx<'js>, exports: &Exports<'js>) -> Result<()> {
function from (line 78) | fn from(val: LlrtUtilModule) -> Self {
FILE: llrt_core/src/modules/llrt/xml.rs
constant AMP (line 28) | const AMP: &str = "&";
constant LT (line 29) | const LT: &str = "<";
constant GT (line 30) | const GT: &str = ">";
constant QUOT (line 31) | const QUOT: &str = """;
constant APOS (line 32) | const APOS: &str = "'";
constant CR (line 33) | const CR: &str = "
";
constant LF (line 34) | const LF: &str = "
";
constant NEL (line 35) | const NEL: &str = "…";
constant LS (line 36) | const LS: &str = "
";
type XMLParser (line 40) | struct XMLParser<'js> {
function trace (line 50) | fn trace<'a>(&self, tracer: Tracer<'a, 'js>) {
type StackObject (line 60) | struct StackObject<'js> {
function new (line 65) | fn new(ctx: Ctx<'js>) -> Result<Self> {
function into_value (line 72) | fn into_value(self, ctx: &Ctx<'js>) -> Result<Value<'js>> {
function new (line 83) | pub fn new(options: Opt<Object<'js>>) -> Result<Self> {
function add_entity (line 115) | pub fn add_entity(&mut self, key: String, value: String) {
function parse (line 123) | pub fn parse(&self, ctx: Ctx<'js>, bytes: ObjectBytes<'js>) -> Result<Ob...
function process_text (line 230) | fn process_text<'a>(
function get_tag_name (line 254) | fn get_tag_name(
function process_end (line 264) | fn process_end(
function set_attribute (line 291) | fn set_attribute(
function process_attributes (line 312) | fn process_attributes(
function process_tag_value (line 349) | fn process_tag_value(
type XmlText (line 382) | struct XmlText {
method trace (line 387) | fn trace<'a>(&self, _tracer: Tracer<'a, 'js>) {}
method new (line 393) | fn new(value: String) -> Self {
method to_string (line 401) | fn to_string(&self) -> &str {
type XmlNode (line 408) | struct XmlNode<'js> {
type NodeStackEntry (line 418) | enum NodeStackEntry<'js> {
function new (line 426) | fn new(name: String, children: Opt<Vec<Value<'js>>>) -> Result<Self> {
function of (line 437) | fn of(
function with_name (line 461) | fn with_name(this: This<Class<'js, Self>>, name: String) -> Class<'js, S...
function add_attribute (line 466) | fn add_attribute(
function add_child_node (line 481) | fn add_child_node(this: This<Class<'js, Self>>, value: Value<'js>) -> Re...
function remove_attribute (line 487) | fn remove_attribute(this: This<Class<'js, Self>>, name: String) -> Class...
function to_string (line 496) | fn to_string(this: This<Class<'js, Self>>, ctx: Ctx<'js>) -> Result<Stri...
function escape_attribute (line 561) | fn escape_attribute(text: &mut String, value: &str) {
function escape_element (line 574) | fn escape_element(text: &mut String, value: &str) {
type LlrtXmlModule (line 592) | pub struct LlrtXmlModule;
method declare (line 595) | fn declare(declare: &Declarations) -> Result<()> {
method evaluate (line 605) | fn evaluate<'js>(ctx: &Ctx<'js>, exports: &Exports<'js>) -> Result<()> {
function from (line 618) | fn from(val: LlrtXmlModule) -> Self {
FILE: llrt_core/src/runtime_client.rs
constant ENV_AWS_LAMBDA_FUNCTION_NAME (line 40) | const ENV_AWS_LAMBDA_FUNCTION_NAME: &str = "AWS_LAMBDA_FUNCTION_NAME";
constant ENV_AWS_LAMBDA_FUNCTION_VERSION (line 41) | const ENV_AWS_LAMBDA_FUNCTION_VERSION: &str = "AWS_LAMBDA_FUNCTION_VERSI...
constant ENV_AWS_LAMBDA_FUNCTION_MEMORY_SIZE (line 42) | const ENV_AWS_LAMBDA_FUNCTION_MEMORY_SIZE: &str = "AWS_LAMBDA_FUNCTION_M...
constant ENV_AWS_LAMBDA_LOG_GROUP_NAME (line 43) | const ENV_AWS_LAMBDA_LOG_GROUP_NAME: &str = "AWS_LAMBDA_LOG_GROUP_NAME";
constant ENV_AWS_LAMBDA_LOG_STREAM_NAME (line 44) | const ENV_AWS_LAMBDA_LOG_STREAM_NAME: &str = "AWS_LAMBDA_LOG_STREAM_NAME";
constant ENV_LAMBDA_TASK_ROOT (line 45) | const ENV_LAMBDA_TASK_ROOT: &str = "LAMBDA_TASK_ROOT";
constant ENV_UNDERSCORE_HANDLER (line 46) | const ENV_UNDERSCORE_HANDLER: &str = "_HANDLER";
constant ENV_LAMBDA_HANDLER (line 47) | const ENV_LAMBDA_HANDLER: &str = "LAMBDA_HANDLER";
constant AWS_LAMBDA_RUNTIME_API (line 48) | const AWS_LAMBDA_RUNTIME_API: &str = "AWS_LAMBDA_RUNTIME_API";
constant ENV_UNDERSCORE_EXIT_ITERATIONS (line 49) | const ENV_UNDERSCORE_EXIT_ITERATIONS: &str = "_EXIT_ITERATIONS";
constant ENV_RUNTIME_PATH (line 50) | const ENV_RUNTIME_PATH: &str = "2018-06-01/runtime";
constant ENV_X_AMZN_TRACE_ID (line 51) | const ENV_X_AMZN_TRACE_ID: &str = "_X_AMZN_TRACE_ID";
type SdkClientInitState (line 64) | pub struct SdkClientInitState {
method new (line 70) | fn new(rt: *mut qjs::JSRuntime) -> Self {
function get_sdk_client_init_state_mut (line 82) | fn get_sdk_client_init_state_mut<'a>(
function get_sdk_client_init_state (line 92) | fn get_sdk_client_init_state<'a>(
function check_client_inited (line 107) | pub fn check_client_inited(rt: *mut qjs::JSRuntime, endpoint: &str) -> b...
function mark_client_inited (line 118) | pub fn mark_client_inited(rt: *mut qjs::JSRuntime) {
type LambdaContext (line 125) | struct LambdaContext<'js, 'a> {
function into_js (line 136) | fn into_js(self, ctx: &Ctx<'js>) -> Result<Value<'js>> {
type LambdaEnvironment (line 163) | struct LambdaEnvironment {
method new (line 172) | fn new() -> Self {
type NextInvocationResponse (line 186) | struct NextInvocationResponse<'js, 'a> {
type RuntimeConfig (line 191) | struct RuntimeConfig {
method default (line 198) | fn default(ctx: &Ctx) -> Result<Self> {
function start (line 232) | pub async fn start(ctx: &Ctx<'_>) -> Result<()> {
function start_with_cfg (line 236) | async fn start_with_cfg(ctx: &Ctx<'_>, config: RuntimeConfig) -> Result<...
function next_invocation (line 287) | async fn next_invocation<'js, 'a>(
function invoke_response (line 360) | async fn invoke_response<'js>(
function start_process_events (line 392) | async fn start_process_events<'js>(
function process_event (line 445) | async fn process_event<'js>(
function post_error (line 481) | async fn post_error<'js>(
function get_module_and_handler_name (line 556) | fn get_module_and_handler_name<'a>(ctx: &Ctx, handler: &'a str) -> Resul...
function get_task_root (line 581) | fn get_task_root() -> String {
function get_header_value (line 590) | fn get_header_value(headers: &HeaderMap, header: &HeaderName) -> StdResu...
function runtime (line 610) | async fn runtime() {
FILE: llrt_core/src/security.rs
function init (line 10) | pub fn init() -> StdResult<(), Box<dyn std::error::Error + Send + Sync>> {
function build_http_access_list (line 26) | fn build_http_access_list(list: &[String]) -> StdResult<Vec<Uri>, Invali...
function build_access_list (line 37) | fn build_access_list(env_value: String) -> Vec<String> {
FILE: llrt_core/src/vm.rs
type Vm (line 30) | pub struct Vm {
constant ENV_LAMBDA_TASK_ROOT (line 76) | pub const ENV_LAMBDA_TASK_ROOT: &'static str = "LAMBDA_TASK_ROOT";
method from_options (line 78) | pub async fn from_options(
method new (line 141) | pub async fn new() -> StdResult<Self, Box<dyn std::error::Error + Send...
method run_with (line 146) | pub async fn run_with<F>(&self, f: F)
method run (line 159) | pub async fn run<S: Into<Vec<u8>> + Send>(&self, source: S, strict: bo...
method run_file (line 171) | pub async fn run_file(&self, filename: impl AsRef<str>, strict: bool, ...
method run_bytecode (line 182) | pub async fn run_bytecode(&self, bytecode: &[u8]) {
method idle (line 195) | pub async fn idle(self) -> StdResult<(), Box<dyn std::error::Error + S...
type VmOptions (line 35) | pub struct VmOptions {
method default (line 42) | fn default() -> Self {
function init (line 201) | fn init(ctx: &Ctx<'_>) -> Result<()> {
FILE: llrt_modules/src/lib.rs
constant VERSION (line 76) | pub const VERSION: &str = env!("CARGO_PKG_VERSION");
constant CJS_IMPORT_PREFIX (line 79) | pub const CJS_IMPORT_PREFIX: &str = "__cjs:";
constant CJS_LOADER_PREFIX (line 81) | pub const CJS_LOADER_PREFIX: &str = "__cjsm:";
constant ENV_LLRT_PLATFORM (line 83) | pub const ENV_LLRT_PLATFORM: &str = "LLRT_PLATFORM";
FILE: llrt_modules/src/module/loader.rs
type LoadFn (line 20) | type LoadFn = for<'js> fn(Ctx<'js>, Vec<u8>) -> Result<Module<'js>>;
type Source (line 21) | type Source<'js> = AnyOf2<String, ObjectBytes<'js>>;
type ModuleLoader (line 24) | pub struct ModuleLoader {
method load_func (line 29) | fn load_func<'js, D: ModuleDef>(ctx: Ctx<'js>, name: Vec<u8>) -> Resul...
method add_module (line 33) | pub fn add_module<N: Into<String>, M: ModuleDef>(&mut self, name: N, _...
method with_module (line 39) | pub fn with_module<N: Into<String>, M: ModuleDef>(mut self, name: N, m...
method load (line 46) | fn load<'js>(&mut self, ctx: &Ctx<'js>, name: &str) -> Result<Module<'js...
function module_hook_load (line 74) | pub fn module_hook_load<'js>(ctx: &Ctx<'js>, name: &str) -> Result<(bool...
function call_load_hooks (line 100) | fn call_load_hooks<'js>(
function call_load_hooks_from (line 108) | fn call_load_hooks_from<'js>(
function test_hook_override_import (line 155) | async fn test_hook_override_import() {
function test_multiple_hooks_chain (line 216) | async fn test_multiple_hooks_chain() {
function test_hook_without_nextload (line 284) | async fn test_hook_without_nextload() {
function test_hook_passthrough_all (line 326) | async fn test_hook_passthrough_all() {
function test_hook_conditional_intercept (line 368) | async fn test_hook_conditional_intercept() {
function test_three_hooks_selective_intercept (line 416) | async fn test_three_hooks_selective_intercept() {
function test_hook_url_transformation_chain (line 504) | async fn test_hook_url_transformation_chain() {
FILE: llrt_modules/src/module/mod.rs
type ModuleNames (line 29) | pub struct ModuleNames<'js> {
function new (line 35) | pub fn new(names: HashSet<String>) -> Self {
function get_list (line 42) | pub fn get_list(&self) -> HashSet<String> {
type RequireState (line 48) | pub struct RequireState<'js> {
type Changed (line 55) | type Changed<'to> = RequireState<'to>;
type Hook (line 59) | struct Hook<'js> {
type ModuleHookState (line 65) | pub struct ModuleHookState<'js> {
method default (line 70) | fn default() -> Self {
function new (line 76) | fn new() -> Self {
type ModuleModule (line 81) | pub struct ModuleModule;
function create_require (line 83) | fn create_require(ctx: Ctx<'_>) -> Result<Value<'_>> {
function is_builtin (line 90) | fn is_builtin(ctx: Ctx<'_>, name: String) -> Result<bool> {
function register_hooks (line 99) | pub fn register_hooks<'js>(ctx: Ctx<'js>, hooks_obj: Object<'js>) -> Res...
method declare (line 113) | fn declare(declare: &Declarations) -> Result<()> {
method evaluate (line 123) | fn evaluate<'js>(ctx: &Ctx<'js>, exports: &Exports<'js>) -> Result<()> {
function from (line 142) | fn from(val: ModuleModule) -> Self {
function init (line 150) | pub fn init(ctx: &Ctx) -> Result<()> {
FILE: llrt_modules/src/module/require.rs
function require (line 18) | pub fn require(ctx: Ctx<'_>, specifier: String) -> Result<Value<'_>> {
FILE: llrt_modules/src/module/resolver.rs
type ModuleResolver (line 22) | pub struct ModuleResolver {
method add_name (line 28) | pub fn add_name<P: Into<String>>(mut self, path: P) -> Self {
method resolve (line 35) | fn resolve(&mut self, ctx: &Ctx<'_>, base: &str, name: &str) -> Result<S...
function module_hook_resolve (line 65) | pub fn module_hook_resolve<'js>(ctx: &Ctx<'js>, x: &str, y: &str) -> Res...
function call_resolve_hooks (line 91) | fn call_resolve_hooks<'js>(
function call_resolve_hooks_from (line 100) | fn call_resolve_hooks_from<'js>(
FILE: llrt_modules/src/module_builder.rs
type GlobalAttachment (line 11) | pub struct GlobalAttachment {
method add_function (line 17) | pub fn add_function(mut self, init: fn(&Ctx<'_>) -> Result<()>) -> Self {
method add_name (line 22) | pub fn add_name<P: Into<String>>(mut self, path: P) -> Self {
method attach (line 27) | pub fn attach(self, ctx: &Ctx<'_>) -> Result<()> {
type ModuleBuilder (line 38) | pub struct ModuleBuilder {
method new (line 198) | pub fn new() -> Self {
method with_module (line 206) | pub fn with_module<M: ModuleDef, I: Into<ModuleInfo<M>>>(mut self, mod...
method with_global (line 217) | pub fn with_global(mut self, init: fn(&Ctx<'_>) -> Result<()>) -> Self {
method build (line 222) | pub fn build(self) -> (ModuleResolver, ModuleLoader, GlobalAttachment) {
method default (line 45) | fn default() -> Self {
FILE: llrt_modules/src/package/loader.rs
type PackageLoader (line 11) | pub struct PackageLoader;
method load_cjs_module (line 14) | fn load_cjs_module<'js>(name: &str, ctx: Ctx<'js>) -> Result<Module<'j...
method normalize_name (line 54) | fn normalize_name(name: &str) -> (bool, bool, &str, &str) {
method load_module (line 74) | fn load_module<'js>(name: &str, ctx: &Ctx<'js>) -> Result<(Module<'js>...
method load (line 113) | fn load<'js>(&mut self, ctx: &Ctx<'js>, name: &str) -> Result<Module<'js...
FILE: llrt_modules/src/package/resolver.rs
function rc_string_to_cow (line 25) | fn rc_string_to_cow<'a>(rc: Rc<String>) -> Cow<'a, str> {
type NodePathList (line 33) | struct NodePathList(pub NodePathListValues);
method new (line 40) | fn new() -> Self {
type NodePathListValues (line 35) | type NodePathListValues = Rc<RefCell<Vec<Rc<str>>>>;
type NodeModulePaths (line 46) | type NodeModulePaths = HashMap<Box<str>, Option<NodePathList>>;
type PackageResolver (line 89) | pub struct PackageResolver;
method resolve (line 93) | fn resolve(&mut self, ctx: &Ctx, base: &str, name: &str) -> Result<Strin...
function require_resolve (line 109) | pub fn require_resolve<'a>(
function resolved_by_file_exists (line 232) | fn resolved_by_file_exists(path: Cow<'_, str>) -> Result<Cow<'_, str>> {
function to_abs_path (line 237) | fn to_abs_path(path: Cow<'_, str>) -> Result<Cow<'_, str>> {
function load_as_file (line 248) | fn load_as_file<'a>(ctx: &Ctx<'_>, x: Rc<String>) -> Result<Option<Cow<'...
function load_index (line 317) | fn load_index<'a>(ctx: &Ctx<'_>, x: Rc<String>) -> Result<Option<Cow<'a,...
function load_as_directory (line 379) | fn load_as_directory<'a>(ctx: &Ctx<'_>, x: Rc<String>) -> Result<Option<...
function load_node_modules (line 419) | fn load_node_modules<'a>(
function load_package_imports (line 523) | fn load_package_imports(ctx: &Ctx<'_>, x: &str, dir: &str) -> Result<Opt...
function load_package_exports (line 552) | fn load_package_exports<'a>(
function load_package_self (line 671) | fn load_package_self(ctx: &Ctx<'_>, x: &str, dir: &str, is_esm: bool) ->...
function get_name_and_scope (line 725) | fn get_name_and_scope(x: &str, n: usize) -> (&str, &str, bool) {
function package_exports_resolve (line 734) | fn package_exports_resolve<'a>(
function replace_star (line 856) | fn replace_star(scope: &str, name: &str) -> String {
function package_imports_resolve (line 861) | fn package_imports_resolve<'a>(
function find_the_closest_package_scope (line 894) | fn find_the_closest_package_scope(start: &str) -> Option<Box<str>> {
function get_string_field (line 908) | fn get_string_field<'a>(package_json: &'a BorrowedValue<'a>, str: &str) ...
function is_exports_field_exists (line 917) | fn is_exports_field_exists<'a>(package_json: &'a BorrowedValue<'a>) -> b...
function correct_extensions (line 926) | fn correct_extensions<'a>(x: String) -> Cow<'a, str> {
FILE: modules/llrt_abort/src/abort_controller.rs
type AbortController (line 13) | pub struct AbortController<'js> {
type Changed (line 18) | type Changed<'to> = AbortController<'to>;
function new (line 24) | pub fn new(ctx: Ctx<'js>) -> Result<Self> {
function signal (line 34) | pub fn signal(&self) -> Class<'js, AbortSignal<'js>> {
function to_string_tag (line 39) | pub fn to_string_tag(&self) -> &'static str {
function abort (line 43) | pub fn abort(
FILE: modules/llrt_abort/src/abort_signal.rs
type AbortSignal (line 18) | pub struct AbortSignal<'js> {
type Changed (line 26) | type Changed<'to> = AbortSignal<'to>;
function trace (line 30) | fn trace<'a>(&self, tracer: Tracer<'a, 'js>) {
function get_event_list (line 40) | fn get_event_list(&self) -> Arc<RwLock<EventList<'js>>> {
function new (line 48) | pub fn new() -> Self {
function get_on_abort (line 59) | pub fn get_on_abort(&self) -> Option<Function<'js>> {
function set_on_abort (line 64) | pub fn set_on_abort(
function remove_on_abort (line 73) | pub fn remove_on_abort(
function throw_if_aborted (line 82) | pub fn throw_if_aborted(&self, ctx: Ctx<'js>) -> Result<()> {
function any (line 94) | pub fn any(ctx: Ctx<'js>, signals: Array<'js>) -> Result<Class<'js, Self...
function aborted (line 143) | pub fn aborted(&self) -> bool {
function reason (line 148) | pub fn reason(&self) -> Option<Value<'js>> {
function to_string_tag (line 153) | pub fn to_string_tag(&self) -> &'static str {
function set_reason (line 158) | pub fn set_reason(&mut self, reason: Opt<Value<'js>>) {
function send_aborted (line 166) | pub fn send_aborted(this: This<Class<'js, Self>>, ctx: Ctx<'js>) -> Resu...
function abort (line 182) | pub fn abort(ctx: Ctx<'js>, reason: Opt<Value<'js>>) -> Result<Class<'js...
function timeout (line 191) | pub fn timeout(ctx: Ctx<'js>, milliseconds: u64) -> Result<Class<'js, Se...
function get_reason_or_dom_exception (line 237) | fn get_reason_or_dom_exception<'js>(
function test_abort_signal (line 261) | async fn test_abort_signal() {
FILE: modules/llrt_abort/src/lib.rs
function init (line 13) | pub fn init(ctx: &Ctx<'_>) -> Result<()> {
FILE: modules/llrt_assert/src/lib.rs
function ok (line 10) | fn ok(ctx: Ctx, value: Value, message: Opt<Value>) -> Result<()> {
type AssertModule (line 57) | pub struct AssertModule;
method declare (line 60) | fn declare(declare: &Declarations) -> Result<()> {
method evaluate (line 67) | fn evaluate<'js>(ctx: &Ctx<'js>, exports: &Exports<'js>) -> Result<()> {
function from (line 78) | fn from(val: AssertModule) -> Self {
FILE: modules/llrt_async_hooks/src/finalization_registry.rs
function init_finalization_registry (line 11) | pub(crate) fn init_finalization_registry(ctx: &Ctx<'_>) -> Result<()> {
function invoke_finalization_hook (line 37) | fn invoke_finalization_hook<'js>(ctx: Ctx<'js>, uid: Value<'js>) -> Resu...
FILE: modules/llrt_async_hooks/src/lib.rs
type Hook (line 24) | struct Hook<'js> {
type AsyncHookState (line 33) | struct AsyncHookState<'js> {
method default (line 38) | fn default() -> Self {
function new (line 44) | fn new() -> Self {
type Changed (line 50) | type Changed<'to> = AsyncHookState<'to>;
type AsyncHookIds (line 53) | struct AsyncHookIds<'js> {
method default (line 61) | fn default() -> Self {
function new (line 67) | fn new() -> Self {
type Changed (line 78) | type Changed<'to> = AsyncHookIds<'to>;
function create_hook (line 81) | fn create_hook<'js>(ctx: Ctx<'js>, hooks_obj: Object<'js>) -> Result<Val...
function current_id (line 127) | fn current_id() -> u64 {
function execution_async_id (line 133) | fn execution_async_id(ctx: Ctx<'_>) -> Result<u64> {
function trigger_async_id (line 139) | fn trigger_async_id(ctx: Ctx<'_>) -> Result<u64> {
type AsyncHooksModule (line 145) | pub struct AsyncHooksModule;
method declare (line 148) | fn declare(declare: &Declarations) -> Result<()> {
method evaluate (line 158) | fn evaluate<'js>(ctx: &Ctx<'js>, exports: &Exports<'js>) -> Result<()> {
function from (line 173) | fn from(val: AsyncHooksModule) -> Self {
function init (line 181) | pub fn init(ctx: &Ctx<'_>) -> Result<()> {
function promise_hook_tracker (line 209) | pub fn promise_hook_tracker() -> PromiseHook {
function invoke_async_hook (line 230) | fn invoke_async_hook(
function insert_id_map (line 296) | fn insert_id_map(
function get_id_map (line 314) | fn get_id_map(ctx: &Ctx<'_>, target: usize) -> Result<(u64, u64)> {
function remove_id_map (line 320) | fn remove_id_map(ctx: &Ctx<'_>, target: usize) -> Result<(u64, u64)> {
function update_current_id (line 330) | fn update_current_id(ctx: &Ctx<'_>, id: (u64, u64)) -> Result<()> {
FILE: modules/llrt_buffer/src/array_buffer_view.rs
type ArrayBufferView (line 11) | pub struct ArrayBufferView<'js> {
type RawArrayBuffer (line 16) | struct RawArrayBuffer {
method new (line 22) | pub fn new(len: usize, ptr: NonNull<u8>) -> Self {
function into_js (line 28) | fn into_js(self, _ctx: &Ctx<'js>) -> Result<Value<'js>> {
function from_js (line 34) | fn from_js(_ctx: &Ctx<'js>, value: Value<'js>) -> Result<Self> {
function from_buffer (line 128) | pub fn from_buffer(ctx: &Ctx<'js>, buffer: Buffer) -> Result<Self> {
function len (line 133) | pub fn len(&self) -> usize {
function is_empty (line 138) | pub fn is_empty(&self) -> bool {
function as_bytes (line 142) | pub fn as_bytes(&self) -> Option<&[u8]> {
function as_bytes_mut (line 153) | pub fn as_bytes_mut(&mut self) -> Option<&mut [u8]> {
FILE: modules/llrt_buffer/src/blob.rs
type EndingType (line 20) | enum EndingType {
constant LINE_ENDING (line 26) | const LINE_ENDING: &[u8] = b"\r\n";
constant LINE_ENDING (line 28) | const LINE_ENDING: &[u8] = b"\n";
type Blob (line 32) | pub struct Blob {
method new (line 54) | pub fn new<'js>(
method size (line 92) | pub fn size(&self) -> usize {
method mime_type (line 97) | pub fn mime_type(&self) -> String {
method text (line 101) | pub async fn text(&self) -> String {
method array_buffer (line 106) | pub async fn array_buffer<'js>(&self, ctx: Ctx<'js>) -> Result<ArrayBu...
method bytes (line 110) | pub async fn bytes<'js>(&self, ctx: Ctx<'js>) -> Result<Value<'js>> {
method slice (line 114) | pub fn slice(&self, start: Opt<isize>, end: Opt<isize>, content_type: ...
method to_string_tag (line 137) | pub fn to_string_tag(&self) -> &'static str {
method from_bytes (line 143) | pub fn from_bytes(data: Vec<u8>, content_type: Option<String>) -> Self {
method get_bytes (line 148) | pub fn get_bytes(&self) -> Vec<u8> {
method has_instance (line 153) | pub fn has_instance(value: Value<'_>) -> bool {
function normalize_type (line 38) | fn normalize_type(mut mime_type: String) -> String {
function bytes_from_parts (line 161) | fn bytes_from_parts<'js>(
function array_to_string (line 256) | fn array_to_string(array: &Array) -> Result<String> {
FILE: modules/llrt_buffer/src/buffer.rs
type BufferPrimordials (line 23) | pub struct BufferPrimordials<'js> {
function new (line 28) | fn new(ctx: &Ctx<'js>) -> Result<Self>
type Buffer (line 38) | pub struct Buffer(pub Vec<u8>);
method into_js (line 41) | fn into_js(self, ctx: &Ctx<'js>) -> Result<Value<'js>> {
method alloc (line 48) | pub fn alloc(length: usize) -> Self {
method to_string (line 52) | pub fn to_string(&self, ctx: &Ctx<'js>, encoding: &str) -> Result<Stri...
method from_array_buffer (line 58) | fn from_array_buffer(ctx: &Ctx<'js>, buffer: ArrayBuffer<'js>) -> Resu...
method from_array_buffer_offset_length (line 64) | fn from_array_buffer_offset_length(
method from_encoding (line 75) | fn from_encoding(
method from_string_encoding (line 87) | fn from_string_encoding(
function alloc (line 103) | fn alloc<'js>(
function alloc_byte_ref (line 138) | fn alloc_byte_ref<'js>(ctx: &Ctx<'js>, byte_ref: &[u8], length: usize) -...
function alloc_unsafe (line 147) | fn alloc_unsafe(ctx: Ctx<'_>, size: usize) -> Result<Value<'_>> {
function maybeuninit_to_u8 (line 156) | fn maybeuninit_to_u8(vec: Vec<MaybeUninit<u8>>) -> Vec<u8> {
function alloc_unsafe_slow (line 172) | fn alloc_unsafe_slow(ctx: Ctx<'_>, size: usize) -> Result<Value<'_>> {
function byte_length (line 185) | fn byte_length<'js>(ctx: Ctx<'js>, value: Value<'js>, encoding: Opt<Stri...
function concat (line 220) | fn concat<'js>(ctx: Ctx<'js>, list: Array<'js>, max_length: Opt<usize>) ...
function from (line 248) | fn from<'js>(
function is_buffer (line 310) | fn is_buffer<'js>(ctx: Ctx<'js>, value: Value<'js>) -> Result<bool> {
function is_encoding (line 319) | fn is_encoding(value: Value) -> Result<bool> {
function copy (line 329) | fn copy<'js>(
function subarray (line 366) | fn subarray<'js>(
function to_string (line 400) | fn to_string(
function write (line 426) | fn write<'js>(
function get_write_parameters (line 463) | fn get_write_parameters(args: &Rest<Value<'_>>, len: usize) -> Result<(u...
function safe_byte_slice (line 493) | fn safe_byte_slice(s: &str, end: usize) -> (&[u8], usize) {
type Endian (line 510) | pub enum Endian {
type NumberKind (line 516) | pub enum NumberKind {
method bits (line 530) | pub fn bits(&self) -> u8 {
method is_signed (line 545) | pub fn is_signed(&self) -> bool {
method prototype (line 552) | pub fn prototype(&self) -> &'static [(Endian, &'static str, Option<&'s...
function write_buf (line 597) | fn write_buf<'js>(
function read_buf (line 692) | fn read_buf<'js>(
function endian_bytes (line 794) | fn endian_bytes(mut val: u64, endian: Endian) -> Vec<u8> {
function shifted_bytes (line 812) | fn shifted_bytes(mut val: u64, bits: u8, endian: Endian) -> Vec<u8> {
function set_prototype (line 828) | pub(crate) fn set_prototype<'js>(ctx: &Ctx<'js>, constructor: Object<'js...
function atob (line 869) | pub fn atob(ctx: Ctx<'_>, encoded_value: Coerced<String>) -> Result<rqui...
function btoa (line 878) | pub fn btoa(ctx: Ctx<'_>, value: Coerced<String>) -> Result<String> {
function test_atob (line 913) | async fn test_atob() {
function test_atob_high_bytes (line 943) | async fn test_atob_high_bytes() {
function test_btoa (line 1006) | async fn test_btoa() {
function test_btoa_high_bytes (line 1036) | async fn test_btoa_high_bytes() {
function test_subarray (line 1100) | async fn test_subarray() {
function test_subarray_partial (line 1132) | async fn test_subarray_partial() {
function test_subarray_out_of_bounds (line 1164) | async fn test_subarray_out_of_bounds() {
function test_read_int_32_be (line 1196) | async fn test_read_int_32_be() {
FILE: modules/llrt_buffer/src/file.rs
type File (line 13) | pub struct File {
method new (line 23) | fn new<'js>(
method size (line 53) | pub fn size(&self) -> usize {
method name (line 58) | pub fn name(&self) -> String {
method mime_type (line 63) | pub fn mime_type(&self) -> String {
method last_modified (line 68) | pub fn last_modified(&self) -> i64 {
method slice (line 72) | pub fn slice(&self, start: Opt<isize>, end: Opt<isize>, content_type: ...
method text (line 76) | pub async fn text(&mut self) -> String {
method array_buffer (line 81) | pub async fn array_buffer<'js>(&self, ctx: Ctx<'js>) -> Result<ArrayBu...
method bytes (line 85) | pub async fn bytes<'js>(&self, ctx: Ctx<'js>) -> Result<Value<'js>> {
method to_string_tag (line 90) | pub fn to_string_tag(&self) -> &'static str {
method from_bytes (line 95) | pub fn from_bytes<'js>(
method get_blob (line 121) | pub fn get_blob(&self) -> Blob {
FILE: modules/llrt_buffer/src/lib.rs
type BufferModule (line 25) | pub struct BufferModule;
method declare (line 28) | fn declare(declare: &Declarations) -> Result<()> {
method evaluate (line 37) | fn evaluate<'js>(ctx: &Ctx<'js>, exports: &Exports<'js>) -> Result<()> {
function from (line 58) | fn from(val: BufferModule) -> Self {
function init (line 66) | pub fn init<'js>(ctx: &Ctx<'js>) -> Result<()> {
FILE: modules/llrt_child_process/src/lib.rs
function prepare_shell_args (line 56) | fn prepare_shell_args(
type ChildProcess (line 108) | pub struct ChildProcess<'js> {
function trace (line 117) | fn trace<'a>(&self, tracer: Tracer<'a, 'js>) {
type StdioEnum (line 123) | enum StdioEnum {
method to_stdio (line 130) | fn to_stdio(&self) -> Stdio {
function pid (line 152) | fn pid(&self, ctx: Ctx<'js>) -> Result<Value<'js>> {
function kill (line 157) | fn kill(&mut self, ctx: Ctx<'js>, signal: Opt<Value<'js>>) -> Result<boo...
function new (line 184) | fn new(
function wait_for_process (line 322) | async fn wait_for_process(
function get_event_list (line 368) | fn get_event_list(&self) -> Arc<RwLock<EventList<'js>>> {
function spawn (line 373) | fn spawn<'js>(
function str_to_stdio (line 545) | fn str_to_stdio(ctx: &Ctx<'_>, input: &str) -> Result<StdioEnum> {
function create_output (line 560) | fn create_output<'js, T>(
type ChildProcessModule (line 576) | pub struct ChildProcessModule;
method declare (line 579) | fn declare(declare: &Declarations) -> Result<()> {
method evaluate (line 585) | fn evaluate<'js>(ctx: &Ctx<'js>, exports: &Exports<'js>) -> Result<()> {
function from (line 602) | fn from(val: ChildProcessModule) -> Self {
function test_spawn (line 618) | async fn test_spawn() {
function test_spawn_shell (line 659) | async fn test_spawn_shell() {
FILE: modules/llrt_console/src/lib.rs
type Console (line 15) | pub struct Console {}
method new (line 26) | pub fn new() -> Self {
method log (line 31) | pub fn log<'js>(&self, ctx: Ctx<'js>, args: Rest<Value<'js>>) -> Resul...
method clear (line 34) | pub fn clear(&self) {
method debug (line 37) | pub fn debug<'js>(&self, ctx: Ctx<'js>, args: Rest<Value<'js>>) -> Res...
method info (line 40) | pub fn info<'js>(&self, ctx: Ctx<'js>, args: Rest<Value<'js>>) -> Resu...
method trace (line 43) | pub fn trace<'js>(&self, ctx: Ctx<'js>, args: Rest<Value<'js>>) -> Res...
method error (line 46) | pub fn error<'js>(&self, ctx: Ctx<'js>, args: Rest<Value<'js>>) -> Res...
method warn (line 49) | pub fn warn<'js>(&self, ctx: Ctx<'js>, args: Rest<Value<'js>>) -> Resu...
method assert (line 52) | pub fn assert<'js>(
method default (line 18) | fn default() -> Self {
function log_fatal (line 62) | pub fn log_fatal<'js>(ctx: Ctx<'js>, args: Rest<Value<'js>>) -> Result<(...
function log_error (line 66) | pub fn log_error<'js>(ctx: Ctx<'js>, args: Rest<Value<'js>>) -> Result<(...
function log_warn (line 70) | fn log_warn<'js>(ctx: Ctx<'js>, args: Rest<Value<'js>>) -> Result<()> {
function log_debug (line 74) | fn log_debug<'js>(ctx: Ctx<'js>, args: Rest<Value<'js>>) -> Result<()> {
function log_trace (line 78) | fn log_trace<'js>(ctx: Ctx<'js>, args: Rest<Value<'js>>) -> Result<()> {
function log_assert (line 82) | fn log_assert<'js>(ctx: Ctx<'js>, expression: bool, args: Rest<Value<'js...
function log (line 89) | fn log<'js>(ctx: Ctx<'js>, args: Rest<Value<'js>>) -> Result<()> {
function clear (line 93) | fn clear() {
function write_log (line 97) | fn write_log<'js, T>(mut output: T, ctx: &Ctx<'js>, args: Rest<Value<'js...
type ConsoleModule (line 115) | pub struct ConsoleModule;
method declare (line 118) | fn declare(declare: &Declarations) -> Result<()> {
method evaluate (line 125) | fn evaluate<'js>(ctx: &Ctx<'js>, exports: &Exports<'js>) -> Result<()> {
function from (line 135) | fn from(val: ConsoleModule) -> Self {
function init (line 143) | pub fn init(ctx: &Ctx<'_>) -> Result<()> {
FILE: modules/llrt_crypto/src/crc32.rs
type Crc32c (line 11) | pub struct Crc32c {
method new (line 19) | fn new() -> Self {
method crc32c_digest (line 26) | fn crc32c_digest(&self) -> u64 {
method crc32c_update (line 31) | fn crc32c_update<'js>(
type Crc32 (line 43) | pub struct Crc32 {
method new (line 51) | fn new() -> Self {
method crc32_digest (line 58) | fn crc32_digest(&self) -> u64 {
method crc32_update (line 63) | fn crc32_update<'js>(
FILE: modules/llrt_crypto/src/hash.rs
type HashAlgorithm (line 14) | pub enum HashAlgorithm {
type Error (line 25) | type Error = String;
method try_from (line 26) | fn try_from(s: &str) -> std::result::Result<Self, Self::Error> {
method class_name (line 44) | pub fn class_name(&self) -> &'static str {
method as_str (line 54) | pub fn as_str(&self) -> &'static str {
method as_numeric_str (line 64) | pub fn as_numeric_str(&self) -> &'static str {
method digest_len (line 74) | pub fn digest_len(&self) -> usize {
method block_len (line 84) | pub fn block_len(&self) -> usize {
type ProviderDigest (line 95) | type ProviderDigest = <crate::provider::DefaultProvider as CryptoProvide...
type ProviderHmac (line 96) | type ProviderHmac = <crate::provider::DefaultProvider as CryptoProvider>...
type Hash (line 100) | pub struct Hash {
method new (line 108) | pub fn new(ctx: Ctx<'_>, algorithm: String) -> Result<Self> {
method new_hmac (line 116) | pub fn new_hmac<'js>(
method do_update (line 129) | fn do_update(&mut self, data: &[u8]) {
method do_finalize (line 137) | fn do_finalize(&mut self) -> Option<Vec<u8>> {
method hash_digest (line 149) | fn hash_digest<'js>(&mut self, ctx: Ctx<'js>, encoding: Opt<String>) -...
method hash_update (line 165) | fn hash_update<'js>(
type Hmac (line 178) | pub struct Hmac {
method new (line 184) | pub fn new<'js>(ctx: Ctx<'js>, algorithm: String, key_value: ObjectByt...
method digest (line 193) | fn digest<'js>(&mut self, ctx: Ctx<'js>, encoding: Opt<String>) -> Res...
method update (line 197) | fn update<'js>(
FILE: modules/llrt_crypto/src/lib.rs
function encoded_bytes (line 65) | fn encoded_bytes<'js>(ctx: &Ctx<'js>, bytes: &[u8], encoding: &str) -> R...
function random_byte_array (line 82) | pub fn random_byte_array(length: usize) -> Vec<u8> {
function get_random_bytes (line 88) | fn get_random_bytes(ctx: Ctx, length: usize) -> Result<Value> {
function get_random_int (line 93) | fn get_random_int(first: i64, second: Opt<i64>) -> Result<i64> {
function random_fill (line 103) | fn random_fill<'js>(ctx: Ctx<'js>, obj: Object<'js>, args: Rest<Value<'j...
function random_fill_sync (line 133) | fn random_fill_sync<'js>(
function get_random_values (line 160) | fn get_random_values<'js>(ctx: Ctx<'js>, obj: Object<'js>) -> Result<Obj...
function uuidv4 (line 194) | fn uuidv4() -> String {
type Crypto (line 232) | struct Crypto {}
method new (line 237) | pub fn new(ctx: Ctx<'_>) -> Result<Self> {
method to_string_tag (line 242) | pub fn to_string_tag(&self) -> &'static str {
function init (line 247) | pub fn init(ctx: &Ctx<'_>) -> Result<()> {
type CryptoModule (line 285) | pub struct CryptoModule;
method declare (line 288) | fn declare(declare: &Declarations) -> Result<()> {
method evaluate (line 311) | fn evaluate<'js>(ctx: &Ctx<'js>, exports: &Exports<'js>) -> Result<()> {
function from (line 351) | fn from(val: CryptoModule) -> Self {
FILE: modules/llrt_crypto/src/provider/graviola.rs
type GraviolaProvider (line 18) | pub struct GraviolaProvider;
type GraviolaDigest (line 20) | pub enum GraviolaDigest {
method update (line 27) | fn update(&mut self, data: &[u8]) {
method finalize (line 35) | fn finalize(self) -> Vec<u8> {
type GraviolaHmac (line 44) | pub enum GraviolaHmac {
method update (line 51) | fn update(&mut self, data: &[u8]) {
method finalize (line 59) | fn finalize(self) -> Vec<u8> {
type Digest (line 69) | type Digest = GraviolaDigest;
type Hmac (line 70) | type Hmac = GraviolaHmac;
method digest (line 72) | fn digest(&self, algorithm: HashAlgorithm) -> Self::Digest {
method hmac (line 81) | fn hmac(&self, algorithm: HashAlgorithm, key: &[u8]) -> Self::Hmac {
method ecdsa_sign (line 90) | fn ecdsa_sign(
method ecdsa_verify (line 99) | fn ecdsa_verify(
method ed25519_sign (line 109) | fn ed25519_sign(&self, _private_key_der: &[u8], _data: &[u8]) -> Result<...
method ed25519_verify (line 113) | fn ed25519_verify(
method rsa_pss_sign (line 122) | fn rsa_pss_sign(
method rsa_pss_verify (line 132) | fn rsa_pss_verify(
method rsa_pkcs1v15_sign (line 143) | fn rsa_pkcs1v15_sign(
method rsa_pkcs1v15_verify (line 152) | fn rsa_pkcs1v15_verify(
method rsa_oaep_encrypt (line 162) | fn rsa_oaep_encrypt(
method rsa_oaep_decrypt (line 172) | fn rsa_oaep_decrypt(
method ecdh_derive_bits (line 182) | fn ecdh_derive_bits(
method x25519_derive_bits (line 191) | fn x25519_derive_bits(
method aes_encrypt (line 200) | fn aes_encrypt(
method aes_decrypt (line 226) | fn aes_decrypt(
method aes_kw_wrap (line 256) | fn aes_kw_wrap(&self, _kek: &[u8], _key: &[u8]) -> Result<Vec<u8>, Crypt...
method aes_kw_unwrap (line 260) | fn aes_kw_unwrap(&self, _kek: &[u8], _wrapped_key: &[u8]) -> Result<Vec<...
method hkdf_derive_key (line 264) | fn hkdf_derive_key(
method pbkdf2_derive_key (line 275) | fn pbkdf2_derive_key(
method generate_aes_key (line 286) | fn generate_aes_key(&self, length_bits: u16) -> Result<Vec<u8>, CryptoEr...
method generate_hmac_key (line 293) | fn generate_hmac_key(
method generate_ec_key (line 310) | fn generate_ec_key(&self, _curve: EllipticCurve) -> Result<(Vec<u8>, Vec...
method generate_ed25519_key (line 314) | fn generate_ed25519_key(&self) -> Result<(Vec<u8>, Vec<u8>), CryptoError> {
method generate_x25519_key (line 318) | fn generate_x25519_key(&self) -> Result<(Vec<u8>, Vec<u8>), CryptoError> {
method generate_rsa_key (line 323) | fn generate_rsa_key(
method import_rsa_public_key_pkcs1 (line 331) | fn import_rsa_public_key_pkcs1(
method import_rsa_private_key_pkcs1 (line 337) | fn import_rsa_private_key_pkcs1(
method import_rsa_public_key_spki (line 343) | fn import_rsa_public_key_spki(
method import_rsa_private_key_pkcs8 (line 349) | fn import_rsa_private_key_pkcs8(
method export_rsa_public_key_pkcs1 (line 355) | fn export_rsa_public_key_pkcs1(&self, _key_data: &[u8]) -> Result<Vec<u8...
method export_rsa_public_key_spki (line 358) | fn export_rsa_public_key_spki(&self, _key_data: &[u8]) -> Result<Vec<u8>...
method export_rsa_private_key_pkcs8 (line 361) | fn export_rsa_private_key_pkcs8(&self, _key_data: &[u8]) -> Result<Vec<u...
method import_ec_public_key_sec1 (line 364) | fn import_ec_public_key_sec1(
method import_ec_public_key_spki (line 371) | fn import_ec_public_key_spki(&self, _der: &[u8]) -> Result<super::EcImpo...
method import_ec_private_key_pkcs8 (line 374) | fn import_ec_private_key_pkcs8(
method import_ec_private_key_sec1 (line 380) | fn import_ec_private_key_sec1(
method export_ec_public_key_sec1 (line 387) | fn export_ec_public_key_sec1(
method export_ec_public_key_spki (line 395) | fn export_ec_public_key_spki(
method export_ec_private_key_pkcs8 (line 402) | fn export_ec_private_key_pkcs8(
method import_okp_public_key_raw (line 409) | fn import_okp_public_key_raw(
method import_okp_public_key_spki (line 415) | fn import_okp_public_key_spki(
method import_okp_private_key_pkcs8 (line 422) | fn import_okp_private_key_pkcs8(
method export_okp_public_key_raw (line 429) | fn export_okp_public_key_raw(
method export_okp_public_key_spki (line 436) | fn export_okp_public_key_spki(
method export_okp_private_key_pkcs8 (line 443) | fn export_okp_private_key_pkcs8(
method import_rsa_jwk (line 450) | fn import_rsa_jwk(
method export_rsa_jwk (line 456) | fn export_rsa_jwk(
method import_ec_jwk (line 463) | fn import_ec_jwk(
method export_ec_jwk (line 470) | fn export_ec_jwk(
method import_okp_jwk (line 478) | fn import_okp_jwk(
method export_okp_jwk (line 485) | fn export_okp_jwk(
type GraviolaRustDigest (line 497) | pub enum GraviolaRustDigest {
method new (line 504) | pub fn new(algorithm: HashAlgorithm) -> Self {
method update (line 516) | fn update(&mut self, data: &[u8]) {
method finalize (line 522) | fn finalize(self) -> Vec<u8> {
type GraviolaRustHmac (line 531) | pub enum GraviolaRustHmac {
method new (line 538) | pub fn new(algorithm: HashAlgorithm, key: &[u8]) -> Self {
method update (line 550) | fn update(&mut self, data: &[u8]) {
method finalize (line 556) | fn finalize(self) -> Vec<u8> {
FILE: modules/llrt_crypto/src/provider/mod.rs
type RsaImportResult (line 43) | pub struct RsaImportResult {
type EcImportResult (line 52) | pub struct EcImportResult {
type OkpImportResult (line 59) | pub struct OkpImportResult {
type RsaJwkImport (line 67) | pub struct RsaJwkImport<'a> {
type RsaJwkExport (line 81) | pub struct RsaJwkExport {
type EcJwkImport (line 95) | pub struct EcJwkImport<'a> {
type EcJwkExport (line 104) | pub struct EcJwkExport {
type OkpJwkImport (line 113) | pub struct OkpJwkImport<'a> {
type OkpJwkExport (line 121) | pub struct OkpJwkExport {
type SimpleDigest (line 126) | pub trait SimpleDigest: Send {
method update (line 127) | fn update(&mut self, data: &[u8]);
method finalize (line 128) | fn finalize(self) -> Vec<u8>
type AesMode (line 135) | pub enum AesMode {
type CryptoProvider (line 142) | pub trait CryptoProvider {
method digest (line 147) | fn digest(&self, algorithm: HashAlgorithm) -> Self::Digest;
method hmac (line 150) | fn hmac(&self, algorithm: HashAlgorithm, key: &[u8]) -> Self::Hmac;
method ecdsa_sign (line 153) | fn ecdsa_sign(
method ecdsa_verify (line 159) | fn ecdsa_verify(
method ed25519_sign (line 168) | fn ed25519_sign(&self, private_key_der: &[u8], data: &[u8]) -> Result<...
method ed25519_verify (line 169) | fn ed25519_verify(
method rsa_pss_sign (line 177) | fn rsa_pss_sign(
method rsa_pss_verify (line 184) | fn rsa_pss_verify(
method rsa_pkcs1v15_sign (line 192) | fn rsa_pkcs1v15_sign(
method rsa_pkcs1v15_verify (line 198) | fn rsa_pkcs1v15_verify(
method rsa_oaep_encrypt (line 205) | fn rsa_oaep_encrypt(
method rsa_oaep_decrypt (line 212) | fn rsa_oaep_decrypt(
method ecdh_derive_bits (line 221) | fn ecdh_derive_bits(
method x25519_derive_bits (line 229) | fn x25519_derive_bits(
method aes_encrypt (line 236) | fn aes_encrypt(
method aes_decrypt (line 244) | fn aes_decrypt(
method aes_kw_wrap (line 254) | fn aes_kw_wrap(&self, kek: &[u8], key: &[u8]) -> Result<Vec<u8>, Crypt...
method aes_kw_unwrap (line 255) | fn aes_kw_unwrap(&self, kek: &[u8], wrapped_key: &[u8]) -> Result<Vec<...
method hkdf_derive_key (line 258) | fn hkdf_derive_key(
method pbkdf2_derive_key (line 266) | fn pbkdf2_derive_key(
method generate_aes_key (line 275) | fn generate_aes_key(&self, length_bits: u16) -> Result<Vec<u8>, Crypto...
method generate_hmac_key (line 276) | fn generate_hmac_key(
method generate_ec_key (line 281) | fn generate_ec_key(&self, curve: EllipticCurve) -> Result<(Vec<u8>, Ve...
method generate_ed25519_key (line 282) | fn generate_ed25519_key(&self) -> Result<(Vec<u8>, Vec<u8>), CryptoErr...
method generate_x25519_key (line 283) | fn generate_x25519_key(&self) -> Result<(Vec<u8>, Vec<u8>), CryptoError>;
method generate_rsa_key (line 284) | fn generate_rsa_key(
method import_rsa_public_key_pkcs1 (line 291) | fn import_rsa_public_key_pkcs1(&self, der: &[u8]) -> Result<RsaImportR...
method import_rsa_private_key_pkcs1 (line 292) | fn import_rsa_private_key_pkcs1(&self, der: &[u8]) -> Result<RsaImport...
method import_rsa_public_key_spki (line 293) | fn import_rsa_public_key_spki(&self, der: &[u8]) -> Result<RsaImportRe...
method import_rsa_private_key_pkcs8 (line 294) | fn import_rsa_private_key_pkcs8(&self, der: &[u8]) -> Result<RsaImport...
method export_rsa_public_key_pkcs1 (line 297) | fn export_rsa_public_key_pkcs1(&self, key_data: &[u8]) -> Result<Vec<u...
method export_rsa_public_key_spki (line 298) | fn export_rsa_public_key_spki(&self, key_data: &[u8]) -> Result<Vec<u8...
method export_rsa_private_key_pkcs8 (line 299) | fn export_rsa_private_key_pkcs8(&self, key_data: &[u8]) -> Result<Vec<...
method import_ec_public_key_sec1 (line 302) | fn import_ec_public_key_sec1(
method import_ec_public_key_spki (line 307) | fn import_ec_public_key_spki(&self, der: &[u8]) -> Result<EcImportResu...
method import_ec_private_key_pkcs8 (line 308) | fn import_ec_private_key_pkcs8(&self, der: &[u8]) -> Result<EcImportRe...
method import_ec_private_key_sec1 (line 309) | fn import_ec_private_key_sec1(
method export_ec_public_key_sec1 (line 316) | fn export_ec_public_key_sec1(
method export_ec_public_key_spki (line 322) | fn export_ec_public_key_spki(
method export_ec_private_key_pkcs8 (line 327) | fn export_ec_private_key_pkcs8(
method import_okp_public_key_raw (line 334) | fn import_okp_public_key_raw(&self, data: &[u8]) -> Result<OkpImportRe...
method import_okp_public_key_spki (line 335) | fn import_okp_public_key_spki(
method import_okp_private_key_pkcs8 (line 340) | fn import_okp_private_key_pkcs8(
method export_okp_public_key_raw (line 347) | fn export_okp_public_key_raw(
method export_okp_public_key_spki (line 352) | fn export_okp_public_key_spki(
method export_okp_private_key_pkcs8 (line 357) | fn export_okp_private_key_pkcs8(
method import_rsa_jwk (line 364) | fn import_rsa_jwk(&self, jwk: RsaJwkImport<'_>) -> Result<RsaImportRes...
method export_rsa_jwk (line 365) | fn export_rsa_jwk(
method import_ec_jwk (line 370) | fn import_ec_jwk(
method export_ec_jwk (line 375) | fn export_ec_jwk(
method import_okp_jwk (line 383) | fn import_okp_jwk(
method export_okp_jwk (line 388) | fn export_okp_jwk(
type HmacProvider (line 396) | pub trait HmacProvider: Send {
method update (line 397) | fn update(&mut self, data: &[u8]);
method finalize (line 398) | fn finalize(self) -> Vec<u8>
type CryptoError (line 405) | pub enum CryptoError {
method fmt (line 420) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
type DefaultProvider (line 448) | pub type DefaultProvider = openssl::OpenSslProvider;
type DefaultProvider (line 451) | pub type DefaultProvider = rust::RustCryptoProvider;
type DefaultProvider (line 454) | pub type DefaultProvider = ring::RingProvider;
type DefaultProvider (line 457) | pub type DefaultProvider = RingRustProvider;
type DefaultProvider (line 460) | pub type DefaultProvider = graviola::GraviolaProvider;
type DefaultProvider (line 463) | pub type DefaultProvider = GraviolaRustProvider;
function graviola_aes_supported (line 793) | fn graviola_aes_supported() -> bool {
function provider (line 841) | fn provider() -> impl CryptoProvider {
function to_hex (line 856) | fn to_hex(bytes: &[u8]) -> String {
function test_sha256_digest (line 862) | fn test_sha256_digest() {
function test_sha384_digest (line 875) | fn test_sha384_digest() {
function test_sha512_digest (line 884) | fn test_sha512_digest() {
function test_hmac_sha256 (line 894) | fn test_hmac_sha256() {
function test_aes_gcm_128_roundtrip (line 911) | fn test_aes_gcm_128_roundtrip() {
function test_aes_gcm_256_roundtrip (line 950) | fn test_aes_gcm_256_roundtrip() {
function test_aes_gcm_wrong_key_fails (line 980) | fn test_aes_gcm_wrong_key_fails() {
function test_generate_aes_key_128 (line 1010) | fn test_generate_aes_key_128() {
function test_generate_aes_key_256 (line 1023) | fn test_generate_aes_key_256() {
function test_generate_hmac_key (line 1036) | fn test_generate_hmac_key() {
function test_aes_cbc_roundtrip (line 1053) | fn test_aes_cbc_roundtrip() {
function test_aes_ctr_roundtrip (line 1071) | fn test_aes_ctr_roundtrip() {
function test_aes_kw_roundtrip (line 1101) | fn test_aes_kw_roundtrip() {
function test_hkdf_derive (line 1113) | fn test_hkdf_derive() {
function test_pbkdf2_derive (line 1127) | fn test_pbkdf2_derive() {
function test_ec_p256_sign_verify (line 1140) | fn test_ec_p256_sign_verify() {
function test_ec_p384_sign_verify (line 1161) | fn test_ec_p384_sign_verify() {
function test_ed25519_sign_verify (line 1181) | fn test_ed25519_sign_verify() {
function test_x25519_key_exchange (line 1194) | fn test_x25519_key_exchange() {
function test_ecdh_p256_key_exchange (line 1207) | fn test_ecdh_p256_key_exchange() {
function test_rsa_pss_sign_verify (line 1223) | fn test_rsa_pss_sign_verify() {
function test_rsa_pkcs1v15_sign_verify (line 1243) | fn test_rsa_pkcs1v15_sign_verify() {
function test_rsa_oaep_encrypt_decrypt (line 1263) | fn test_rsa_oaep_encrypt_decrypt() {
FILE: modules/llrt_crypto/src/provider/openssl.rs
type OpenSslProvider (line 24) | pub struct OpenSslProvider;
type OpenSslDigest (line 26) | pub enum OpenSslDigest {
method update (line 35) | fn update(&mut self, data: &[u8]) {
method finalize (line 47) | fn finalize(mut self) -> Vec<u8> {
type OpenSslHmac (line 60) | pub struct OpenSslHmac {
method update (line 65) | fn update(&mut self, data: &[u8]) {
method finalize (line 69) | fn finalize(self) -> Vec<u8> {
function get_message_digest (line 74) | fn get_message_digest(alg: HashAlgorithm) -> MessageDigest {
function get_md (line 84) | fn get_md(alg: HashAlgorithm) -> &'static openssl::md::MdRef {
function curve_to_nid (line 94) | fn curve_to_nid(curve: EllipticCurve) -> Nid {
function get_ec_group (line 102) | fn get_ec_group(curve: EllipticCurve) -> Result<EcGroup, CryptoError> {
type Digest (line 109) | type Digest = OpenSslDigest;
type Hmac (line 110) | type Hmac = OpenSslHmac;
method digest (line 112) | fn digest(&self, algorithm: HashAlgorithm) -> Self::Digest {
method hmac (line 124) | fn hmac(&self, algorithm: HashAlgorithm, key: &[u8]) -> Self::Hmac {
method ecdsa_sign (line 135) | fn ecdsa_sign(
method ecdsa_verify (line 155) | fn ecdsa_verify(
method ed25519_sign (line 183) | fn ed25519_sign(&self, private_key_der: &[u8], data: &[u8]) -> Result<Ve...
method ed25519_verify (line 193) | fn ed25519_verify(
method rsa_pss_sign (line 206) | fn rsa_pss_sign(
method rsa_pss_verify (line 237) | fn rsa_pss_verify(
method rsa_pkcs1v15_sign (line 267) | fn rsa_pkcs1v15_sign(
method rsa_pkcs1v15_verify (line 291) | fn rsa_pkcs1v15_verify(
method rsa_oaep_encrypt (line 314) | fn rsa_oaep_encrypt(
method rsa_oaep_decrypt (line 347) | fn rsa_oaep_decrypt(
method ecdh_derive_bits (line 380) | fn ecdh_derive_bits(
method x25519_derive_bits (line 413) | fn x25519_derive_bits(
method aes_encrypt (line 432) | fn aes_encrypt(
method aes_decrypt (line 498) | fn aes_decrypt(
method aes_kw_wrap (line 566) | fn aes_kw_wrap(&self, kek: &[u8], key: &[u8]) -> Result<Vec<u8>, CryptoE...
method aes_kw_unwrap (line 574) | fn aes_kw_unwrap(&self, kek: &[u8], wrapped_key: &[u8]) -> Result<Vec<u8...
method hkdf_derive_key (line 583) | fn hkdf_derive_key(
method pbkdf2_derive_key (line 617) | fn pbkdf2_derive_key(
method generate_aes_key (line 632) | fn generate_aes_key(&self, length_bits: u16) -> Result<Vec<u8>, CryptoEr...
method generate_hmac_key (line 640) | fn generate_hmac_key(
method generate_ec_key (line 662) | fn generate_ec_key(&self, curve: EllipticCurve) -> Result<(Vec<u8>, Vec<...
method generate_ed25519_key (line 686) | fn generate_ed25519_key(&self) -> Result<(Vec<u8>, Vec<u8>), CryptoError> {
method generate_x25519_key (line 698) | fn generate_x25519_key(&self) -> Result<(Vec<u8>, Vec<u8>), CryptoError> {
method generate_rsa_key (line 710) | fn generate_rsa_key(
method import_rsa_public_key_pkcs1 (line 728) | fn import_rsa_public_key_pkcs1(
method import_rsa_private_key_pkcs1 (line 747) | fn import_rsa_private_key_pkcs1(
method import_rsa_public_key_spki (line 766) | fn import_rsa_public_key_spki(
method import_rsa_private_key_pkcs8 (line 788) | fn import_rsa_private_key_pkcs8(
method export_rsa_public_key_pkcs1 (line 810) | fn export_rsa_public_key_pkcs1(&self, key_data: &[u8]) -> Result<Vec<u8>...
method export_rsa_public_key_spki (line 817) | fn export_rsa_public_key_spki(&self, key_data: &[u8]) -> Result<Vec<u8>,...
method export_rsa_private_key_pkcs8 (line 826) | fn export_rsa_private_key_pkcs8(&self, key_data: &[u8]) -> Result<Vec<u8...
method import_ec_public_key_sec1 (line 835) | fn import_ec_public_key_sec1(
method import_ec_public_key_spki (line 859) | fn import_ec_public_key_spki(&self, der: &[u8]) -> Result<super::EcImpor...
method import_ec_private_key_pkcs8 (line 870) | fn import_ec_private_key_pkcs8(
method import_ec_private_key_sec1 (line 884) | fn import_ec_private_key_sec1(
method export_ec_public_key_sec1 (line 906) | fn export_ec_public_key_sec1(
method export_ec_public_key_spki (line 943) | fn export_ec_public_key_spki(
method export_ec_private_key_pkcs8 (line 954) | fn export_ec_private_key_pkcs8(
method import_okp_public_key_raw (line 965) | fn import_okp_public_key_raw(
method import_okp_public_key_spki (line 978) | fn import_okp_public_key_spki(
method import_okp_private_key_pkcs8 (line 994) | fn import_okp_private_key_pkcs8(
method export_okp_public_key_raw (line 1005) | fn export_okp_public_key_raw(
method export_okp_public_key_spki (line 1020) | fn export_okp_public_key_spki(
method export_okp_private_key_pkcs8 (line 1033) | fn export_okp_private_key_pkcs8(
method import_rsa_jwk (line 1042) | fn import_rsa_jwk(
method export_rsa_jwk (line 1103) | fn export_rsa_jwk(
method import_ec_jwk (line 1143) | fn import_ec_jwk(
method export_ec_jwk (line 1190) | fn export_ec_jwk(
method import_okp_jwk (line 1237) | fn import_okp_jwk(
method export_okp_jwk (line 1271) | fn export_okp_jwk(
FILE: modules/llrt_crypto/src/provider/ring.rs
type RingProvider (line 10) | pub struct RingProvider;
type RingDigestType (line 12) | pub enum RingDigestType {
type RingHmacType (line 20) | pub enum RingHmacType {
method update (line 28) | fn update(&mut self, data: &[u8]) {
method finalize (line 38) | fn finalize(self) -> Vec<u8> {
method update (line 50) | fn update(&mut self, data: &[u8]) {
method finalize (line 59) | fn finalize(self) -> Vec<u8> {
type RingDigest (line 70) | pub struct RingDigest {
method new (line 76) | fn new(algorithm: &'static digest::Algorithm) -> Self {
method update (line 85) | fn update(&mut self, data: &[u8]) {
method finalize (line 89) | fn finalize(self) -> Vec<u8> {
type RingMd5 (line 95) | pub struct RingMd5(Md5Hasher);
method update (line 98) | fn update(&mut self, data: &[u8]) {
method finalize (line 102) | fn finalize(self) -> Vec<u8> {
type RingHmacSha1 (line 108) | pub struct RingHmacSha1(hmac::Context);
type RingHmacSha256 (line 109) | pub struct RingHmacSha256(hmac::Context);
type RingHmacSha384 (line 110) | pub struct RingHmacSha384(hmac::Context);
type RingHmacSha512 (line 111) | pub struct RingHmacSha512(hmac::Context);
method update (line 114) | fn update(&mut self, data: &[u8]) {
method finalize (line 117) | fn finalize(self) -> Vec<u8> {
method update (line 122) | fn update(&mut self, data: &[u8]) {
method finalize (line 125) | fn finalize(self) -> Vec<u8> {
method update (line 130) | fn update(&mut self, data: &[u8]) {
method finalize (line 133) | fn finalize(self) -> Vec<u8> {
method update (line 138) | fn update(&mut self, data: &[u8]) {
method finalize (line 141) | fn finalize(self) -> Vec<u8> {
type Digest (line 147) | type Digest = RingDigestType;
type Hmac (line 148) | type Hmac = RingHmacType;
method digest (line 150) | fn digest(&self, algorithm: HashAlgorithm) -> Self::Digest {
method hmac (line 162) | fn hmac(&self, algorithm: HashAlgorithm, key: &[u8]) -> Self::Hmac {
method ecdsa_sign (line 182) | fn ecdsa_sign(
method ecdsa_verify (line 191) | fn ecdsa_verify(
method ed25519_sign (line 201) | fn ed25519_sign(&self, _private_key_der: &[u8], _data: &[u8]) -> Result<...
method ed25519_verify (line 205) | fn ed25519_verify(
method rsa_pss_sign (line 214) | fn rsa_pss_sign(
method rsa_pss_verify (line 224) | fn rsa_pss_verify(
method rsa_pkcs1v15_sign (line 235) | fn rsa_pkcs1v15_sign(
method rsa_pkcs1v15_verify (line 244) | fn rsa_pkcs1v15_verify(
method rsa_oaep_encrypt (line 254) | fn rsa_oaep_encrypt(
method rsa_oaep_decrypt (line 264) | fn rsa_oaep_decrypt(
method ecdh_derive_bits (line 274) | fn ecdh_derive_bits(
method x25519_derive_bits (line 283) | fn x25519_derive_bits(
method aes_encrypt (line 291) | fn aes_encrypt(
method aes_decrypt (line 302) | fn aes_decrypt(
method aes_kw_wrap (line 313) | fn aes_kw_wrap(&self, _kek: &[u8], _key: &[u8]) -> Result<Vec<u8>, Crypt...
method aes_kw_unwrap (line 317) | fn aes_kw_unwrap(&self, _kek: &[u8], _wrapped_key: &[u8]) -> Result<Vec<...
method hkdf_derive_key (line 321) | fn hkdf_derive_key(
method pbkdf2_derive_key (line 332) | fn pbkdf2_derive_key(
method generate_aes_key (line 343) | fn generate_aes_key(&self, _length_bits: u16) -> Result<Vec<u8>, CryptoE...
method generate_hmac_key (line 347) | fn generate_hmac_key(
method generate_ec_key (line 355) | fn generate_ec_key(&self, _curve: EllipticCurve) -> Result<(Vec<u8>, Vec...
method generate_ed25519_key (line 359) | fn generate_ed25519_key(&self) -> Result<(Vec<u8>, Vec<u8>), CryptoError> {
method generate_x25519_key (line 363) | fn generate_x25519_key(&self) -> Result<(Vec<u8>, Vec<u8>), CryptoError> {
method generate_rsa_key (line 367) | fn generate_rsa_key(
method import_rsa_public_key_pkcs1 (line 375) | fn import_rsa_public_key_pkcs1(
method import_rsa_private_key_pkcs1 (line 381) | fn import_rsa_private_key_pkcs1(
method import_rsa_public_key_spki (line 387) | fn import_rsa_public_key_spki(
method import_rsa_private_key_pkcs8 (line 393) | fn import_rsa_private_key_pkcs8(
method export_rsa_public_key_pkcs1 (line 399) | fn export_rsa_public_key_pkcs1(&self, _key_data: &[u8]) -> Result<Vec<u8...
method export_rsa_public_key_spki (line 402) | fn export_rsa_public_key_spki(&self, _key_data: &[u8]) -> Result<Vec<u8>...
method export_rsa_private_key_pkcs8 (line 405) | fn export_rsa_private_key_pkcs8(&self, _key_data: &[u8]) -> Result<Vec<u...
method import_ec_public_key_sec1 (line 408) | fn import_ec_public_key_sec1(
method import_ec_public_key_spki (line 415) | fn import_ec_public_key_spki(&self, _der: &[u8]) -> Result<super::EcImpo...
method import_ec_private_key_pkcs8 (line 418) | fn import_ec_private_key_pkcs8(
method import_ec_private_key_sec1 (line 424) | fn import_ec_private_key_sec1(
method export_ec_public_key_sec1 (line 431) | fn export_ec_public_key_sec1(
method export_ec_public_key_spki (line 439) | fn export_ec_public_key_spki(
method export_ec_private_key_pkcs8 (line 446) | fn export_ec_private_key_pkcs8(
method import_okp_public_key_raw (line 453) | fn import_okp_public_key_raw(
method import_okp_public_key_spki (line 459) | fn import_okp_public_key_spki(
method import_okp_private_key_pkcs8 (line 466) | fn import_okp_private_key_pkcs8(
method export_okp_public_key_raw (line 473) | fn export_okp_public_key_raw(
method export_okp_public_key_spki (line 480) | fn export_okp_public_key_spki(
method export_okp_private_key_pkcs8 (line 487) | fn export_okp_private_key_pkcs8(
method import_rsa_jwk (line 494) | fn import_rsa_jwk(
method export_rsa_jwk (line 500) | fn export_rsa_jwk(
method import_ec_jwk (line 507) | fn import_ec_jwk(
method export_ec_jwk (line 514) | fn export_ec_jwk(
method import_okp_jwk (line 522) | fn import_okp_jwk(
method export_okp_jwk (line 529) | fn export_okp_jwk(
FILE: modules/llrt_crypto/src/provider/rust/aes_variants.rs
type AesCbcEncVariant (line 25) | pub enum AesCbcEncVariant {
method new (line 33) | pub fn new(key_len: u16, key: &[u8], iv: &[u8]) -> std::result::Result...
method encrypt (line 44) | pub fn encrypt(self, data: &[u8]) -> Vec<u8> {
type AesCbcDecVariant (line 54) | pub enum AesCbcDecVariant {
method new (line 62) | pub fn new(key_len: u16, key: &[u8], iv: &[u8]) -> std::result::Result...
method decrypt (line 73) | pub fn decrypt(self, data: &[u8]) -> std::result::Result<Vec<u8>, Padd...
type AesCtrVariant (line 83) | pub enum AesCtrVariant {
method new (line 97) | pub fn new(
method encrypt (line 119) | pub fn encrypt(&mut self, data: &[u8]) -> std::result::Result<Vec<u8>,...
method decrypt (line 135) | pub fn decrypt(&mut self, data: &[u8]) -> std::result::Result<Vec<u8>,...
type AesGcmVariant (line 152) | pub enum AesGcmVariant {
method new (line 172) | pub fn new(
method encrypt (line 199) | pub fn encrypt(
method decrypt (line 230) | pub fn decrypt(
FILE: modules/llrt_crypto/src/provider/rust/mod.rs
method from (line 66) | fn from(_: aes::cipher::InvalidLength) -> Self {
method from (line 72) | fn from(_: StreamCipherError) -> Self {
type RustDigest (line 78) | pub enum RustDigest {
method update (line 87) | fn update(&mut self, data: &[u8]) {
method finalize (line 97) | fn finalize(self) -> Vec<u8> {
type RustHmac (line 109) | pub enum RustHmac {
method update (line 117) | fn update(&mut self, data: &[u8]) {
method finalize (line 126) | fn finalize(self) -> Vec<u8> {
type RustCryptoProvider (line 138) | pub struct RustCryptoProvider;
type Digest (line 141) | type Digest = RustDigest;
type Hmac (line 142) | type Hmac = RustHmac;
method digest (line 144) | fn digest(&self, algorithm: HashAlgorithm) -> Self::Digest {
method hmac (line 154) | fn hmac(&self, algorithm: HashAlgorithm, key: &[u8]) -> Self::Hmac {
method ecdsa_sign (line 170) | fn ecdsa_sign(
method ecdsa_verify (line 207) | fn ecdsa_verify(
method ed25519_sign (line 239) | fn ed25519_sign(&self, private_key_der: &[u8], data: &[u8]) -> Result<Ve...
method ed25519_verify (line 248) | fn ed25519_verify(
method rsa_pss_sign (line 268) | fn rsa_pss_sign(
method rsa_pss_verify (line 293) | fn rsa_pss_verify(
method rsa_pkcs1v15_sign (line 318) | fn rsa_pkcs1v15_sign(
method rsa_pkcs1v15_verify (line 342) | fn rsa_pkcs1v15_verify(
method rsa_oaep_encrypt (line 366) | fn rsa_oaep_encrypt(
method rsa_oaep_decrypt (line 426) | fn rsa_oaep_decrypt(
method ecdh_derive_bits (line 485) | fn ecdh_derive_bits(
method x25519_derive_bits (line 528) | fn x25519_derive_bits(
method aes_encrypt (line 547) | fn aes_encrypt(
method aes_decrypt (line 646) | fn aes_decrypt(
method aes_kw_wrap (line 712) | fn aes_kw_wrap(&self, kek: &[u8], key: &[u8]) -> Result<Vec<u8>, CryptoE...
method aes_kw_unwrap (line 745) | fn aes_kw_unwrap(&self, kek: &[u8], wrapped_key: &[u8]) -> Result<Vec<u8...
method hkdf_derive_key (line 778) | fn hkdf_derive_key(
method pbkdf2_derive_key (line 811) | fn pbkdf2_derive_key(
method generate_aes_key (line 840) | fn generate_aes_key(&self, length_bits: u16) -> Result<Vec<u8>, CryptoEr...
method generate_hmac_key (line 848) | fn generate_hmac_key(
method generate_ec_key (line 866) | fn generate_ec_key(&self, curve: EllipticCurve) -> Result<(Vec<u8>, Vec<...
method generate_ed25519_key (line 903) | fn generate_ed25519_key(&self) -> Result<(Vec<u8>, Vec<u8>), CryptoError> {
method generate_x25519_key (line 916) | fn generate_x25519_key(&self) -> Result<(Vec<u8>, Vec<u8>), CryptoError> {
method generate_rsa_key (line 926) | fn generate_rsa_key(
method import_rsa_public_key_pkcs1 (line 961) | fn import_rsa_public_key_pkcs1(
method import_rsa_private_key_pkcs1 (line 981) | fn import_rsa_private_key_pkcs1(
method import_rsa_public_key_spki (line 1001) | fn import_rsa_public_key_spki(
method import_rsa_private_key_pkcs8 (line 1023) | fn import_rsa_private_key_pkcs8(
method export_rsa_public_key_pkcs1 (line 1046) | fn export_rsa_public_key_pkcs1(&self, key_data: &[u8]) -> Result<Vec<u8>...
method export_rsa_public_key_spki (line 1051) | fn export_rsa_public_key_spki(&self, key_data: &[u8]) -> Result<Vec<u8>,...
method export_rsa_private_key_pkcs8 (line 1070) | fn export_rsa_private_key_pkcs8(&self, key_data: &[u8]) -> Result<Vec<u8...
method import_ec_public_key_sec1 (line 1079) | fn import_ec_public_key_sec1(
method import_ec_public_key_spki (line 1090) | fn import_ec_public_key_spki(&self, der: &[u8]) -> Result<super::EcImpor...
method import_ec_private_key_pkcs8 (line 1099) | fn import_ec_private_key_pkcs8(
method import_ec_private_key_sec1 (line 1109) | fn import_ec_private_key_sec1(
method export_ec_public_key_sec1 (line 1147) | fn export_ec_public_key_sec1(
method export_ec_public_key_spki (line 1178) | fn export_ec_public_key_spki(
method export_ec_private_key_pkcs8 (line 1201) | fn export_ec_private_key_pkcs8(
method import_okp_public_key_raw (line 1210) | fn import_okp_public_key_raw(
method import_okp_public_key_spki (line 1223) | fn import_okp_public_key_spki(
method import_okp_private_key_pkcs8 (line 1236) | fn import_okp_private_key_pkcs8(
method export_okp_public_key_raw (line 1247) | fn export_okp_public_key_raw(
method export_okp_public_key_spki (line 1273) | fn export_okp_public_key_spki(
method export_okp_private_key_pkcs8 (line 1292) | fn export_okp_private_key_pkcs8(
method import_rsa_jwk (line 1301) | fn import_rsa_jwk(
method export_rsa_jwk (line 1349) | fn export_rsa_jwk(
method import_ec_jwk (line 1384) | fn import_ec_jwk(
method export_ec_jwk (line 1434) | fn export_ec_jwk(
method import_okp_jwk (line 1494) | fn import_okp_jwk(
method export_okp_jwk (line 1542) | fn export_okp_jwk(
FILE: modules/llrt_crypto/src/subtle/crypto_key.rs
type KeyKind (line 15) | pub enum KeyKind {
type CryptoKey (line 25) | pub struct CryptoKey {
method new (line 35) | pub fn new<N, H>(
method trace (line 59) | fn trace<'a>(&self, _: Tracer<'a, 'js>) {}
method constructor (line 65) | fn constructor(ctx: Ctx<'_>) -> Result<Self> {
method get_type (line 70) | pub fn get_type(&self) -> &str {
method extractable (line 75) | pub fn extractable(&self) -> bool {
method to_string_tag (line 80) | pub fn to_string_tag(&self) -> &'static str {
method algorithm (line 85) | pub fn algorithm<'js>(&self, ctx: Ctx<'js>) -> Result<Value<'js>> {
method usages (line 92) | pub fn usages(&self) -> Vec<String> {
method check_validity (line 98) | pub fn check_validity(&self, usage: &str) -> std::result::Result<(), S...
FILE: modules/llrt_crypto/src/subtle/derive.rs
function subtle_derive_bits (line 17) | pub async fn subtle_derive_bits<'js>(
function derive_bits (line 30) | fn derive_bits(
function subtle_derive_key (line 93) | pub async fn subtle_derive_key<'js>(
FILE: modules/llrt_crypto/src/subtle/derive_algorithm.rs
type DeriveAlgorithm (line 15) | pub enum DeriveAlgorithm {
method from_js (line 27) | fn from_js(ctx: &Ctx<'js>, value: Value<'js>) -> Result<Self> {
FILE: modules/llrt_crypto/src/subtle/digest.rs
function subtle_digest (line 12) | pub async fn subtle_digest<'js>(
function digest (line 28) | pub fn digest(hash_algorithm: &HashAlgorithm, data: &[u8]) -> Vec<u8> {
FILE: modules/llrt_crypto/src/subtle/encryption.rs
function subtle_decrypt (line 19) | pub async fn subtle_decrypt<'js>(
function subtle_encrypt (line 38) | pub async fn subtle_encrypt<'js>(
type EncryptionOperation (line 58) | pub enum EncryptionOperation {
function encrypt_decrypt (line 63) | pub fn encrypt_decrypt(
FILE: modules/llrt_crypto/src/subtle/encryption_algorithm.rs
type EncryptionAlgorithm (line 9) | pub enum EncryptionAlgorithm {
method from_js (line 29) | fn from_js(ctx: &Ctx<'js>, value: Value<'js>) -> Result<Self> {
FILE: modules/llrt_crypto/src/subtle/export_key.rs
function algorithm_export_error (line 19) | pub fn algorithm_export_error<T>(ctx: &Ctx<'_>, algorithm: &str, format:...
type ExportOutput (line 26) | pub enum ExportOutput<'js> {
function subtle_export_key (line 31) | pub async fn subtle_export_key<'js>(
function export_key (line 44) | pub fn export_key<'js>(
function export_raw (line 64) | fn export_raw(ctx: &Ctx<'_>, key: &CryptoKey) -> Result<Vec<u8>> {
function export_pkcs8 (line 89) | fn export_pkcs8(ctx: &Ctx<'_>, key: &CryptoKey) -> Result<Vec<u8>> {
function export_spki (line 119) | fn export_spki(ctx: &Ctx<'_>, key: &CryptoKey) -> Result<Vec<u8>> {
function export_jwk (line 143) | fn export_jwk<'js>(ctx: &Ctx<'js>, key: &CryptoKey) -> Result<Object<'js...
FILE: modules/llrt_crypto/src/subtle/generate_key.rs
function subtle_generate_key (line 15) | pub async fn subtle_generate_key<'js>(
function generate_key (line 78) | fn generate_key(ctx: &Ctx<'_>, algorithm: &KeyAlgorithm) -> Result<(Vec<...
function generate_symmetric_key (line 118) | fn generate_symmetric_key(_ctx: &Ctx<'_>, length: usize) -> Result<Vec<u...
function get_hash_length (line 123) | pub fn get_hash_length(ctx: &Ctx, hash: &HashAlgorithm, length: u16) -> ...
FILE: modules/llrt_crypto/src/subtle/import_key.rs
function subtle_import_key (line 15) | pub async fn subtle_import_key<'js>(
function import_key (line 33) | pub fn import_key<'js>(
FILE: modules/llrt_crypto/src/subtle/key_algorithm.rs
type KeyUsage (line 29) | pub enum KeyUsage {
type Error (line 42) | type Error = String;
method try_from (line 44) | fn try_from(s: &str) -> std::result::Result<Self, Self::Error> {
method classify_and_check_usages (line 60) | fn classify_and_check_usages<'js>(
method mask (line 136) | const fn mask(self) -> u16 {
type KeyUsageAlgorithm (line 143) | pub enum KeyUsageAlgorithm {
method masks (line 168) | fn masks(&self) -> (u16, u16) {
type KeyDerivation (line 177) | pub enum KeyDerivation {
method for_hkdf_object (line 191) | pub fn for_hkdf_object<'js>(ctx: &Ctx<'js>, obj: Object<'js>) -> Resul...
method for_pbkf2_object (line 207) | pub fn for_pbkf2_object<'js>(ctx: &&Ctx<'js>, obj: Object<'js>) -> Res...
type EcAlgorithm (line 225) | pub enum EcAlgorithm {
type KeyAlgorithm (line 231) | pub enum KeyAlgorithm {
method from_js (line 752) | pub fn from_js<'js>(
method as_object (line 866) | pub fn as_object<'js, T: AsRef<str>>(&self, ctx: &Ctx<'js>, name: T) -...
method from_ec (line 921) | fn from_ec<'js>(
type KeyFormat (line 255) | pub enum KeyFormat {
method from_js (line 265) | fn from_js(ctx: &Ctx<'js>, value: Value<'js>) -> Result<Self> {
type KeyFormatData (line 283) | pub enum KeyFormatData<'js> {
type KeyAlgorithmMode (line 290) | pub enum KeyAlgorithmMode<'a, 'js> {
type KeyAlgorithmWithUsages (line 300) | pub struct KeyAlgorithmWithUsages {
function from_ed25519 (line 307) | fn from_ed25519<'js>(
function from_x25519 (line 359) | fn from_x25519<'js>(
function from_aes (line 411) | fn from_aes<'js>(
function from_hmac (line 478) | fn from_hmac<'js>(
function from_rsa (line 538) | fn from_rsa<'js>(
function from_hkdf (line 617) | fn from_hkdf<'js>(
function from_pbkdf2 (line 684) | fn from_pbkdf2<'js>(
function import_derive_key (line 960) | fn import_derive_key<'js>(
function import_rsa_key (line 981) | fn import_rsa_key<'js>(
function import_symmetric_key (line 1122) | fn import_symmetric_key<'js>(
constant EC_ALGORITHM_OID (line 1178) | const EC_ALGORITHM_OID: const_oid::ObjectIdentifier =
function import_ec_key (line 1182) | fn import_ec_key<'js>(
function import_okp_key (line 1300) | fn import_okp_key<'js>(
function extract_sha_hash (line 1370) | pub fn extract_sha_hash<'js>(ctx: &Ctx<'js>, obj: &Object<'js>) -> Resul...
function create_hash_object (line 1385) | fn create_hash_object<'js>(ctx: &Ctx<'js>, hash: &HashAlgorithm) -> Resu...
function hash_mismatch_error (line 1392) | pub fn hash_mismatch_error<T>(ctx: &Ctx<'_>, hash: &HashAlgorithm) -> Re...
FILE: modules/llrt_crypto/src/subtle/mod.rs
type SubtleCrypto (line 57) | pub struct SubtleCrypto {}
method new (line 62) | pub fn new(ctx: Ctx<'_>) -> Result<Self> {
method to_string_tag (line 67) | pub fn to_string_tag(&self) -> &'static str {
type EllipticCurve (line 73) | pub enum EllipticCurve {
type EncryptionMode (line 81) | pub enum EncryptionMode {
function rsa_hash_digest (line 87) | pub fn rsa_hash_digest<'a>(
function validate_aes_length (line 114) | pub fn validate_aes_length(
function to_name_and_maybe_object (line 142) | pub fn to_name_and_maybe_object<'js, 'a>(
function algorithm_mismatch_error (line 163) | pub fn algorithm_mismatch_error<T>(ctx: &Ctx<'_>, expected_algorithm: &s...
function algorithm_not_supported_error (line 170) | pub fn algorithm_not_supported_error<T>(ctx: &Ctx<'_>) -> Result<T> {
FILE: modules/llrt_crypto/src/subtle/sign.rs
function subtle_sign (line 14) | pub async fn subtle_sign<'js>(
function sign (line 27) | fn sign(
FILE: modules/llrt_crypto/src/subtle/sign_algorithm.rs
type SigningAlgorithm (line 13) | pub enum SigningAlgorithm {
method from_js (line 22) | fn from_js(ctx: &Ctx<'js>, value: Value<'js>) -> Result<Self> {
FILE: modules/llrt_crypto/src/subtle/stubs.rs
function subtle_export_key (line 13) | pub async fn subtle_export_key<'js>(
function subtle_import_key (line 24) | pub async fn subtle_import_key<'js>(
function subtle_wrap_key (line 38) | pub async fn subtle_wrap_key<'js>(
function subtle_unwrap_key (line 51) | pub async fn subtle_unwrap_key<'js>(
FILE: modules/llrt_crypto/src/subtle/verify.rs
function subtle_verify (line 17) | pub async fn subtle_verify<'js>(
function verify (line 36) | fn verify(
FILE: modules/llrt_crypto/src/subtle/wrapping.rs
function subtle_wrap_key (line 18) | pub async fn subtle_wrap_key<'js>(
function subtle_unwrap_key (line 53) | pub async fn subtle_unwrap_key<'js>(
FILE: modules/llrt_dgram/src/lib.rs
type DgramModule (line 15) | pub struct DgramModule;
method declare (line 18) | fn declare(declare: &Declarations) -> Result<()> {
method evaluate (line 25) | fn evaluate<'js>(ctx: &Ctx<'js>, exports: &Exports<'js>) -> Result<()> {
function from (line 44) | fn from(val: DgramModule) -> Self {
function test_module_loads (line 59) | async fn test_module_loads() {
function test_create_socket_function_exists (line 71) | async fn test_create_socket_function_exists() {
function test_socket_creation (line 95) | async fn test_socket_creation() {
function test_bind_failure_emits_error (line 124) | async fn test_bind_failure_emits_error() {
function test_close_clears_send_channel (line 167) | async fn test_close_clears_send_channel() {
function test_send_after_close_fails (line 208) | async fn test_send_after_close_fails() {
function test_double_close_fails (line 249) | async fn test_double_close_fails() {
FILE: modules/llrt_dgram/src/socket.rs
type SendResult (line 23) | type SendResult = std::result::Result<usize, String>;
type SendMessage (line 24) | type SendMessage = (Vec<u8>, String, Option<oneshot::Sender<SendResult>>);
type Socket (line 27) | pub struct Socket<'js> {
type Changed (line 42) | type Changed<'to> = Socket<'to>;
function trace (line 46) | fn trace<'a>(&self, tracer: Tracer<'a, 'js>) {
function get_event_list (line 52) | fn get_event_list(&self) -> Arc<RwLock<EventList<'js>>> {
function on_event_changed (line 56) | fn on_event_changed(&mut self, _event: EventKey<'js>, _added: bool) -> R...
function ctor (line 64) | pub fn ctor(ctx: Ctx<'js>, type_or_options: Value<'js>) -> Result<Class<...
function start_listening (line 106) | fn start_listening(
function ensure_listening (line 285) | fn ensure_listening(this: Class<'js, Self>, ctx: Ctx<'js>) -> Result<Arc...
function bind (line 304) | pub fn bind(
function send (line 365) | pub fn send(
function close (line 463) | pub fn close(
function address (line 509) | pub fn address(this: This<Class<'js, Self>>, ctx: Ctx<'js>) -> Result<Ob...
function unref (line 527) | pub fn unref(this: This<Class<'js, Self>>) -> Result<Class<'js, Self>> {
function r#ref (line 535) | pub fn r#ref(this: This<Class<'js, Self>>) -> Result<Class<'js, Self>> {
FILE: modules/llrt_dns/src/lib.rs
type DnsModule (line 14) | pub struct DnsModule;
method declare (line 17) | fn declare(declare: &Declarations) -> Result<()> {
method evaluate (line 24) | fn evaluate<'js>(ctx: &Ctx<'js>, exports: &Exports<'js>) -> Result<()> {
function from (line 35) | fn from(val: DnsModule) -> Self {
FILE: modules/llrt_dns/src/lookup.rs
constant ERROR_MSG_OPTIONS_FAMILY (line 14) | const ERROR_MSG_OPTIONS_FAMILY: &str = "The argument 'family' must be on...
constant ERROR_MSG_OPTIONS_ORDER (line 15) | const ERROR_MSG_OPTIONS_ORDER: &str =
function lookup (line 18) | pub fn lookup<'js>(
function lookup_host (line 68) | async fn lookup_host(
type LookupValue (line 108) | struct LookupValue {
method into_js (line 114) | fn into_js(self, ctx: &Ctx<'js>) -> Result<Value<'js>> {
type LookupOrder (line 123) | pub enum LookupOrder {
type LookupOptions (line 129) | pub struct LookupOptions {
method from_js (line 146) | fn from_js(ctx: &Ctx<'js>, value: Value<'js>) -> Result<Self> {
method default (line 136) | fn default() -> Self {
function test_lookup (line 214) | async fn test_lookup() {
function test_lookup_v6 (line 249) | async fn test_lookup_v6() {
function test_lookup_all (line 288) | async fn test_lookup_all() {
function test_lookup_order (line 324) | async fn test_lookup_order() {
FILE: modules/llrt_events/src/custom_event.rs
type CustomEvent (line 9) | pub struct CustomEvent<'js> {
function new (line 17) | pub fn new(event_type: String, options: Opt<Value<'js>>) -> Result<Self> {
function detail (line 28) | pub fn detail(&self, ctx: Ctx<'js>) -> Result<Value<'js>> {
function event_type (line 36) | pub fn event_type(&self) -> String {
FILE: modules/llrt_events/src/event.rs
type Event (line 9) | pub struct Event {
method new (line 19) | pub fn new(event_type: String, options: Opt<Value<'_>>) -> Result<Self> {
method bubbles (line 43) | pub fn bubbles(&self) -> bool {
method cancelable (line 48) | pub fn cancelable(&self) -> bool {
method composed (line 53) | pub fn composed(&self) -> bool {
method event_type (line 58) | pub fn event_type(&self) -> String {
FILE: modules/llrt_events/src/event_target.rs
type EventTarget (line 14) | pub struct EventTarget<'js> {
type Changed (line 19) | type Changed<'to> = EventTarget<'to>;
function get_event_list (line 23) | fn get_event_list(&self) -> Arc<RwLock<EventList<'js>>> {
function trace (line 29) | fn trace<'a>(&self, tracer: Tracer<'a, 'js>) {
function new (line 37) | pub fn new() -> Self {
FILE: modules/llrt_events/src/lib.rs
type EventKey (line 32) | pub enum EventKey<'js> {
function from_value (line 38) | fn from_value(ctx: &Ctx, value: Value<'js>) -> Result<Self> {
method eq (line 52) | fn eq(&self, other: &Self) -> bool {
type EventItem (line 61) | pub struct EventItem<'js> {
type EventList (line 66) | pub type EventList<'js> = Vec<(EventKey<'js>, Vec<EventItem<'js>>)>;
type Events (line 67) | pub type Events<'js> = Arc<RwLock<EventList<'js>>>;
type EventEmitter (line 71) | pub struct EventEmitter<'js> {
type Changed (line 76) | type Changed<'to> = EventEmitter<'to>;
function get_event_list (line 80) | fn get_event_list(&self) -> Arc<RwLock<EventList<'js>>> {
function trace (line 86) | fn trace<'a>(&self, tracer: Tracer<'a, 'js>) {
function new (line 94) | pub fn new() -> Self {
type EmitError (line 102) | pub trait EmitError<'js> {
method emit_error (line 103) | fn emit_error<C>(self, id: &'static str, ctx: &Ctx<'js>, this: Class<'...
function emit_error (line 109) | fn emit_error<C>(self, id: &'static str, ctx: &Ctx<'js>, this: Class<'js...
type Emitter (line 126) | pub trait Emitter<'js>
method get_event_list (line 130) | fn get_event_list(&self) -> Arc<RwLock<EventList<'js>>>;
method on_event_changed (line 132) | fn on_event_changed(&mut self, _event: EventKey<'js>, _added: bool) ->...
method add_event_emitter_prototype (line 136) | fn add_event_emitter_prototype(ctx: &Ctx<'js>) -> Result<Object<'js>> {
method add_event_target_prototype (line 167) | fn add_event_target_prototype(ctx: &Ctx<'js>) -> Result<Object<'js>> {
method trace_event_emitter (line 183) | fn trace_event_emitter<'a>(&self, tracer: Tracer<'a, 'js>) {
method remove_event_listener_str (line 197) | fn remove_event_listener_str(
method remove_event_listener (line 207) | fn remove_event_listener(
method add_event_listener_str (line 230) | fn add_event_listener_str(
method once (line 242) | fn once(
method on (line 251) | fn on(
method prepend_listener (line 260) | fn prepend_listener(
method prepend_once_listener (line 269) | fn prepend_once_listener(
method evt_add_event_listener (line 278) | fn evt_add_event_listener(
method add_event_listener (line 294) | fn add_event_listener(
method has_listener_str (line 333) | fn has_listener_str(&self, event: &str) -> bool {
method has_listener (line 339) | fn has_listener(&self, ctx: Ctx<'js>, event: Value<'js>) -> Result<boo...
method get_listeners (line 345) | fn get_listeners(&self, ctx: &Ctx<'js>, event: Value<'js>) -> Result<V...
method get_listeners_str (line 350) | fn get_listeners_str(&self, event: &str) -> Vec<Function<'js>> {
method do_emit (line 355) | fn do_emit(
method emit_str (line 394) | fn emit_str(
method emit (line 405) | fn emit(
method evt_dispatch_event (line 414) | fn evt_dispatch_event(
method event_names (line 423) | fn event_names(this: This<OwnedBorrow<'js, Self>>, ctx: Ctx<'js>) -> R...
function find_all_listeners (line 441) | fn find_all_listeners<'js>(
function has_key (line 454) | fn has_key<'js>(event_list: Arc<RwLock<EventList<'js>>>, key: EventKey<'...
function to_event (line 458) | fn to_event<'js>(ctx: &Ctx<'js>, event: &str) -> Result<Value<'js>> {
type EventsModule (line 463) | pub struct EventsModule;
method declare (line 466) | fn declare(declare: &Declarations) -> Result<()> {
method evaluate (line 473) | fn evaluate<'js>(ctx: &Ctx<'js>, exports: &Exports<'js>) -> Result<()> {
function from (line 487) | fn from(val: EventsModule) -> Self {
function init (line 495) | pub fn init(ctx: &Ctx<'_>) -> Result<()> {
FILE: modules/llrt_exceptions/src/lib.rs
type DOMException (line 17) | pub struct DOMException {
constant NAME (line 61) | const NAME: &'static str = "DOMException";
type Mutable (line 62) | type Mutable = rquickjs::class::Writable;
method prototype (line 63) | fn prototype(ctx: &Ctx<'js>) -> rquickjs::Result<Option<Object<'js>>> {
method constructor (line 72) | fn constructor(ctx: &Ctx<'js>) -> Result<Option<Constructor<'js>>> {
method into_js (line 85) | fn into_js(self, ctx: &rquickjs::Ctx<'js>) -> Result<Value<'js>> {
method from_js (line 96) | fn from_js(ctx: &Ctx<'js>, value: Value<'js>) -> Result<Self> {
method new (line 107) | pub fn new(
method new_with_name (line 134) | pub fn new_with_name(ctx: &Ctx<'_>, name: DOMExceptionName, message: S...
method message (line 150) | fn message(&self) -> &str {
method name (line 155) | pub fn name(&self) -> &str {
method code (line 160) | pub fn code(&self) -> u8 {
method stack (line 165) | fn stack(&self) -> String {
method to_string_tag (line 170) | pub fn to_string_tag(&self) -> &str {
function add_constants (line 24) | fn add_constants(obj: &Object<'_>) -> Result<()> {
method code (line 248) | fn code(&self) -> u8 {
function init (line 277) | pub fn init(ctx: &Ctx<'_>) -> Result<()> {
FILE: modules/llrt_fetch/src/body.rs
type BodyVariant (line 19) | enum BodyVariant<'js> {
type Body (line 25) | pub struct Body<'js> {
type Changed (line 31) | type Changed<'to> = Body<'to>;
function trace (line 35) | fn trace<'a>(&self, tracer: Tracer<'a, 'js>) {
function text (line 44) | pub async fn text(&mut self, ctx: Ctx<'js>) -> Result<String> {
function json (line 49) | pub async fn json(&mut self, ctx: Ctx<'js>) -> Result<Value<'js>> {
function array_buffer (line 54) | pub async fn array_buffer(&mut self, ctx: Ctx<'js>) -> Result<ArrayBuffe...
function typed_array (line 59) | pub async fn typed_array(&mut self, ctx: Ctx<'js>) -> Result<TypedArray<...
function blob (line 64) | pub async fn blob(&mut self, ctx: Ctx<'js>) -> Result<Blob> {
function form_data (line 69) | async fn form_data(&mut self, ctx: Ctx<'js>) -> Result<FormData> {
function bytes (line 78) | pub async fn bytes(&mut self, ctx: Ctx<'js>) -> Result<Value<'js>> {
function is_used (line 83) | pub fn is_used(&self) -> bool {
function get_text (line 92) | pub async fn get_text(ctx: Ctx<'js>, body: Option<&Class<'js, Self>>) ->...
function get_json (line 99) | pub async fn get_json(ctx: Ctx<'js>, body: Option<&Class<'js, Self>>) ->...
function get_array_buffer (line 106) | pub async fn get_array_buffer(
function get_blob (line 116) | pub async fn get_blob(ctx: Ctx<'js>, body: Option<&Class<'js, Self>>) ->...
function get_body (line 123) | pub fn get_body(ctx: Ctx<'js>, body: Option<&Class<'js, Self>>) -> Resul...
function from_value (line 130) | pub fn from_value(
function from_incoming (line 150) | pub fn from_incoming(
function take_bytes (line 164) | pub async fn take_bytes(&mut self, ctx: &Ctx<'js>) -> Result<Vec<u8>> {
FILE: modules/llrt_fetch/src/fetch.rs
constant BLOCKED_PORTS (line 35) | const BLOCKED_PORTS: [u16; 83] = [
constant MAX_REDIRECT_COUNT (line 43) | const MAX_REDIRECT_COUNT: u32 = 20;
function init (line 45) | pub fn init(global_client: HyperClient, globals: &Object) -> Result<()> {
function parse_data_url (line 157) | fn parse_data_url<'js>(ctx: &Ctx<'js>, data_url: &str, method: &Method) ...
function build_request (line 205) | fn build_request(
function is_same_origin (line 279) | fn is_same_origin(uri: &Uri, initial_uri: &Uri) -> bool {
function is_same_scheme (line 285) | fn is_same_scheme(uri: &Uri, initial_uri: &Uri) -> bool {
function is_same_host (line 289) | fn is_same_host(uri: &Uri, initial_uri: &Uri) -> bool {
function is_same_port (line 293) | fn is_same_port(uri: &Uri, initial_uri: &Uri) -> bool {
function should_change_method (line 297) | fn should_change_method(prev_status: u16, method: &Method) -> bool {
function is_request_body_header_name (line 309) | fn is_request_body_header_name(key: &str) -> bool {
function is_cors_non_wildcard_request_header_name (line 316) | fn is_cors_non_wildcard_request_header_name(key: &str) -> bool {
type BodyBytes (line 320) | struct BodyBytes<'js> {
function new (line 326) | fn new(ctx: Ctx<'js>, object_bytes: ObjectBytes<'js>) -> Result<Self> {
type FetchOptions (line 334) | struct FetchOptions<'js> {
function get_fetch_options (line 344) | fn get_fetch_options<'js>(
function get_option (line 462) | fn get_option<'js, V: FromJs<'js> + Sized>(
function test_should_change_method (line 505) | fn test_should_change_method() {
function test_is_request_body_header_name (line 527) | fn test_is_request_body_header_name() {
function test_is_same_origin (line 538) | fn test_is_same_origin() {
function test_is_same_scheme (line 561) | fn test_is_same_scheme() {
function test_is_same_host (line 574) | fn test_is_same_host() {
function test_is_same_port (line 587) | fn test_is_same_port() {
function test_fetch_function (line 610) | async fn test_fetch_function() {
function test_fetch_tls (line 883) | async fn test_fetch_tls() {
function test_fetch_ignore_certificate_errors (line 930) | async fn test_fetch_ignore_certificate_errors() {
FILE: modules/llrt_fetch/src/form_data.rs
type FormValue (line 17) | enum FormValue {
method into_js (line 24) | fn into_js(self, ctx: &Ctx<'js>) -> Result<Value<'js>> {
type FormData (line 35) | pub struct FormData {
method js_entries (line 41) | fn js_entries(&self, ctx: Ctx<'js>) -> Result<Array<'js>> {
method new (line 50) | pub fn new(_form: Opt<Value<'js>>, _submitter: Opt<Value<'js>>) -> Self {
method append (line 56) | pub fn append(&self, ctx: Ctx<'js>, name: String, value: Value<'js>) -...
method get (line 81) | pub fn get(&self, ctx: Ctx<'js>, name: String) -> Result<Option<Value<...
method get_all (line 91) | pub fn get_all(&self, ctx: Ctx<'js>, name: String) -> Result<Vec<Value...
method has (line 101) | pub fn has(&self, ctx: Ctx<'js>, name: String) -> Result<bool> {
method set (line 107) | pub fn set(&self, ctx: Ctx<'js>, name: String, value: Value<'js>) -> R...
method delete (line 133) | pub fn delete(&self, ctx: Ctx<'js>, name: String) -> Result<()> {
method keys (line 140) | pub fn keys(&self, ctx: Ctx<'js>) -> Result<Vec<String>> {
method values (line 146) | pub fn values(&self, ctx: Ctx<'js>) -> Result<Vec<Value<'js>>> {
method entries (line 156) | pub fn entries(&self, ctx: Ctx<'js>) -> Result<Value<'js>> {
method iterator (line 161) | pub fn iterator(&self, ctx: Ctx<'js>) -> Result<Value<'js>> {
method for_each (line 165) | pub fn for_each(&self, ctx: Ctx<'js>, callback: Function<'js>) -> Resu...
method to_string_tag (line 177) | pub fn to_string_tag(&self) -> &'static str {
method iter (line 184) | pub fn iter<'js>(&self, ctx: &Ctx<'js>) -> Result<impl Iterator<Item =...
method from_multipart_bytes (line 191) | pub fn from_multipart_bytes<'js>(
method to_multipart_bytes (line 269) | pub fn to_multipart_bytes<'js>(&self, ctx: &Ctx<'js>) -> Result<(Vec<u...
function extract_boundary (line 312) | fn extract_boundary(content_type: &str) -> Option<String> {
function generate_boundary (line 324) | fn generate_boundary() -> String {
FILE: modules/llrt_fetch/src/headers.rs
constant HEADERS_KEY_COOKIE (line 19) | const HEADERS_KEY_COOKIE: &str = "cookie";
constant HEADERS_KEY_SET_COOKIE (line 20) | const HEADERS_KEY_SET_COOKIE: &str = "set-cookie";
constant HEADERS_KEY_CONTENT_TYPE (line 21) | pub const HEADERS_KEY_CONTENT_TYPE: &str = "content-type";
type ImmutableString (line 23) | type ImmutableString = Rc<str>;
type HeadersGuard (line 27) | pub enum HeadersGuard {
type Headers (line 38) | pub struct Headers {
method new (line 48) | pub fn new<'js>(ctx: Ctx<'js>, init: Opt<Value<'js>>) -> Result<Self> {
method append (line 62) | pub fn append<'js>(&mut self, ctx: Ctx<'js>, key: String, value: Value...
method get (line 106) | pub fn get<'js>(&self, ctx: Ctx<'js>, key: String) -> Result<Value<'js...
method get_set_cookie (line 131) | pub fn get_set_cookie(&self) -> Vec<&str> {
method has (line 144) | pub fn has<'js>(&self, ctx: Ctx<'js>, key: String) -> Result<bool> {
method set (line 153) | pub fn set<'js>(&mut self, ctx: Ctx<'js>, key: String, value: Value<'j...
method delete (line 184) | pub fn delete<'js>(&mut self, ctx: Ctx<'js>, key: String) -> Result<()> {
method keys (line 194) | pub fn keys<'js>(&self, ctx: Ctx<'js>) -> Result<Value<'js>> {
method values (line 204) | pub fn values<'js>(&self, ctx: Ctx<'js>) -> Result<Value<'js>> {
method entries (line 214) | pub fn entries<'js>(&self, ctx: Ctx<'js>) -> Result<Value<'js>> {
method iterator (line 219) | pub fn iterator<'js>(&self, ctx: Ctx<'js>) -> Result<Value<'js>> {
method for_each (line 223) | pub fn for_each(&self, callback: Function<'_>) -> Result<()> {
method to_string_tag (line 231) | pub fn to_string_tag(&self) -> &'static str {
method iter (line 237) | pub fn iter(&self) -> impl Iterator<Item = (&str, &str)> {
method from_http_headers (line 241) | pub fn from_http_headers(header_map: &HeaderMap, guard: HeadersGuard) ...
method from_value (line 252) | pub fn from_value<'js>(ctx: &Ctx<'js>, value: Value<'js>, guard: Heade...
method from_map (line 278) | pub fn from_map(
method from_array (line 298) | fn from_array<'js>(ctx: &Ctx<'js>, array: Array<'js>, guard: HeadersGu...
method js_entries (line 347) | fn js_entries(&self, ctx: Ctx<'js>) -> Result<Array<'js>> {
method custom_inspect (line 356) | fn custom_inspect(&self, ctx: Ctx<'js>) -> Result<Object<'js>> {
function coerce_to_string (line 366) | fn coerce_to_string<'js>(ctx: &Ctx<'js>, value: Value<'js>) -> Result<St...
function is_http_header_name (line 386) | fn is_http_header_name(name: &str) -> bool {
function is_http_header_value (line 400) | fn is_http_header_value(value: &str) -> bool {
function normalize_header_value_inplace (line 410) | fn normalize_header_value_inplace(ctx: &Ctx<'_>, text: &mut String) -> R...
function is_cors_safelisted_request_header (line 469) | pub fn is_cors_safelisted_request_header(key: &str, value: &str) -> bool {
function contains_cors_unsafe_request_header_byte (line 492) | pub fn contains_cors_unsafe_request_header_byte(value: &str) -> bool {
function is_cors_safelisted_field_value (line 509) | pub fn is_cors_safelisted_field_value(value: &str) -> bool {
function test_get_header (line 526) | async fn test_get_header() {
function test_normalize_header_value_inplace (line 574) | async fn test_normalize_header_value_inplace() {
function test_headers_iterators (line 607) | async fn test_headers_iterators() {
FILE: modules/llrt_fetch/src/incoming.rs
function channel (line 21) | pub fn channel(incoming: Incoming) -> (IncomingSender, IncomingReceiver) {
type ClonableFrame (line 43) | enum ClonableFrame<T> {
function from (line 49) | fn from(frame: Frame<T>) -> Self {
function from (line 63) | fn from(frame: ClonableFrame<T>) -> Self {
type RecvOutput (line 71) | type RecvOutput =
type IncomingSender (line 74) | pub struct IncomingSender {
method process (line 81) | pub async fn process(mut self) {
method clone (line 126) | fn clone(&self) -> Self {
type Data (line 137) | type Data = Bytes;
type Error (line 138) | type Error = Box<dyn StdError + Send + Sync>;
method poll_frame (line 140) | fn poll_frame(
method is_end_stream (line 195) | fn is_end_stream(&self) -> bool {
method size_hint (line 199) | fn size_hint(&self) -> SizeHint {
function erase_lifetime (line 205) | fn erase_lifetime<'a, T>(
function test_incoming (line 224) | async fn test_incoming() {
function test_incoming_dropped (line 272) | async fn test_incoming_dropped() {
function test_incoming_lagged (line 315) | async fn test_incoming_lagged() {
FILE: modules/llrt_fetch/src/lib.rs
constant MIME_TYPE_FORM_URLENCODED (line 25) | const MIME_TYPE_FORM_URLENCODED: &str = "application/x-www-form-urlencod...
constant MIME_TYPE_TEXT (line 26) | const MIME_TYPE_TEXT: &str = "text/plain;charset=UTF-8";
constant MIME_TYPE_JSON (line 27) | const MIME_TYPE_JSON: &str = "application/json;charset=UTF-8";
constant MIME_TYPE_FORM_DATA (line 28) | const MIME_TYPE_FORM_DATA: &str = "multipart/form-data; boundary=";
constant MIME_TYPE_OCTET_STREAM (line 29) | const MIME_TYPE_OCTET_STREAM: &str = "application/octet-stream";
function strip_bom (line 31) | pub(crate) fn strip_bom<'a>(bytes: impl Into<Cow<'a, [u8]>>) -> Cow<'a, ...
function init (line 46) | pub fn init(ctx: &Ctx) -> Result<()> {
FILE: modules/llrt_fetch/src/request.rs
type RequestMode (line 22) | pub enum RequestMode {
type Error (line 31) | type Error = String;
method try_from (line 33) | fn try_from(s: String) -> std::result::Result<Self, Self::Error> {
method as_str (line 45) | pub fn as_str(&self) -> &str {
type BodyVariant (line 57) | enum BodyVariant<'js> {
type Request (line 64) | pub struct Request<'js> {
function trace (line 76) | fn trace<'a>(&self, tracer: rquickjs::class::Tracer<'a, 'js>) {
function new (line 91) | pub fn new(ctx: Ctx<'js>, input: Value<'js>, options: Opt<Value<'js>>) -...
function url (line 126) | fn url(&self) -> String {
function method (line 131) | fn method(&self) -> String {
function headers (line 136) | fn headers(&self) -> Option<Class<'js, Headers>> {
function to_string_tag (line 141) | pub fn to_string_tag(&self) -> &'static str {
function body (line 147) | fn body(&self, ctx: Ctx<'js>) -> Result<Value<'js>> {
function keepalive (line 157) | fn keepalive(&self) -> bool {
function signal (line 162) | fn signal(&self) -> Option<Class<'js, AbortSignal<'js>>> {
function body_used (line 167) | fn body_used(&self) -> bool {
function mode (line 177) | fn mode(&self) -> &str {
function cache (line 182) | fn cache(&self) -> &'static str {
function agent (line 187) | fn agent(&self) -> Option<Class<'js, Agent>> {
function text (line 191) | pub async fn text(&mut self, ctx: Ctx<'js>) -> Result<String> {
function json (line 198) | pub async fn json(&mut self, ctx: Ctx<'js>) -> Result<Value<'js>> {
function array_buffer (line 205) | async fn array_buffer(&mut self, ctx: Ctx<'js>) -> Result<ArrayBuffer<'j...
function bytes (line 212) | async fn bytes(&mut self, ctx: Ctx<'js>) -> Result<Value<'js>> {
function blob (line 219) | async fn blob(&mut self, ctx: Ctx<'js>) -> Result<Blob> {
function form_data (line 228) | async fn form_data(&self, ctx: Ctx<'js>) -> Result<FormData> {
function clone (line 240) | fn clone(&mut self, ctx: Ctx<'js>) -> Result<Self> {
function take_bytes (line 274) | async fn take_bytes(&self, ctx: &Ctx<'js>) -> Result<Option<Vec<u8>>> {
function get_headers (line 297) | fn get_headers(&self, ctx: &Ctx<'js>) -> Result<Option<Headers>> {
function get_header_value (line 304) | fn get_header_value(&self, ctx: &Ctx<'js>, key: &str) -> Result<Option<S...
function assign_request (line 313) | fn assign_request<'js>(request: &mut Request<'js>, ctx: Ctx<'js>, obj: &...
FILE: modules/llrt_fetch/src/response.rs
type BodyVariant (line 107) | enum BodyVariant<'js> {
type Response (line 115) | pub struct Response<'js> {
function trace (line 129) | fn trace<'a>(&self, tracer: Tracer<'a, 'js>) {
type Changed (line 140) | type Changed<'to> = Response<'to>;
function new (line 146) | pub fn new(ctx: Ctx<'js>, body: Opt<Value<'js>>, options: Opt<Object<'js...
function status (line 241) | pub fn status(&self) -> u64 {
function url (line 246) | pub fn url(&self) -> String {
function ok (line 251) | pub fn ok(&self) -> bool {
function redirected (line 256) | pub fn redirected(&self) -> bool {
function body (line 262) | pub fn body(&self) -> Undefined {
function headers (line 267) | fn headers(&self) -> Class<'js, Headers> {
function response_type (line 272) | fn response_type(&self) -> &'js str {
function to_string_tag (line 280) | pub fn to_string_tag(&self) -> &'static str {
function status_text (line 285) | fn status_text(&self) -> String {
function body_used (line 293) | fn body_used(&self) -> bool {
function text (line 304) | pub(crate) async fn text(&self, ctx: Ctx<'js>) -> Result<String> {
function json (line 311) | pub(crate) async fn json(&self, ctx: Ctx<'js>) -> Result<Value<'js>> {
function array_buffer (line 318) | async fn array_buffer(&self, ctx: Ctx<'js>) -> Result<ArrayBuffer<'js>> {
function bytes (line 325) | async fn bytes(&self, ctx: Ctx<'js>) -> Result<Value<'js>> {
function blob (line 332) | async fn blob(&self, ctx: Ctx<'js>) -> Result<Blob> {
function form_data (line 341) | async fn form_data(&self, ctx: Ctx<'js>) -> Result<FormData> {
function clone (line 353) | pub(crate) fn clone(&self, ctx: Ctx<'js>) -> Result<Self> {
function error (line 395) | fn error(ctx: Ctx<'js>) -> Result<Self> {
function json_static (line 411) | fn json_static(ctx: Ctx<'js>, body: Value<'js>, options: Opt<Object<'js>...
function redirect (line 467) | fn redirect(
function from_incoming (line 500) | pub fn from_incoming(
function take_bytes (line 542) | async fn take_bytes(&self, ctx: &Ctx<'js>) -
Condensed preview — 657 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (5,079K chars).
[
{
"path": ".cargo/config.toml",
"chars": 833,
"preview": "[target.aarch64-unknown-linux-musl]\nrustflags = [\n \"-Ctarget-feature=+lse,+crt-static\",\n \"-Ctarget-cpu=neoverse-n1"
},
{
"path": ".fleet/settings.json",
"chars": 36,
"preview": "{\n \"backend.maxHeapSizeMb\": 2048\n}\n"
},
{
"path": ".github/dependabot.yml",
"chars": 1524,
"preview": "# To get started with Dependabot version updates, you'll need to specify which\n# package ecosystems to update and where "
},
{
"path": ".github/pull_request_template.md",
"chars": 682,
"preview": "### Issue # (if available)\n\n<!-- **Please post the link to the resolved issue** -->\n\n### Description of changes\n\n<!-- *"
},
{
"path": ".github/workflows/build-modules.yml",
"chars": 4443,
"preview": "name: Setup, Build & Test modules\non:\n workflow_call:\n inputs:\n os:\n required: true\n type: string"
},
{
"path": ".github/workflows/build.yml",
"chars": 5573,
"preview": "name: Setup, Build & Test\non:\n workflow_call:\n inputs:\n os:\n required: true\n type: string\n p"
},
{
"path": ".github/workflows/ci.yml",
"chars": 6170,
"preview": "name: LLRT CI\non:\n push:\n branches:\n - \"main\"\n pull_request:\n\n# Only run on the latest ref\nconcurrency:\n grou"
},
{
"path": ".github/workflows/publish.yml",
"chars": 838,
"preview": "name: Publish crates\non:\n workflow_call:\n inputs:\n ref:\n required: true\n type: string\n secrets"
},
{
"path": ".github/workflows/release.yml",
"chars": 2943,
"preview": "name: LLRT Release\non:\n push:\n tags:\n - \"v*.*.*\"\n\njobs:\n build:\n strategy:\n fail-fast: ${{ startsWith("
},
{
"path": ".gitignore",
"chars": 321,
"preview": ".DS_Store\n.idea\n.yarn\n.pnp*\n.tmp-llrt-aws-sdk\n\n/lib\n/target\n/llrt_core/target\n/llrt_core/src/bytecode_cache.rs\n/example/"
},
{
"path": ".gitmodules",
"chars": 331,
"preview": "[submodule \"zstd\"]\n\tpath = zstd\n\turl = https://github.com/facebook/zstd.git\n\tupdate = none # Workaround for https://gith"
},
{
"path": ".prettierignore",
"chars": 70,
"preview": "# Ignore web-platform-tests to avoid collisions!\n/wpt\n**/node_modules\n"
},
{
"path": ".vscode/launch.json",
"chars": 1818,
"preview": "{\n // Use IntelliSense to learn about possible attributes.\n // Hover to view descriptions of existing attributes.\n //"
},
{
"path": ".vscode/settings.json",
"chars": 252,
"preview": "{\n \"cSpell.words\": [\"Abortable\", \"rquickjs\", \"LLRT\", \"llrt\"],\n \"cmake.configureOnOpen\": false,\n \"rust-analyzer.showUn"
},
{
"path": ".yarnrc.yml",
"chars": 25,
"preview": "nodeLinker: node-modules\n"
},
{
"path": "API.md",
"chars": 28286,
"preview": "# API documentation\n\n> [!NOTE]\n> The long term goal for LLRT is to become [WinterTC compliant](https://min-common-api.pr"
},
{
"path": "CHANGELOG.md",
"chars": 2896,
"preview": "### Features\n - Added dgram (UDP socket) module support (@chessbyte, @richarddavison)\n - Added timezone support with m"
},
{
"path": "CODE_OF_CONDUCT.md",
"chars": 310,
"preview": "## Code of Conduct\n\nThis project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-cond"
},
{
"path": "CONTRIBUTING.md",
"chars": 3160,
"preview": "# Contributing Guidelines\n\nThank you for your interest in contributing to our project. Whether it's a bug report, new fe"
},
{
"path": "Cargo.toml",
"chars": 1205,
"preview": "[workspace]\nresolver = \"2\"\n\nmembers = [\n \"libs/llrt_build\",\n \"libs/llrt_compression\",\n \"libs/llrt_context\",\n \"libs/l"
},
{
"path": "GOVERNANCE.md",
"chars": 3170,
"preview": "# Project Governance (Very Minimal Governance model)\n\nThis open source project is managed by a Steering Committee compos"
},
{
"path": "LICENSE",
"chars": 11357,
"preview": "\n Apache License\n Version 2.0, January 2004\n "
},
{
"path": "MAINTAINERS.md",
"chars": 3989,
"preview": "<!-- markdownlint-disable MD043 -->\n\n## Table of contents <!-- omit in toc -->\n\n- [Overview](#overview)\n- [Current Main"
},
{
"path": "Makefile",
"chars": 9665,
"preview": "TARGET_linux_x86_64 = x86_64-unknown-linux-musl\nTARGET_linux_arm64 = aarch64-unknown-linux-musl\nTARGET_darwin_x86_64 = x"
},
{
"path": "NOTICE",
"chars": 72,
"preview": "LLRT\nCopyright Amazon.com, Inc. or its affiliates. All Rights Reserved. "
},
{
"path": "README.md",
"chars": 32720,
"preview": "[](https://github.com/awslabs/"
},
{
"path": "THIRD_PARTY_LICENSES",
"chars": 3978,
"preview": "** zstd; version zstd -- http://facebook.github.io/zstd/\nCopyright (c) 2016-present, Facebook, Inc. All rights reserved"
},
{
"path": "benchmarks/v8-v7/README.txt",
"chars": 3411,
"preview": "V8 Benchmark Suite\n==================\n\nThis is the V8 benchmark suite: A collection of pure JavaScript\nbenchmarks that w"
},
{
"path": "benchmarks/v8-v7/base.js",
"chars": 9338,
"preview": "// Copyright 2012 the V8 project authors. All rights reserved.\n// Redistribution and use in source and binary forms, wit"
},
{
"path": "benchmarks/v8-v7/crypto.js",
"chars": 50738,
"preview": "/*\n * Copyright (c) 2003-2005 Tom Wu\n * All Rights Reserved.\n *\n * Permission is hereby granted, free of charge, to any"
},
{
"path": "benchmarks/v8-v7/deltablue.js",
"chars": 25695,
"preview": "// Copyright 2008 the V8 project authors. All rights reserved.\n// Copyright 1996 John Maloney and Mario Wolczko.\n\n// Thi"
},
{
"path": "benchmarks/v8-v7/earley-boyer.js",
"chars": 231135,
"preview": "// This file is automatically generated by scheme2js, except for the\n// benchmark harness code at the beginning and end "
},
{
"path": "benchmarks/v8-v7/index.js",
"chars": 2263,
"preview": "// Copyright 2008 the V8 project authors. All rights reserved.\n// Redistribution and use in source and binary forms, wit"
},
{
"path": "benchmarks/v8-v7/navier-stokes.js",
"chars": 11129,
"preview": "/**\n * Copyright 2012 the V8 project authors. All rights reserved.\n * Copyright 2009 Oliver Hunt <http://nerget.com>\n *\n"
},
{
"path": "benchmarks/v8-v7/raytrace.js",
"chars": 24671,
"preview": "// The ray tracer code in this file is written by Adam Burmister. It\n// is available in its original form from:\n//\n// "
},
{
"path": "benchmarks/v8-v7/regexp.js",
"chars": 112711,
"preview": "// Copyright 2010 the V8 project authors. All rights reserved.\n// Redistribution and use in source and binary forms, wit"
},
{
"path": "benchmarks/v8-v7/richards.js",
"chars": 15767,
"preview": "// Copyright 2006-2008 the V8 project authors. All rights reserved.\n// Redistribution and use in source and binary forms"
},
{
"path": "benchmarks/v8-v7/splay.js",
"chars": 10740,
"preview": "// Copyright 2009 the V8 project authors. All rights reserved.\n// Redistribution and use in source and binary forms, wit"
},
{
"path": "build.mjs",
"chars": 19158,
"preview": "import * as esbuild from \"esbuild\";\nimport fs from \"node:fs/promises\";\nimport { createRequire } from \"node:module\";\nimpo"
},
{
"path": "example/clear-ddb-table.mjs",
"chars": 4807,
"preview": "import {\n DynamoDBClient,\n ScanCommand,\n DescribeTableCommand,\n BatchWriteItemCommand,\n} from \"@aws-sdk/client-dynam"
},
{
"path": "example/functions/build.mjs",
"chars": 1837,
"preview": "import esbuild from \"esbuild\";\nimport fs from \"node:fs/promises\";\nimport path from \"node:path\";\n\nconst OUTDIR = \"build\";"
},
{
"path": "example/functions/package.json",
"chars": 525,
"preview": "{\n \"name\": \"@example/functions\",\n \"version\": \"1.0.0\",\n \"private\": true,\n \"type\": \"module\",\n \"scripts\": {\n \"build"
},
{
"path": "example/functions/src/api.ts",
"chars": 2127,
"preview": "import {\n DynamoDBDocumentClient,\n PutCommand,\n ScanCommand,\n DeleteCommand,\n UpdateCommand,\n} from \"@aws-sdk/lib-d"
},
{
"path": "example/functions/src/hello.mjs",
"chars": 85,
"preview": "export const handler = async () => ({\n statusCode: 200,\n body: \"Hello world!\",\n});\n"
},
{
"path": "example/functions/src/non-included-sdk.mjs",
"chars": 637,
"preview": "// Import the necessary AWS SDK clients and commands\nimport { EC2Client, DescribeInstancesCommand } from \"@aws-sdk/clien"
},
{
"path": "example/functions/src/react/App.css",
"chars": 843,
"preview": "* {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n}\n\nhtml,\nbody {\n font-family: Arial, Helvetica, sans-serif;\n "
},
{
"path": "example/functions/src/react/App.tsx",
"chars": 535,
"preview": "import logo from \"./logo.svg\";\nimport \"./App.css\";\nimport TodoList, { Todo } from \"./TodoList\";\n\ntype Props = {\n todoIt"
},
{
"path": "example/functions/src/react/CreateTodo.tsx",
"chars": 492,
"preview": "type Props = {\n onCreate: (text: string) => void;\n};\n\nfunction CreateTodo({ onCreate }: Props) {\n const handleKeyDown "
},
{
"path": "example/functions/src/react/TodoItem.tsx",
"chars": 713,
"preview": "import { Todo } from \"./TodoList\";\n\ntype Props = {\n item: Todo;\n onDelete: (id: string) => void;\n onComplete: (id: st"
},
{
"path": "example/functions/src/react/TodoList.css",
"chars": 491,
"preview": ".todo-list {\n margin-top: 2rem;\n}\n\n.todo-list.loading {\n touch-action: none;\n pointer-events: none;\n opacity: 0.5;\n}"
},
{
"path": "example/functions/src/react/TodoList.tsx",
"chars": 3111,
"preview": "import { useEffect, useState } from \"react\";\nimport TodoItem from \"./TodoItem\";\nimport \"./TodoList.css\";\nimport CreateTo"
},
{
"path": "example/functions/src/react/index.html",
"chars": 611,
"preview": "<!doctype html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\" />\n <link rel=\"icon\" href=\"favicon.ico\" />\n <l"
},
{
"path": "example/functions/src/react/index.tsx",
"chars": 217,
"preview": "import ReactDOM from \"react-dom\";\n\nimport App from \"./App\";\n\nReactDOM.hydrate(\n <App\n todoItems={(window && window.t"
},
{
"path": "example/functions/src/ssr.ts",
"chars": 4431,
"preview": "import fs from \"node:fs/promises\";\nimport App from \"./react/App\";\nimport ReactDOMServer from \"react-dom/server.edge\";\n\ni"
},
{
"path": "example/functions/src/types.d.ts",
"chars": 78,
"preview": "declare module \"*.svg\" {\n const content: string;\n export default content;\n}\n"
},
{
"path": "example/functions/src/v2.js",
"chars": 450,
"preview": "const DynamoDB = require(\"aws-sdk/clients/dynamodb.js\");\n\nconst client = new DynamoDB();\n\nexport const handler = async ("
},
{
"path": "example/functions/src/v3-lib.mjs",
"chars": 543,
"preview": "import { DynamoDBClient } from \"@aws-sdk/client-dynamodb\";\nimport { DynamoDBDocumentClient, PutCommand } from \"@aws-sdk/"
},
{
"path": "example/functions/src/v3-mono.mjs",
"chars": 408,
"preview": "import { DynamoDB } from \"@aws-sdk/client-dynamodb\";\n\nconst client = new DynamoDB({});\n\nexport const handler = async (ev"
},
{
"path": "example/functions/src/v3-s3.mjs",
"chars": 1018,
"preview": "import { DynamoDBClient } from \"@aws-sdk/client-dynamodb\";\nimport { DynamoDBDocumentClient, PutCommand } from \"@aws-sdk/"
},
{
"path": "example/functions/src/v3.mjs",
"chars": 481,
"preview": "import { DynamoDBClient, PutItemCommand } from \"@aws-sdk/client-dynamodb\";\n\nconst client = new DynamoDBClient({});\n\nexpo"
},
{
"path": "example/functions/tsconfig.json",
"chars": 251,
"preview": "{\n \"include\": [\"src\"],\n \"exclude\": [\"lib\", \"node_modules\"],\n \"compilerOptions\": {\n \"downlevelIteration\": true,\n "
},
{
"path": "example/infrastructure/cdk.json",
"chars": 38,
"preview": "{\n \"app\": \"ts-node ./src/index.ts\"\n}\n"
},
{
"path": "example/infrastructure/package.json",
"chars": 436,
"preview": "{\n \"name\": \"@example/infra\",\n \"version\": \"1.0.0\",\n \"private\": true,\n \"scripts\": {\n \"synth\": \"cdk synth\",\n \"pre"
},
{
"path": "example/infrastructure/src/index.ts",
"chars": 11350,
"preview": "import {\n App,\n aws_dynamodb,\n aws_lambda,\n aws_lambda_nodejs,\n aws_s3,\n aws_logs,\n aws_iam,\n aws_cloudfront,\n "
},
{
"path": "example/infrastructure/tsconfig.json",
"chars": 215,
"preview": "{\n \"include\": [\"src\"],\n \"exclude\": [\"node_modules\"],\n \"compilerOptions\": {\n \"outDir\": \"lib\",\n \"module\": \"Common"
},
{
"path": "example/llrt-sam/.gitignore",
"chars": 10864,
"preview": "\n# Created by https://www.toptal.com/developers/gitignore/api/osx,node,linux,windows,sam\n# Edit at https://www.toptal.co"
},
{
"path": "example/llrt-sam/README.md",
"chars": 7145,
"preview": "# llrt-sam\n\nThis is a sample SAM project with LLRT instrumentation on a lambda via a lambda layer\n\n- hello-world - Code "
},
{
"path": "example/llrt-sam/hello-world/app.ts",
"chars": 900,
"preview": "import { APIGatewayProxyEvent, APIGatewayProxyResult } from \"aws-lambda\";\n\n/**\n *\n * Event doc: https://docs.aws.amazon."
},
{
"path": "example/llrt-sam/hello-world/package.json",
"chars": 336,
"preview": "{\n \"name\": \"hello_world\",\n \"version\": \"1.0.0\",\n \"description\": \"LLRT instrumented lambda example\",\n \"main\": \"app.js\""
},
{
"path": "example/llrt-sam/hello-world/tsconfig.json",
"chars": 354,
"preview": "{\n \"compilerOptions\": {\n \"target\": \"es2023\",\n \"strict\": true,\n \"preserveConstEnums\": true,\n \"noEmit\": true,"
},
{
"path": "example/llrt-sam/samconfig.toml",
"chars": 748,
"preview": "# More information about the configuration file can be found here:\n# https://docs.aws.amazon.com/serverless-application-"
},
{
"path": "example/llrt-sam/template.yaml",
"chars": 1523,
"preview": "AWSTemplateFormatVersion: \"2010-09-09\"\nTransform: AWS::Serverless-2016-10-31\nDescription: >\n llrt-sam\n\n Sample SAM Tem"
},
{
"path": "example/llrt-sam-container-image/.gitignore",
"chars": 3484,
"preview": "\n# Created by https://www.toptal.com/developers/gitignore/api/osx,node,linux,windows,sam\n# Edit at https://www.toptal.co"
},
{
"path": "example/llrt-sam-container-image/README.md",
"chars": 6961,
"preview": "# llrt-sam-oci\n\nThis project contains source code and supporting files for a serverless application that you can deploy "
},
{
"path": "example/llrt-sam-container-image/events/event.json",
"chars": 1997,
"preview": "{\n \"body\": \"{\\\"message\\\": \\\"hello world\\\"}\",\n \"resource\": \"/{proxy+}\",\n \"path\": \"/path/to/resource\",\n \"httpMethod\": "
},
{
"path": "example/llrt-sam-container-image/hello-world/Dockerfile",
"chars": 238,
"preview": "FROM --platform=arm64 busybox\nWORKDIR /var/task/\nCOPY app.mjs ./\nADD https://github.com/awslabs/llrt/releases/latest/dow"
},
{
"path": "example/llrt-sam-container-image/hello-world/app.mjs",
"chars": 736,
"preview": "/**\n *\n * Event doc: https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-lambda-proxy-integrations.html#"
},
{
"path": "example/llrt-sam-container-image/samconfig.toml",
"chars": 697,
"preview": "# More information about the configuration file can be found here:\n# https://docs.aws.amazon.com/serverless-application-"
},
{
"path": "example/llrt-sam-container-image/template.yaml",
"chars": 1427,
"preview": "AWSTemplateFormatVersion: \"2010-09-09\"\nTransform: AWS::Serverless-2016-10-31\nDescription: >\n llrt-sam-oci\n\n Sample SAM"
},
{
"path": "example/register-hooks/hooks/calc.js",
"chars": 550,
"preview": "import { registerHooks } from \"node:module\";\n\nregisterHooks({\n resolve(specifier, context, nextResolve) {\n if (speci"
},
{
"path": "example/register-hooks/hooks/fs.js",
"chars": 864,
"preview": "import { registerHooks } from \"node:module\";\n\nregisterHooks({\n resolve(specifier, context, nextResolve) {\n if (speci"
},
{
"path": "example/register-hooks/hooks/http.js",
"chars": 536,
"preview": "import { registerHooks } from \"node:module\";\nimport { readFileSync } from \"node:fs\";\n\nregisterHooks({\n resolve(specifie"
},
{
"path": "example/register-hooks/hooks/v8.js",
"chars": 1250,
"preview": "import { registerHooks } from \"node:module\";\n\nregisterHooks({\n resolve(specifier, context, nextResolve) {\n if (speci"
},
{
"path": "example/register-hooks/simple-server.js",
"chars": 277,
"preview": "import { createServer } from \"node:http\";\n\nconst server = createServer((req, res) => {\n res.writeHead(200, { \"Content-T"
},
{
"path": "example/register-hooks/simple-server.sh",
"chars": 47,
"preview": "llrt --import ./hooks/http.js simple-server.js\n"
},
{
"path": "example/register-hooks/src/http.js",
"chars": 4662,
"preview": "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { cr"
},
{
"path": "example/register-hooks/test.js",
"chars": 209,
"preview": "import { existsSync } from \"node:fs\";\nconsole.log(existsSync(\"./test.js\"));\n\nimport { add } from \"calc\";\nconsole.log(add"
},
{
"path": "example/register-hooks/test.sh",
"chars": 84,
"preview": "llrt --import ./hooks/fs.js --import ./hooks/calc.js --import ./hooks/v8.js test.js\n"
},
{
"path": "fixtures/a.js",
"chars": 66,
"preview": "const a = {};\nexport default a;\nrequire(\"./b.js\");\na.done = true;\n"
},
{
"path": "fixtures/b.js",
"chars": 66,
"preview": "const b = {};\nexport default b;\nrequire(\"./a.js\");\nb.done = true;\n"
},
{
"path": "fixtures/c.cjs",
"chars": 52,
"preview": "const d = require(\"./d.cjs\");\nmodule.exports = \"c\";\n"
},
{
"path": "fixtures/cjs-handler.cjs",
"chars": 124,
"preview": "const a = require(\"./import.cjs\");\n\nexports.handler = async () => {\n return {\n statusCode: 200,\n body: \"OK\",\n };"
},
{
"path": "fixtures/d.cjs",
"chars": 52,
"preview": "const c = require(\"./d.cjs\");\nmodule.exports = \"d\";\n"
},
{
"path": "fixtures/define-property-export.cjs",
"chars": 66,
"preview": "Object.defineProperty(exports, \"__esModule\", {\n value: true,\n});\n"
},
{
"path": "fixtures/empty.js",
"chars": 0,
"preview": ""
},
{
"path": "fixtures/export-function.cjs",
"chars": 75,
"preview": "module.exports = function exportedFunction() {\n return \"hello world!\";\n};\n"
},
{
"path": "fixtures/fs/readdir/readdir.js",
"chars": 93,
"preview": "import fs from \"node:fs/promises\";\n\nfs.readdir(\"./\", { recursive: true }).then((res) => {});\n"
},
{
"path": "fixtures/fs/readdir/recursive/readdir.js",
"chars": 93,
"preview": "import fs from \"node:fs/promises\";\n\nfs.readdir(\"./\", { recursive: true }).then((res) => {});\n"
},
{
"path": "fixtures/handler.mjs",
"chars": 185,
"preview": "//test top level await\nawait new Promise((res) => setTimeout(res, 0));\nawait import(\"./hello.js\");\n\nexport const handler"
},
{
"path": "fixtures/hello.js",
"chars": 57,
"preview": "export const hello = \"hello world!\";\nconsole.log(hello);\n"
},
{
"path": "fixtures/hello.txt",
"chars": 12,
"preview": "hello world!"
},
{
"path": "fixtures/import.cjs",
"chars": 57,
"preview": "const c = require(\"./c.cjs\");\nmodule.exports = {\n c,\n};\n"
},
{
"path": "fixtures/import.js",
"chars": 45,
"preview": "const a = require(\"a.js\");\nexport default a;\n"
},
{
"path": "fixtures/local.mjs",
"chars": 1207,
"preview": "import { DynamoDBClient } from \"@aws-sdk/client-dynamodb\";\nimport { DynamoDBDocumentClient, PutCommand } from \"@aws-sdk/"
},
{
"path": "fixtures/node_modules/elem-aws-lambda-powertools/commons/lib/cjs/index.js",
"chars": 190,
"preview": "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isNull = void 0;\nvar typeUtils_js_1"
},
{
"path": "fixtures/node_modules/elem-aws-lambda-powertools/commons/lib/cjs/typeUtils.js",
"chars": 193,
"preview": "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isNull = void 0;\nconst isNull = (va"
},
{
"path": "fixtures/node_modules/elem-aws-lambda-powertools/commons/lib/esm/index.js",
"chars": 41,
"preview": "export { isNull } from './typeUtils.js';\n"
},
{
"path": "fixtures/node_modules/elem-aws-lambda-powertools/commons/lib/esm/typeUtils.js",
"chars": 85,
"preview": "const isNull = (value) => {\n return Object.is(value, null);\n};\nexport { isNull };\n"
},
{
"path": "fixtures/node_modules/elem-aws-lambda-powertools/commons/package.json",
"chars": 385,
"preview": "{\n \"name\": \"elem-aws-lambda-powertools/commons\",\n \"main\": \"./lib/cjs/index.js\",\n \"type\": \"module\",\n \"exports\": {\n "
},
{
"path": "fixtures/node_modules/elem-aws-lambda-powertools/jmespath/lib/cjs/index.js",
"chars": 216,
"preview": "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isNull = void 0;\nconst typeutils_1 "
},
{
"path": "fixtures/node_modules/elem-aws-lambda-powertools/jmespath/lib/esm/index.js",
"chars": 71,
"preview": "export { isNull } from 'elem-aws-lambda-powertools/commons/typeutils';\n"
},
{
"path": "fixtures/node_modules/elem-aws-lambda-powertools/jmespath/package.json",
"chars": 274,
"preview": "{\n \"name\": \"elem-aws-lambda-powertools/jmespath\",\n \"main\": \"./lib/cjs/index.js\",\n \"type\": \"module\",\n \"exports\": {\n "
},
{
"path": "fixtures/node_modules/elem-debug/package.json",
"chars": 93,
"preview": "{\n \"name\": \"elem-debug\",\n \"main\": \"./src/index.js\",\n \"browser\": \"./src/browser.js\"\n}"
},
{
"path": "fixtures/node_modules/elem-debug/src/browser.js",
"chars": 198,
"preview": "exports = module.exports;\n\nexports.str = \"cat\";\nexports.cat = function cat() {\n return exports.str;\n}\n\nexports.array "
},
{
"path": "fixtures/node_modules/elem-hono/dist/cjs/utils/url.js",
"chars": 105,
"preview": "exports = module.exports;\n\nexports.str = \"foo\";\nexports.url = function url() {\n return exports.str;\n}\n"
},
{
"path": "fixtures/node_modules/elem-hono/dist/index.js",
"chars": 105,
"preview": "exports = module.exports;\n\nexports.str = \"bar\";\nexports.url = function url() {\n return exports.str;\n}\n"
},
{
"path": "fixtures/node_modules/elem-hono/package.json",
"chars": 230,
"preview": "{\n \"module\": \"dist/index.js\",\n \"exports\": {\n \"./utils/*\": {\n \"types\": \"./dist/types/utils/*.d.ts"
},
{
"path": "fixtures/node_modules/elem-lodash.merge/index.js",
"chars": 80,
"preview": "var merge = function test(value) {\n return value;\n}\n\nmodule.exports = merge;\n"
},
{
"path": "fixtures/node_modules/elem-lodash.merge/package.json",
"chars": 35,
"preview": "{\n \"name\": \"elem-lodash.merge\"\n}"
},
{
"path": "fixtures/node_modules/elem-react-dom/cjs/react-dom-server.edge.development.js",
"chars": 126,
"preview": "\"use strict\";\n\n(function () {\n var ReactDOM = require(\"elem-react-dom\");\n exports.name = \"react-dom/server.edge\";\n"
},
{
"path": "fixtures/node_modules/elem-react-dom/cjs/react-dom.development.js",
"chars": 67,
"preview": "\"use strict\";\n\n(function () {\n exports.name = \"react-dom\";\n})();"
},
{
"path": "fixtures/node_modules/elem-react-dom/index.js",
"chars": 75,
"preview": "'use strict';\n\nmodule.exports = require('./cjs/react-dom.development.js');\n"
},
{
"path": "fixtures/node_modules/elem-react-dom/package.json",
"chars": 221,
"preview": "{\n \"name\": \"elem-react-dom\",\n \"main\": \"index.js\",\n \"exports\": {\n \".\": {\n \"default\": \"./index."
},
{
"path": "fixtures/node_modules/elem-react-dom/server.edge.js",
"chars": 87,
"preview": "'use strict';\n\nmodule.exports = require('./cjs/react-dom-server.edge.development.js');\n"
},
{
"path": "fixtures/node_modules/elem-uuid/dist/commonjs-browser/index.js",
"chars": 224,
"preview": "Object.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nexports.default = require1;\n\nfunction require1(hello"
},
{
"path": "fixtures/node_modules/elem-uuid/package.json",
"chars": 361,
"preview": "{\n \"name\": \"elem-uuid\",\n \"main\": \"./dist/index.js\",\n \"exports\": {\n \".\": {\n \"browser\": {\n "
},
{
"path": "fixtures/package.json",
"chars": 22,
"preview": "{\n \"private\": true\n}\n"
},
{
"path": "fixtures/primitive-handler.mjs",
"chars": 52,
"preview": "export const handler = () => {\n return \"hello\";\n};\n"
},
{
"path": "fixtures/prop-export.cjs",
"chars": 27,
"preview": "module.exports.prop = \"a\";\n"
},
{
"path": "fixtures/referenced-exports.cjs",
"chars": 243,
"preview": "exports = module.exports;\n\nexports.str = \"str\";\nexports.cat = function cat() {\n return exports.str;\n};\n\nexports.array ="
},
{
"path": "fixtures/require.mjs",
"chars": 366,
"preview": "async function main() {\n console.log(1);\n await new Promise((res) => setTimeout(res, 5));\n console.log(2);\n\n setTime"
},
{
"path": "fixtures/sdk-handler.mjs",
"chars": 239,
"preview": "import \"./sdk-runtime-init.mjs\";\n\n//to simulate some async initialization work\nawait new Promise((r) => setTimeout(r, 10"
},
{
"path": "fixtures/sdk-runtime-init.mjs",
"chars": 59,
"preview": "//dummy file for simulating SDK connection warmup in tests\n"
},
{
"path": "fixtures/test1245/index.js",
"chars": 42,
"preview": "export function bar() {\n return \"bar\";\n}\n"
},
{
"path": "fixtures/test1245/main/foo.js",
"chars": 51,
"preview": "const { bar } = require(\"..\");\nconsole.log(bar());\n"
},
{
"path": "fixtures/test1245/package.json",
"chars": 27,
"preview": "{\n \"main\": \"./index.js\"\n}\n"
},
{
"path": "fixtures/test903/bar.mjs",
"chars": 42,
"preview": "export function bar() {\n return \"bar\";\n}\n"
},
{
"path": "fixtures/test903/foo.mjs",
"chars": 54,
"preview": "import { bar } from \"../bar.mjs\";\nconsole.log(bar());\n"
},
{
"path": "fixtures/test_modules/test-aws-lambda-powertools-jmespath.js",
"chars": 270,
"preview": "const assert = require(\"assert\");\n\nimport * as jmespath1 from \"elem-aws-lambda-powertools/jmespath\";\nassert.ok(typeof jm"
},
{
"path": "fixtures/test_modules/test-debug.js",
"chars": 138,
"preview": "const assert = require(\"assert\");\n\nconst debug = require(\"elem-debug\");\n\nassert.ok(debug.cat() == \"cat\");\nassert.ok(debu"
},
{
"path": "fixtures/test_modules/test-elem-hono.js",
"chars": 116,
"preview": "const assert = require(\"assert\");\n\nconst utils = require(\"elem-hono/utils/url\");\n\nassert.ok(utils.url() === \"foo\");\n"
},
{
"path": "fixtures/test_modules/test-lodash.merge.js",
"chars": 203,
"preview": "const assert = require(\"assert\");\n\nimport merge1 from \"elem-lodash.merge\";\nassert.ok(typeof merge1 === \"function\");\n\ncon"
},
{
"path": "fixtures/test_modules/test-react-dom.js",
"chars": 238,
"preview": "const assert = require(\"assert\");\n\nimport * as dom1 from \"elem-react-dom/server.edge\";\nassert.ok(dom1.name == \"react-dom"
},
{
"path": "fixtures/test_modules/test-uuid.js",
"chars": 268,
"preview": "const assert = require(\"assert\");\n\nvar fn = _interopRequireDefault(require(\"elem-uuid\"));\nfunction _interopRequireDefaul"
},
{
"path": "fixtures/throw.js",
"chars": 10,
"preview": "throw 42;\n"
},
{
"path": "fixtures/throwing-handler.mjs",
"chars": 69,
"preview": "export const handler = async () => {\n throw new Error(\"kaboom\");\n};\n"
},
{
"path": "fixtures/throwing-init-handler.mjs",
"chars": 67,
"preview": "throw new Error(\"kaboom\");\n\nexport const handler = async () => {};\n"
},
{
"path": "fixtures/tla-webcall-handler.mjs",
"chars": 124,
"preview": "await fetch(__MOCK_ENDPOINT);\n\nexport const handler = async () => {\n return {\n statusCode: 200,\n body: \"OK\",\n };"
},
{
"path": "index.mjs",
"chars": 543,
"preview": "import { DynamoDBClient } from \"@aws-sdk/client-dynamodb\";\nimport { DynamoDBDocumentClient, PutCommand } from \"@aws-sdk/"
},
{
"path": "lambda-server.js",
"chars": 5467,
"preview": "import pureHttp from \"pure-http\";\nimport fs from \"node:fs\";\n\nconst PORT = 3000;\nconst BASE_PATH = \"/2018-06-01/runtime\";"
},
{
"path": "libs/llrt_build/Cargo.toml",
"chars": 300,
"preview": "[package]\nname = \"llrt_build\"\ndescription = \"LLRT build helpers\"\nversion = \"0.8.1-beta\"\nedition = \"2021\"\nlicense = \"Apac"
},
{
"path": "libs/llrt_build/src/lib.rs",
"chars": 271,
"preview": "pub fn set_nightly_cfg() {\n let version_meta = rustc_version::version_meta().unwrap();\n println!(\"cargo::rustc-che"
},
{
"path": "libs/llrt_compression/Cargo.toml",
"chars": 904,
"preview": "[package]\nname = \"llrt_compression\"\ndescription = \"LLRT compression helpers\"\nversion = \"0.8.1-beta\"\nedition = \"2021\"\nlic"
},
{
"path": "libs/llrt_compression/src/lib.rs",
"chars": 2536,
"preview": "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\n#[cfg(any("
},
{
"path": "libs/llrt_context/Cargo.toml",
"chars": 671,
"preview": "[package]\nname = \"llrt_context\"\ndescription = \"LLRT context helpers\"\nversion = \"0.8.1-beta\"\nedition = \"2021\"\nlicense = \""
},
{
"path": "libs/llrt_context/src/lib.rs",
"chars": 2983,
"preview": "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nuse std::fu"
},
{
"path": "libs/llrt_dns_cache/Cargo.toml",
"chars": 729,
"preview": "[package]\nname = \"llrt_dns_cache\"\ndescription = \"LLRT dns cache helpers\"\nversion = \"0.8.1-beta\"\nedition = \"2021\"\nlicense"
},
{
"path": "libs/llrt_dns_cache/src/lib.rs",
"chars": 3679,
"preview": "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nuse std::{\n"
},
{
"path": "libs/llrt_encoding/Cargo.toml",
"chars": 580,
"preview": "[package]\nname = \"llrt_encoding\"\ndescription = \"LLRT encoding helpers\"\nversion = \"0.8.1-beta\"\nedition = \"2021\"\nlicense ="
},
{
"path": "libs/llrt_encoding/build.rs",
"chars": 158,
"preview": "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nfn main() {"
},
{
"path": "libs/llrt_encoding/src/lib.rs",
"chars": 7723,
"preview": "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n#![cfg_attr"
},
{
"path": "libs/llrt_hooking/Cargo.toml",
"chars": 476,
"preview": "[package]\nname = \"llrt_hooking\"\ndescription = \"LLRT hooking helpers\"\nversion = \"0.8.1-beta\"\nedition = \"2021\"\nlicense = \""
},
{
"path": "libs/llrt_hooking/src/lib.rs",
"chars": 2621,
"preview": "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nuse std::en"
},
{
"path": "libs/llrt_json/Cargo.toml",
"chars": 928,
"preview": "[package]\nname = \"llrt_json\"\ndescription = \"LLRT json helpers\"\nversion = \"0.8.1-beta\"\nedition = \"2021\"\nlicense = \"Apache"
},
{
"path": "libs/llrt_json/benches/json.rs",
"chars": 6232,
"preview": "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\n#![allow(d"
},
{
"path": "libs/llrt_json/build.rs",
"chars": 49,
"preview": "fn main() {\n llrt_build::set_nightly_cfg();\n}\n"
},
{
"path": "libs/llrt_json/src/escape.rs",
"chars": 5747,
"preview": "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nstatic JSO"
},
{
"path": "libs/llrt_json/src/lib.rs",
"chars": 11040,
"preview": "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nuse std::cm"
},
{
"path": "libs/llrt_json/src/parse.rs",
"chars": 3440,
"preview": "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nuse llrt_u"
},
{
"path": "libs/llrt_json/src/stringify.rs",
"chars": 17600,
"preview": "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nuse std::{c"
},
{
"path": "libs/llrt_logging/Cargo.toml",
"chars": 761,
"preview": "[package]\nname = \"llrt_logging\"\ndescription = \"LLRT logging helpers\"\nversion = \"0.8.1-beta\"\nedition = \"2021\"\nlicense = \""
},
{
"path": "libs/llrt_logging/src/lib.rs",
"chars": 31585,
"preview": "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n#![allow(cl"
},
{
"path": "libs/llrt_numbers/Cargo.toml",
"chars": 755,
"preview": "[package]\nname = \"llrt_numbers\"\ndescription = \"LLRT numbers helpers\"\nversion = \"0.8.1-beta\"\nedition = \"2021\"\nlicense = \""
},
{
"path": "libs/llrt_numbers/benches/numbers.rs",
"chars": 2081,
"preview": "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nuse criter"
},
{
"path": "libs/llrt_numbers/src/lib.rs",
"chars": 9018,
"preview": "use llrt_utils::object::ObjectExt;\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License"
},
{
"path": "libs/llrt_test/Cargo.toml",
"chars": 489,
"preview": "[package]\nname = \"llrt_test\"\ndescription = \"LLRT test helpers\"\nversion = \"0.8.1-beta\"\nedition = \"2021\"\nlicense = \"Apache"
},
{
"path": "libs/llrt_test/src/lib.rs",
"chars": 3593,
"preview": "use std::{\n fs,\n path::{Path, PathBuf},\n};\n\nuse rquickjs::{\n async_with,\n function::IntoArgs,\n loader::{B"
},
{
"path": "libs/llrt_test_tls/Cargo.toml",
"chars": 1201,
"preview": "[package]\nname = \"llrt_test_tls\"\ndescription = \"LLRT test helpers for TLS\"\nversion = \"0.8.1-beta\"\nedition = \"2021\"\nlicen"
},
{
"path": "libs/llrt_test_tls/data/generate.sh",
"chars": 803,
"preview": "#! /bin/bash\n\n# Generate the Root CA private key and certificate\nopenssl req -x509 -newkey rsa:4096 -keyout root.key -ou"
},
{
"path": "libs/llrt_test_tls/data/root.pem",
"chars": 1814,
"preview": "-----BEGIN CERTIFICATE-----\nMIIFDzCCAvegAwIBAgIUOBYUfL20Vr/EXJltiNp3uq99ookwDQYJKoZIhvcNAQEL\nBQAwFzEVMBMGA1UEAwwMVGVzdCB"
},
{
"path": "libs/llrt_test_tls/data/server.key",
"chars": 1704,
"preview": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDRq3fEYZS2w2gu\nbl6yOqyZbOkRZ8m80/65p8LTjL3"
},
{
"path": "libs/llrt_test_tls/data/server.pem",
"chars": 1480,
"preview": "-----BEGIN CERTIFICATE-----\nMIIEFzCCAf+gAwIBAgIUC+QvCSehYQJLL3qSNURTKQPBtJAwDQYJKoZIhvcNAQEL\nBQAwFzEVMBMGA1UEAwwMVGVzdCB"
},
{
"path": "libs/llrt_test_tls/src/api.rs",
"chars": 767,
"preview": "use http::{Method, Request, Response, StatusCode};\nuse http_body_util::{BodyExt, Full};\nuse hyper::body::{Bytes, Incomin"
},
{
"path": "libs/llrt_test_tls/src/config.rs",
"chars": 1409,
"preview": "use rustls::pki_types::{pem::PemObject, CertificateDer, PrivateKeyDer};\nuse std::path::PathBuf;\n\npub enum FileType {\n "
},
{
"path": "libs/llrt_test_tls/src/lib.rs",
"chars": 2044,
"preview": "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\n// FIXME t"
},
{
"path": "libs/llrt_test_tls/src/server.rs",
"chars": 5921,
"preview": "#[cfg(any(feature = \"tls-ring\", feature = \"tls-aws-lc\", feature = \"tls-graviola\"))]\nuse std::sync::Arc;\n\n#[cfg(any(\n "
},
{
"path": "libs/llrt_utils/Cargo.toml",
"chars": 980,
"preview": "[package]\nname = \"llrt_utils\"\ndescription = \"LLRT utilities\"\nversion = \"0.8.1-beta\"\nedition = \"2021\"\nlicense = \"Apache-2"
},
{
"path": "libs/llrt_utils/src/any_of.rs",
"chars": 9750,
"preview": "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nuse rquickj"
},
{
"path": "libs/llrt_utils/src/bytearray_buffer.rs",
"chars": 6688,
"preview": "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nuse std::{\n"
},
{
"path": "libs/llrt_utils/src/bytes.rs",
"chars": 13002,
"preview": "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nuse std::rc"
},
{
"path": "libs/llrt_utils/src/class.rs",
"chars": 2267,
"preview": "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nuse rquickj"
},
{
"path": "libs/llrt_utils/src/clone.rs",
"chars": 15093,
"preview": "use std::collections::HashSet;\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Id"
},
{
"path": "libs/llrt_utils/src/ctx.rs",
"chars": 464,
"preview": "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nuse rquickj"
},
{
"path": "libs/llrt_utils/src/error.rs",
"chars": 806,
"preview": "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nuse rquickj"
},
{
"path": "libs/llrt_utils/src/error_messages.rs",
"chars": 215,
"preview": "pub const ERROR_MSG_NOT_ARRAY_BUFFER: &str = \"Not an ArrayBuffer\";\npub const ERROR_MSG_ARRAY_BUFFER_DETACHED: &str = \"Ar"
},
{
"path": "libs/llrt_utils/src/fs.rs",
"chars": 2921,
"preview": "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nuse std::{f"
},
{
"path": "libs/llrt_utils/src/hash.rs",
"chars": 213,
"preview": "use std::hash::{DefaultHasher, Hash, Hasher};\n\n#[inline]\npub fn default_hash<T: Hash + ?Sized>(v: &T) -> usize {\n let"
},
{
"path": "libs/llrt_utils/src/io.rs",
"chars": 1053,
"preview": "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nmacro_rule"
},
{
"path": "libs/llrt_utils/src/latch.rs",
"chars": 697,
"preview": "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nuse std::sy"
},
{
"path": "libs/llrt_utils/src/lib.rs",
"chars": 639,
"preview": "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\npub mod any"
}
]
// ... and 457 more files (download for full content)
About this extraction
This page contains the full source code of the awslabs/llrt GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 657 files (4.5 MB), approximately 1.2M tokens, and a symbol index with 4642 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.