repo stringlengths 6 65 | file_url stringlengths 81 311 | file_path stringlengths 6 227 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:31:58 2026-01-04 20:25:31 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/web-sys/tests/wasm/body_element.rs | crates/web-sys/tests/wasm/body_element.rs | use wasm_bindgen::prelude::*;
use wasm_bindgen_test::*;
use web_sys::HtmlBodyElement;
#[wasm_bindgen(module = "/tests/wasm/element.js")]
extern "C" {
fn new_body() -> HtmlBodyElement;
}
#[wasm_bindgen_test]
fn test_body_element() {
let element = new_body();
assert_eq!(element.text(), "", "Shouldn't have a... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/web-sys/tests/wasm/button_element.rs | crates/web-sys/tests/wasm/button_element.rs | use wasm_bindgen::prelude::*;
use wasm_bindgen_test::*;
use web_sys::{HtmlButtonElement, HtmlFormElement};
#[wasm_bindgen(module = "/tests/wasm/element.js")]
extern "C" {
fn new_button() -> HtmlButtonElement;
fn new_form() -> HtmlFormElement;
}
#[wasm_bindgen_test]
#[allow(deprecated)]
fn test_button_element(... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/web-sys/tests/wasm/opfs.rs | crates/web-sys/tests/wasm/opfs.rs | use std::collections::BTreeMap;
use futures::stream::StreamExt;
use js_sys::{Array, JsString};
use wasm_bindgen::prelude::*;
use wasm_bindgen_futures::{stream::JsStream, JsFuture};
use wasm_bindgen_test::*;
use web_sys::{
window, File, FileSystemDirectoryHandle, FileSystemFileHandle, FileSystemGetDirectoryOptions,... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/web-sys/tests/wasm/script_element.rs | crates/web-sys/tests/wasm/script_element.rs | use wasm_bindgen::prelude::*;
use wasm_bindgen_test::*;
use web_sys::HtmlScriptElement;
#[wasm_bindgen(module = "/tests/wasm/element.js")]
extern "C" {
fn new_script() -> HtmlScriptElement;
}
#[wasm_bindgen_test]
fn test_script_element() {
let element = new_script();
assert_eq!(element.src(), "", "Shouldn... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/web-sys/tests/wasm/olist_element.rs | crates/web-sys/tests/wasm/olist_element.rs | use wasm_bindgen::prelude::*;
use wasm_bindgen_test::*;
use web_sys::HtmlOListElement;
#[wasm_bindgen(module = "/tests/wasm/element.js")]
extern "C" {
fn new_olist() -> HtmlOListElement;
}
#[wasm_bindgen_test]
fn test_olist_element() {
let olist = new_olist();
olist.set_reversed(true);
assert!(
... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/web-sys/tests/wasm/location.rs | crates/web-sys/tests/wasm/location.rs | use wasm_bindgen_test::*;
use web_sys::{self, Location};
fn location() -> Location {
web_sys::window().unwrap().location()
}
#[wasm_bindgen_test]
fn href() {
let loc = location();
loc.href().unwrap();
}
#[wasm_bindgen_test]
fn origin() {
let loc = location();
loc.origin().unwrap();
}
#[wasm_bind... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/web-sys/tests/wasm/main.rs | crates/web-sys/tests/wasm/main.rs | #![cfg(target_arch = "wasm32")]
use wasm_bindgen_test::*;
wasm_bindgen_test_configure!(run_in_browser);
pub mod anchor_element;
pub mod blob;
pub mod body_element;
pub mod br_element;
pub mod button_element;
pub mod console;
pub mod div_element;
pub mod dom_point;
pub mod element;
pub mod event;
pub mod head_element... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/web-sys/tests/wasm/image_data.rs | crates/web-sys/tests/wasm/image_data.rs | use wasm_bindgen::prelude::*;
use wasm_bindgen::Clamped;
use wasm_bindgen_test::*;
use web_sys::HtmlAnchorElement;
#[wasm_bindgen(module = "/tests/wasm/element.js")]
extern "C" {
fn new_a() -> HtmlAnchorElement;
}
#[wasm_bindgen_test]
fn test_anchor_element() {
// This test is to make sure there is no weird mu... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/web-sys/tests/wasm/span_element.rs | crates/web-sys/tests/wasm/span_element.rs | use wasm_bindgen::prelude::*;
use wasm_bindgen_test::*;
use web_sys::HtmlSpanElement;
#[wasm_bindgen(module = "/tests/wasm/element.js")]
extern "C" {
fn new_span() -> HtmlSpanElement;
}
#[wasm_bindgen_test]
fn test_span_element() {
let _element = new_span();
// Span doesn't have an interface
}
| rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/web-sys/tests/wasm/console.rs | crates/web-sys/tests/wasm/console.rs | use wasm_bindgen_test::*;
use web_sys::console;
#[wasm_bindgen_test]
fn test_console() {
console::time_with_label("test label");
console::time_end_with_label("test label");
}
| rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/web-sys/tests/wasm/title_element.rs | crates/web-sys/tests/wasm/title_element.rs | use wasm_bindgen::prelude::*;
use wasm_bindgen_test::*;
use web_sys::HtmlTitleElement;
#[wasm_bindgen(module = "/tests/wasm/element.js")]
extern "C" {
fn new_title() -> HtmlTitleElement;
}
#[wasm_bindgen_test]
fn title_element() {
let element = new_title();
assert_eq!(element.text().unwrap(), "", "Shouldn... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/web-sys/tests/wasm/html_element.rs | crates/web-sys/tests/wasm/html_element.rs | use wasm_bindgen::prelude::*;
use wasm_bindgen_test::*;
use web_sys::HtmlElement;
#[wasm_bindgen(module = "/tests/wasm/element.js")]
extern "C" {
fn new_html() -> HtmlElement;
}
#[wasm_bindgen_test]
fn test_html_element() {
let element = new_html();
assert!(element.is_instance_of::<HtmlElement>());
a... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/web-sys/tests/wasm/blob.rs | crates/web-sys/tests/wasm/blob.rs | use js_sys::{Array, ArrayBuffer};
use wasm_bindgen::prelude::*;
use wasm_bindgen_futures::JsFuture;
use wasm_bindgen_test::*;
use web_sys::Blob;
#[wasm_bindgen(module = "/tests/wasm/blob.js")]
extern "C" {
fn new_blob() -> Blob;
}
#[wasm_bindgen_test]
fn test_blob_from_js() {
let blob = new_blob();
assert... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/web-sys/tests/wasm/performance.rs | crates/web-sys/tests/wasm/performance.rs | use wasm_bindgen::prelude::*;
use wasm_bindgen_test::*;
use web_sys::Performance;
#[wasm_bindgen]
extern "C" {
#[wasm_bindgen(thread_local_v2, js_name = performance)]
static PERFORMANCE: Performance;
}
#[wasm_bindgen_test]
fn to_json() {
let perf = JsValue::from(PERFORMANCE.with(Performance::to_json));
... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/web-sys/tests/wasm/head_element.rs | crates/web-sys/tests/wasm/head_element.rs | use wasm_bindgen::prelude::*;
use wasm_bindgen_test::*;
use web_sys::HtmlHeadElement;
#[wasm_bindgen(module = "/tests/wasm/element.js")]
extern "C" {
fn new_head() -> HtmlHeadElement;
}
#[wasm_bindgen_test]
fn test_head_element() {
let _element = new_head();
// Head doesn't have an interface
}
| rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/web-sys/tests/wasm/indexeddb.rs | crates/web-sys/tests/wasm/indexeddb.rs | use wasm_bindgen_test::*;
#[wasm_bindgen_test]
fn accessor_works() {
let window = web_sys::window().unwrap();
assert!(window.indexed_db().unwrap().is_some());
}
| rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/web-sys/tests/wasm/anchor_element.rs | crates/web-sys/tests/wasm/anchor_element.rs | use wasm_bindgen::prelude::*;
use wasm_bindgen_test::*;
use web_sys::HtmlAnchorElement;
#[wasm_bindgen(module = "/tests/wasm/element.js")]
extern "C" {
fn new_a() -> HtmlAnchorElement;
}
#[wasm_bindgen_test]
fn test_anchor_element() {
let element = new_a();
assert_eq!(element.target(), "", "Shouldn't have... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/web-sys/tests/wasm/output_element.rs | crates/web-sys/tests/wasm/output_element.rs | use wasm_bindgen::prelude::*;
use wasm_bindgen_test::*;
use web_sys::HtmlOutputElement;
#[wasm_bindgen(module = "/tests/wasm/element.js")]
extern "C" {
fn new_output() -> HtmlOutputElement;
}
#[wasm_bindgen_test]
fn test_output_element() {
let output = new_output();
assert!(
output.html_for().leng... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/web-sys/tests/wasm/table_element.rs | crates/web-sys/tests/wasm/table_element.rs | use wasm_bindgen::prelude::*;
use wasm_bindgen_test::*;
use web_sys::{HtmlTableCaptionElement, HtmlTableElement, HtmlTableSectionElement};
#[wasm_bindgen(module = "/tests/wasm/element.js")]
extern "C" {
fn new_table() -> HtmlTableElement;
fn new_caption() -> HtmlTableCaptionElement;
fn new_thead() -> HtmlT... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/cli-support/src/descriptor.rs | crates/cli-support/src/descriptor.rs | use std::char;
use wasm_bindgen_shared::identifier::is_valid_ident;
use wasm_bindgen_shared::tys::*;
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum Descriptor {
I8,
U8,
ClampedU8,
I16,
U16,
I32,
U32,
I64,
U64,
I128,
U128,
F32,
F64,
Boolean,
Function(B... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/cli-support/src/descriptors.rs | crates/cli-support/src/descriptors.rs | //! Management of wasm-bindgen descriptor functions.
//!
//! The purpose of this module is to basically execute a pass on a raw wasm
//! module that just came out of the compiler. The pass will execute all
//! relevant descriptor functions contained in the module which wasm-bindgen
//! uses to convey type information h... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/cli-support/src/lib.rs | crates/cli-support/src/lib.rs | use anyhow::{bail, Context, Error};
use std::collections::{hash_map::Entry, BTreeMap, HashMap, HashSet};
use std::env;
use std::fs;
use std::mem;
use std::path::{Path, PathBuf};
use std::str;
use walrus::Module;
pub(crate) const PLACEHOLDER_MODULE: &str = "__wbindgen_placeholder__";
mod decode;
mod descriptor;
mod de... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/cli-support/src/decode.rs | crates/cli-support/src/decode.rs | use std::{ops::Deref, str};
pub trait Decode<'src>: Sized {
fn decode(data: &mut &'src [u8]) -> Self;
fn decode_all(mut data: &'src [u8]) -> Self {
let ret = Self::decode(&mut data);
assert!(data.is_empty());
ret
}
}
pub struct LitOrExpr<'src> {
str: &'src str,
}
fn get(b: &m... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/cli-support/src/wasm2es6js.rs | crates/cli-support/src/wasm2es6js.rs | use anyhow::{bail, Error};
use base64::{prelude::BASE64_STANDARD, Engine as _};
use std::collections::HashSet;
use std::fmt::Write;
use walrus::Module;
pub struct Config {
base64: bool,
fetch_path: Option<String>,
}
pub struct Output {
module: Module,
base64: bool,
fetch_path: Option<String>,
}
i... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/cli-support/src/multivalue.rs | crates/cli-support/src/multivalue.rs | use crate::transforms::multi_value as multi_value_xform;
use crate::wasm_conventions;
use crate::wit::{Adapter, NonstandardWitSection};
use crate::wit::{AdapterKind, Instruction, WasmBindgenAux};
use anyhow::{anyhow, Error};
use walrus::Module;
pub fn run(module: &mut Module) -> Result<(), Error> {
let mut adapter... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/cli-support/src/externref.rs | crates/cli-support/src/externref.rs | use crate::descriptor::VectorKind;
use crate::transforms::externref::Context;
use crate::wit::{AdapterKind, Instruction, NonstandardWitSection};
use crate::wit::{AdapterType, InstructionData, StackChange, WasmBindgenAux};
use anyhow::Result;
use std::collections::HashMap;
use walrus::ElementItems;
use walrus::{ir::Valu... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/cli-support/src/wasm_conventions.rs | crates/cli-support/src/wasm_conventions.rs | //! A tiny crate of utilities for working with implicit Wasm codegen conventions
//! (often established by LLVM and lld).
//!
//! Examples conventions include:
//!
//! * The stack pointer
//! * The canonical linear memory that contains the stack
use std::io::Cursor;
use anyhow::{anyhow, bail, Context, Result};
use wa... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/cli-support/src/intrinsic.rs | crates/cli-support/src/intrinsic.rs | //! Definition of all wasm-bindgen intrinsics.
//!
//! This contains a definition of all intrinsics used by `src/lib.rs` in the
//! wasm-bindgen crate. Each intrinsic listed here is part of an `enum
//! Intrinsic` and is generated through a macro to reduce repetition.
//!
//! Intrinsics in this module currently largely... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/cli-support/src/transforms/mod.rs | crates/cli-support/src/transforms/mod.rs | pub mod externref;
pub mod multi_value;
pub mod threads;
/// If a start function is present, it removes it from the `start` section
/// of the Wasm module and then moves it to an exported function, named
/// `__wbindgen_start`.
pub(crate) fn unstart_start_function(module: &mut walrus::Module) -> bool {
let start =... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/cli-support/src/transforms/threads/mod.rs | crates/cli-support/src/transforms/threads/mod.rs | use crate::wasm_conventions;
use anyhow::{anyhow, bail, Error};
use std::cmp;
use walrus::ir::Value;
use walrus::FunctionBuilder;
use walrus::{
ir::MemArg, ConstExpr, ExportItem, FunctionId, GlobalId, GlobalKind, InstrSeqBuilder, MemoryId,
Module, ValType,
};
pub const PAGE_SIZE: u32 = 1 << 16;
const DEFAULT_T... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/cli-support/src/transforms/threads/tests/mod.rs | crates/cli-support/src/transforms/threads/tests/mod.rs | //! A small test framework to execute a test function over all files in a
//! directory.
//!
//! Each file in the directory has its own `CHECK-ALL` annotation indicating the
//! expected output of the test. That can be automatically updated with
//! `BLESS=1` in the environment. Otherwise the test are checked against t... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/cli-support/src/transforms/multi_value/mod.rs | crates/cli-support/src/transforms/multi_value/mod.rs | //! The `wasm-bindgen` multi-value transformation.
//!
//! This crate provides a transformation to turn exported functions that use a
//! return pointer into exported functions that use multi-value.
//!
//! Consider the following function:
//!
//! ```
//! #[no_mangle]
//! pub extern "C" fn pair(a: u32, b: u32) -> [u32;... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/cli-support/src/transforms/multi_value/tests/mod.rs | crates/cli-support/src/transforms/multi_value/tests/mod.rs | //! A small test framework to execute a test function over all files in a
//! directory.
//!
//! Each file in the directory has its own `CHECK-ALL` annotation indicating the
//! expected output of the test. That can be automatically updated with
//! `BLESS=1` in the environment. Otherwise the test are checked against t... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/cli-support/src/transforms/externref/mod.rs | crates/cli-support/src/transforms/externref/mod.rs | //! Transformation for wasm-bindgen to enable usage of `externref` in a wasm
//! module.
//!
//! This crate is in charge of enabling code using `wasm-bindgen` to use the
//! `externref` type inside of the Wasm module. This transformation pass primarily
//! wraps exports and imports in shims which use `externref`, but q... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/cli-support/src/transforms/externref/tests/mod.rs | crates/cli-support/src/transforms/externref/tests/mod.rs | //! A small test framework to execute a test function over all files in a
//! directory.
//!
//! Each file in the directory has its own `CHECK-ALL` annotation indicating the
//! expected output of the test. That can be automatically updated with
//! `BLESS=1` in the environment. Otherwise the test are checked against t... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/cli-support/src/js/mod.rs | crates/cli-support/src/js/mod.rs | use crate::descriptor::VectorKind;
use crate::intrinsic::Intrinsic;
use crate::transforms::{threads as threads_xform, unstart_start_function};
use crate::wit::{
Adapter, AdapterId, AdapterJsImportKind, AuxExportedMethodKind, AuxReceiverKind, AuxStringEnum,
AuxValue,
};
use crate::wit::{AdapterKind, Instruction,... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | true |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/cli-support/src/js/binding.rs | crates/cli-support/src/js/binding.rs | //! Support for actually generating a JS function shim.
//!
//! This `Builder` type is used to generate JS function shims which sit between
//! exported functions, table elements, imports, etc. All function shims
//! generated by `wasm-bindgen` run through this type.
use crate::descriptor::VectorKind;
use crate::js::C... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | true |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/cli-support/src/wit/standard.rs | crates/cli-support/src/wit/standard.rs | use crate::descriptor::VectorKind;
use std::borrow::Cow;
use std::collections::{BTreeMap, HashSet};
use walrus::{ExportId, FunctionId, ImportId, RefType, TypedCustomSectionId};
#[derive(Default, Debug)]
pub struct NonstandardWitSection {
/// A list of adapter functions, keyed by their id.
///
/// This map ... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/cli-support/src/wit/nonstandard.rs | crates/cli-support/src/wit/nonstandard.rs | use crate::intrinsic::Intrinsic;
use crate::wit::AdapterId;
use std::borrow::Cow;
use std::collections::{BTreeMap, HashMap, HashSet};
use std::path::PathBuf;
use walrus::TypedCustomSectionId;
/// A synthetic custom section which is not standardized, never will be, and
/// cannot be serialized or parsed. This is synthe... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/cli-support/src/wit/mod.rs | crates/cli-support/src/wit/mod.rs | use crate::decode::{ImportModule, LocalModule};
use crate::descriptor::{Descriptor, Function};
use crate::descriptors::WasmBindgenDescriptorsSection;
use crate::intrinsic::Intrinsic;
use crate::transforms::threads::ThreadCount;
use crate::{decode, wasm_conventions, Bindgen, PLACEHOLDER_MODULE};
use anyhow::{anyhow, bai... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | true |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/cli-support/src/wit/outgoing.rs | crates/cli-support/src/wit/outgoing.rs | use crate::descriptor::{Descriptor, Function};
use crate::wasm_conventions::get_function_table_entry;
use crate::wit::{AdapterType, Instruction, InstructionBuilder};
use crate::wit::{InstructionData, StackChange};
use anyhow::{bail, format_err, Error};
use walrus::{ExportId, ValType};
use wasm_bindgen_shared::identifie... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/cli-support/src/wit/incoming.rs | crates/cli-support/src/wit/incoming.rs | //! Definition of how to convert Rust types (`Description`) into Wasm types
//! through adapter functions.
//!
//! Note that many Rust types use "nonstandard" instructions which only work in
//! the JS output, not for the "pure Wasm interface types" output.
//!
//! Note that the mirror operation, going from WebAssembly... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/cli-support/src/interpreter/smoke_tests.rs | crates/cli-support/src/interpreter/smoke_tests.rs | use super::Interpreter;
use walrus::ModuleConfig;
fn interpret(wat: &str, name: &str, result: &[u32]) {
let wasm = wat::parse_str(wat).unwrap();
let module = ModuleConfig::new()
.generate_producers_section(false)
.parse(&wasm)
.unwrap();
let mut i = Interpreter::new(&module).unwrap(... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/cli-support/src/interpreter/mod.rs | crates/cli-support/src/interpreter/mod.rs | //! A tiny and incomplete Wasm interpreter
//!
//! This module contains a tiny and incomplete Wasm interpreter built on top of
//! `walrus`'s module structure. Each `Interpreter` contains some state
//! about the execution of a Wasm instance. The "incomplete" part here is
//! related to the fact that this is *only* use... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/futures/src/stream.rs | crates/futures/src/stream.rs | //! Converting JavaScript `AsyncIterator`s to Rust `Stream`s.
//!
//! Analogous to the promise to future conversion, this module allows
//! turning objects implementing the async iterator protocol into `Stream`s
//! that produce values that can be awaited from.
//!
use crate::JsFuture;
use core::future::Future;
use co... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/futures/src/lib.rs | crates/futures/src/lib.rs | //! Converting between JavaScript `Promise`s to Rust `Future`s.
//!
//! This crate provides a bridge for working with JavaScript `Promise` types as
//! a Rust `Future`, and similarly contains utilities to turn a rust `Future`
//! into a JavaScript `Promise`. This can be useful when working with
//! asynchronous or othe... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/futures/src/queue.rs | crates/futures/src/queue.rs | use alloc::collections::VecDeque;
use alloc::rc::Rc;
use core::cell::{Cell, RefCell};
use js_sys::Promise;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
#[wasm_bindgen]
fn queueMicrotask(closure: &Closure<dyn FnMut(JsValue)>);
type Global;
#[wasm_bindgen(method, getter, js_name = queueMi... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/futures/src/task/multithread.rs | crates/futures/src/task/multithread.rs | #![allow(clippy::incompatible_msrv)]
use alloc::boxed::Box;
use alloc::rc::Rc;
use alloc::sync::Arc;
use core::cell::RefCell;
use core::future::Future;
use core::mem::ManuallyDrop;
use core::pin::Pin;
use core::sync::atomic::AtomicI32;
use core::sync::atomic::Ordering::SeqCst;
use core::task::{Context, Poll, RawWaker,... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/futures/src/task/singlethread.rs | crates/futures/src/task/singlethread.rs | use alloc::boxed::Box;
use alloc::rc::Rc;
use core::cell::{Cell, RefCell};
use core::future::Future;
use core::mem::ManuallyDrop;
use core::pin::Pin;
use core::task::{Context, RawWaker, RawWakerVTable, Waker};
struct Inner {
future: Pin<Box<dyn Future<Output = ()> + 'static>>,
waker: Waker,
}
impl Inner {
... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/futures/src/task/wait_async_polyfill.rs | crates/futures/src/task/wait_async_polyfill.rs | //!
//! The polyfill was kindly borrowed from https://github.com/tc39/proposal-atomics-wait-async
//! and ported to Rust
//!
#![allow(clippy::incompatible_msrv)]
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You c... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/futures/tests/tests.rs | crates/futures/tests/tests.rs | #![cfg(target_arch = "wasm32")]
wasm_bindgen_test::wasm_bindgen_test_configure!(run_in_browser);
use futures_channel::oneshot;
use js_sys::Promise;
#[cfg(target_feature = "atomics")]
use std::future::Future;
use std::ops::FnMut;
#[cfg(target_feature = "atomics")]
use std::pin::Pin;
#[cfg(target_feature = "atomics")]
... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/futures/benches/promise.rs | crates/futures/benches/promise.rs | use js_sys::Promise;
use wasm_bindgen::JsValue;
use wasm_bindgen_futures::JsFuture;
use wasm_bindgen_test::{wasm_bindgen_bench, Criterion};
#[wasm_bindgen_bench]
async fn bench_promise(c: &mut Criterion) {
c.bench_async_function("bench_promise_to_future", |b| {
let f = b.iter_future(|| JsFuture::from(Promi... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/test-macro/src/lib.rs | crates/test-macro/src/lib.rs | //! See the README for `wasm-bindgen-test` for a bit more info about what's
//! going on here.
extern crate proc_macro;
use proc_macro2::*;
use quote::quote;
use quote::quote_spanned;
#[proc_macro_attribute]
pub fn wasm_bindgen_bench(
attr: proc_macro::TokenStream,
body: proc_macro::TokenStream,
) -> proc_ma... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/test-macro/tests/ui.rs | crates/test-macro/tests/ui.rs | #[test]
fn ui() {
let t = trybuild::TestCases::new();
t.compile_fail("ui-tests/*.rs");
}
| rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/test-macro/ui-tests/crate.rs | crates/test-macro/ui-tests/crate.rs | #![no_implicit_prelude]
extern crate wasm_bindgen_test_macro;
//
use wasm_bindgen_test_macro::wasm_bindgen_test;
pub mod wasm {
pub extern crate wasm_bindgen_test as test;
}
#[wasm_bindgen_test(crate = ::wasm_bindgen_test)]
fn success_1() {}
#[wasm_bindgen_test(crate = crate::wasm::test)]
fn success_2() {}
#[w... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/test-macro/ui-tests/unsupported.rs | crates/test-macro/ui-tests/unsupported.rs | #![no_implicit_prelude]
extern crate tokio;
extern crate wasm_bindgen_test_macro;
//
use wasm_bindgen_test_macro::wasm_bindgen_test;
#[wasm_bindgen_test(unsupported = tokio::test(flavor = "multi_thread", worker_threads = 1))]
async fn success() {}
#[wasm_bindgen_test(unsupported)]
fn failure_1() {}
#[wasm_bindgen_t... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/test-macro/ui-tests/ignore.rs | crates/test-macro/ui-tests/ignore.rs | #![no_implicit_prelude]
extern crate wasm_bindgen_test_macro;
use wasm_bindgen_test_macro::wasm_bindgen_test;
#[wasm_bindgen_test]
#[ignore]
fn success_1() {}
#[wasm_bindgen_test]
#[ignore = "test"]
fn success_2() {}
#[wasm_bindgen_test]
#[ignore]
async fn async_success_1() {}
#[wasm_bindgen_test]
#[ignore = "tes... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/test-macro/ui-tests/should_panic.rs | crates/test-macro/ui-tests/should_panic.rs | #![no_implicit_prelude]
extern crate wasm_bindgen_test_macro;
use wasm_bindgen_test_macro::wasm_bindgen_test;
#[wasm_bindgen_test]
#[should_panic]
fn success_1() {}
#[wasm_bindgen_test]
#[should_panic = "test"]
fn success_2() {}
#[wasm_bindgen_test]
#[should_panic(expected = "test")]
fn success_3() {}
#[wasm_bind... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/webidl-tests/consts.rs | crates/webidl-tests/consts.rs | use crate::generated::*;
use wasm_bindgen_test::*;
#[wasm_bindgen_test]
fn bool() {
let falsish: bool = ConstBool::NOT_TRUE;
assert!(!falsish);
let trueish: bool = ConstBool::NOT_FALSE;
assert!(trueish);
}
#[wasm_bindgen_test]
fn ints() {
assert_eq!(ConstByte::IMIN, i8::MIN);
assert_eq!(ConstB... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/webidl-tests/promise.rs | crates/webidl-tests/promise.rs | use crate::generated::*;
use wasm_bindgen_futures::JsFuture;
use wasm_bindgen_test::*;
#[wasm_bindgen_test]
async fn return_promise() {
let f = TestPromises::new().unwrap();
let v = JsFuture::from(f.string_promise())
.await
.unwrap()
.as_string()
.unwrap();
assert_eq!(v, "ab... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/webidl-tests/array.rs | crates/webidl-tests/array.rs | use crate::generated::*;
use wasm_bindgen::Clamped;
use wasm_bindgen_test::*;
#[wasm_bindgen_test]
fn take_and_return_a_bunch_of_slices() {
let f = TestArrays::new().unwrap();
assert_eq!(f.strings("y"), "x");
assert_eq!(f.byte_strings("yz"), "xx");
assert_eq!(f.usv_strings("abc"), "efg");
assert_eq... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/webidl-tests/global.rs | crates/webidl-tests/global.rs | use crate::generated::*;
use wasm_bindgen::prelude::*;
use wasm_bindgen_test::*;
#[wasm_bindgen]
extern "C" {
fn get_global() -> Global;
}
#[wasm_bindgen_test]
fn works() {
let x = get_global();
assert_eq!(x.global_no_args(), 3);
assert_eq!(x.global_with_args("a", "b"), "ab");
assert_eq!(x.global_... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/webidl-tests/lib.rs | crates/webidl-tests/lib.rs | // Intentionally left blank in order for Cargo to work
| rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/webidl-tests/unstable.rs | crates/webidl-tests/unstable.rs | #[cfg(web_sys_unstable_apis)]
use crate::generated::*;
#[cfg(web_sys_unstable_apis)]
use wasm_bindgen_test::*;
#[cfg(web_sys_unstable_apis)]
#[wasm_bindgen_test]
fn can_use_unstable_apis() {
let unstable_interface = GetUnstableInterface::get();
assert_eq!(0u32, unstable_interface.enum_value());
let mut di... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/webidl-tests/no_interface.rs | crates/webidl-tests/no_interface.rs | use crate::generated::*;
use wasm_bindgen_test::*;
#[wasm_bindgen_test]
fn smoke() {
let obj = GetNoInterfaceObject::get();
assert_eq!(obj.number(), 3.0);
obj.foo();
}
| rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/webidl-tests/array_buffer.rs | crates/webidl-tests/array_buffer.rs | use crate::generated::*;
use wasm_bindgen_test::*;
#[wasm_bindgen_test]
fn take_and_return_a_bunch_of_slices() {
let f = ArrayBufferTest::new().unwrap();
let x = f.get_buffer();
f.set_buffer(None);
f.set_buffer(Some(&x));
let buf = f.get_data_view();
assert_eq!(buf.get_int8(0), 42);
}
| rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/webidl-tests/callbacks.rs | crates/webidl-tests/callbacks.rs | use crate::generated::*;
use js_sys::Function;
use wasm_bindgen_test::*;
#[wasm_bindgen_test]
fn multi_op_same_name() {
let a = CallbackInterface2::new();
let b = TakeCallbackInterface::new().unwrap();
b.b(&a);
}
#[wasm_bindgen_test]
fn single_op_function() {
let a = Function::new_no_args("");
let... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/webidl-tests/dictionary.rs | crates/webidl-tests/dictionary.rs | use crate::generated::*;
use wasm_bindgen::prelude::*;
use wasm_bindgen_test::*;
#[wasm_bindgen]
extern "C" {
fn assert_dict_c(c: &C);
#[wasm_bindgen(js_name = assert_dict_c)]
fn assert_dict_c2(c: C);
#[wasm_bindgen(js_name = assert_dict_c)]
fn assert_dict_c3(c: Option<&C>);
#[wasm_bindgen(js_n... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/webidl-tests/enums.rs | crates/webidl-tests/enums.rs | use crate::generated::*;
use wasm_bindgen_test::*;
#[wasm_bindgen_test]
fn top_level_enum() {
let circle = Shape::new(ShapeType::Circle).unwrap();
let square = Shape::new(ShapeType::Square).unwrap();
assert!(circle.is_circle());
assert!(!circle.is_square());
assert!(square.is_square());
assert!... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/webidl-tests/simple.rs | crates/webidl-tests/simple.rs | use crate::generated::*;
use js_sys::Object;
use std::f64::consts::{E, PI};
use wasm_bindgen::prelude::*;
use wasm_bindgen_test::*;
#[wasm_bindgen_test]
fn interfaces_inherit_from_object() {
let m = Method::new(42.0).unwrap();
assert!(m.is_instance_of::<Object>());
let _: &Object = m.as_ref();
}
#[wasm_bi... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/webidl-tests/build.rs | crates/webidl-tests/build.rs | use std::env;
use std::path::PathBuf;
fn main() {
let out_dir = PathBuf::from(env::var_os("OUT_DIR").unwrap());
wasm_bindgen_webidl::generate(
"webidls".as_ref(),
&out_dir,
wasm_bindgen_webidl::Options { features: false },
)
.unwrap();
}
| rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/webidl-tests/setlike.rs | crates/webidl-tests/setlike.rs | use crate::generated::*;
use wasm_bindgen::prelude::*;
use wasm_bindgen_test::*;
macro_rules! read_test_suite {
($setlike:ty, $name:ident) => {
#[wasm_bindgen_test]
fn $name() {
// { "a", "b", "c" }
let setlike = <$setlike>::new().unwrap();
// readonly attribute... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/webidl-tests/throws.rs | crates/webidl-tests/throws.rs | use crate::generated::*;
use wasm_bindgen_test::*;
#[wasm_bindgen_test]
fn throws() {
assert!(Thang::new(0).is_err());
let thang = Thang::new(1).unwrap();
assert!(thang.ok_attr().is_ok());
assert!(thang.set_ok_attr(0).is_ok());
assert!(thang.err_attr().is_err());
assert!(thang.set_err_attr(0)... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/webidl-tests/maplike.rs | crates/webidl-tests/maplike.rs | use crate::generated::*;
use wasm_bindgen::prelude::*;
use wasm_bindgen_test::*;
macro_rules! read_test_suite {
($maplike:ty, $name:ident) => {
#[wasm_bindgen_test]
fn $name() {
// { "a": 1, "b": 2, "c": 3 }
let maplike = <$maplike>::new().unwrap();
// readonly ... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/webidl-tests/main.rs | crates/webidl-tests/main.rs | extern crate alloc;
use wasm_bindgen::prelude::*;
use wasm_bindgen_test::*;
#[wasm_bindgen(module = "/globals.js")]
extern "C" {
fn noop();
}
#[wasm_bindgen]
pub fn hello_there() {}
// This is to ensure that the file is actually loaded
#[wasm_bindgen_test]
fn keep() {
noop();
}
mod generated {
include!... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/webidl-tests/namespace.rs | crates/webidl-tests/namespace.rs | use crate::generated::*;
use wasm_bindgen_test::*;
#[wasm_bindgen_test]
fn simple_namespace_test() {
assert_eq!(math_test::add_one(1), 2);
assert_eq!(math_test::pow(1.0, 100.0), 1.0);
assert_eq!(math_test::pow(10.0, 2.0), 100.0);
}
| rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/cli/build.rs | crates/cli/build.rs | fn main() {
// For `rstest` to pick up new tests.
println!("cargo::rerun-if-changed=tests/reference");
}
| rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/cli/src/wasm_bindgen.rs | crates/cli/src/wasm_bindgen.rs | use anyhow::{bail, Error};
use clap::{Parser, ValueEnum};
use std::ffi::OsString;
use std::path::PathBuf;
use wasm_bindgen_cli_support::{Bindgen, EncodeInto};
#[derive(Debug, Clone, ValueEnum)]
#[clap(rename_all = "kebab-case")]
enum Target {
Bundler,
Web,
Nodejs,
NoModules,
Deno,
ExperimentalN... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/cli/src/lib.rs | crates/cli/src/lib.rs | pub mod wasm2es6js;
pub mod wasm_bindgen;
pub mod wasm_bindgen_test_runner;
| rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/cli/src/wasm_bindgen_test_runner.rs | crates/cli/src/wasm_bindgen_test_runner.rs | //! A "wrapper binary" used to execute Wasm files as tests
//!
//! This binary is intended to be used as a "test runner" for Wasm binaries,
//! being compatible with `cargo test` for the Wasm target. It will
//! automatically execute `wasm-bindgen` (or the equivalent thereof) and then
//! execute either Node.js over th... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/cli/src/wasm2es6js.rs | crates/cli/src/wasm2es6js.rs | use anyhow::{bail, Context, Error};
use clap::Parser;
use std::ffi::OsString;
use std::fs;
use std::path::PathBuf;
#[derive(Parser, Debug)]
#[command(
name = "wasm2es6js",
version,
about,
long_about = None,
after_help = "Note that this is not intended to produce a production-ready output module but... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/cli/src/wasm_bindgen_test_runner/node.rs | crates/cli/src/wasm_bindgen_test_runner/node.rs | use std::path::{Path, PathBuf};
use std::process;
use std::process::Command;
use std::{env, fs};
use anyhow::bail;
use anyhow::{Context, Error};
use super::Cli;
use super::Tests;
// depends on the variable 'wasm' and initializes te WasmBindgenTestContext cx
pub fn shared_setup(is_bench: bool) -> String {
format!... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/cli/src/wasm_bindgen_test_runner/deno.rs | crates/cli/src/wasm_bindgen_test_runner/deno.rs | use std::fs;
use std::path::Path;
use std::process::Command;
use anyhow::{bail, Context, Error};
use super::Tests;
use super::{node::shared_setup, Cli};
pub fn execute(module: &str, tmpdir: &Path, cli: Cli, tests: Tests) -> Result<(), Error> {
let mut js_to_execute = format!(
r#"import * as wasm from "./... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/cli/src/wasm_bindgen_test_runner/headless.rs | crates/cli/src/wasm_bindgen_test_runner/headless.rs | use super::shell::Shell;
use anyhow::{bail, format_err, Context, Error};
use log::{debug, warn};
use rouille::url::Url;
use serde::{Deserialize, Serialize};
use serde_json::{json, Map, Value as Json};
use std::env;
use std::fs::File;
use std::io::{self, Cursor, ErrorKind, Read, Write};
use std::net::{SocketAddr, TcpLis... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/cli/src/wasm_bindgen_test_runner/shell.rs | crates/cli/src/wasm_bindgen_test_runner/shell.rs | const WIDTH: usize = 50;
use std::io::{self, Write};
pub struct Shell {}
impl Shell {
pub fn new() -> Shell {
Shell {}
}
pub fn status(&self, s: &str) {
let s = if s.len() > WIDTH { &s[..WIDTH] } else { s };
print!("{s:<WIDTH$}\r");
io::stdout().flush().unwrap();
}
... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/cli/src/wasm_bindgen_test_runner/server.rs | crates/cli/src/wasm_bindgen_test_runner/server.rs | use std::borrow::Cow;
use std::io::{Read, Write};
use std::net::SocketAddr;
use std::path::{Path, PathBuf};
use std::{env, fs, process};
use anyhow::{anyhow, Context, Error};
use rouille::{Request, Response, Server};
use super::{Cli, TestMode, Tests};
pub(crate) fn spawn(
addr: &SocketAddr,
headless: bool,
... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/cli/src/bin/wasm-bindgen.rs | crates/cli/src/bin/wasm-bindgen.rs | use std::{env, process};
fn main() {
env_logger::init();
let err = match wasm_bindgen_cli::wasm_bindgen::run_cli_with_args(env::args_os()) {
Ok(()) => return,
Err(e) => e,
};
eprintln!("error: {err:?}");
process::exit(1);
}
| rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/cli/src/bin/wasm2es6js.rs | crates/cli/src/bin/wasm2es6js.rs | use std::env;
fn main() -> anyhow::Result<()> {
env_logger::init();
wasm_bindgen_cli::wasm2es6js::run_cli_with_args(env::args_os())
}
| rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/cli/src/bin/wasm-bindgen-test-runner.rs | crates/cli/src/bin/wasm-bindgen-test-runner.rs | use std::env;
fn main() -> anyhow::Result<()> {
env_logger::init();
wasm_bindgen_cli::wasm_bindgen_test_runner::run_cli_with_args(env::args_os())?;
Ok(())
}
| rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/cli/tests/wasm-bindgen-test-runner/main.rs | crates/cli/tests/wasm-bindgen-test-runner/main.rs | //! A small test suite for the `wasm-bindgen-test-runner` CLI command itself
use assert_cmd::Command;
use predicates::str;
use std::env;
use std::fs;
use std::io::BufRead;
use std::path::PathBuf;
use std::process::Output;
use std::sync::LazyLock;
static TARGET_DIR: LazyLock<PathBuf> = LazyLock::new(|| {
let mut d... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/cli/tests/wasm-bindgen/reference.rs | crates/cli/tests/wasm-bindgen/reference.rs | //! A test suite to check the reference JS and Wasm output of the `wasm-bindgen`
//! library.
//!
//! This is intended as an end-to-end integration test where we can track
//! changes to the JS and Wasm output.
//!
//! Tests are located in `reference/*.rs` files and are accompanied with sibling
//! `*.js` files and `*.... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/cli/tests/wasm-bindgen/main.rs | crates/cli/tests/wasm-bindgen/main.rs | //! A small test suite for the `wasm-bindgen` CLI command itself
//!
//! This test suite is intended to exercise functionality of the CLI in terms of
//! errors and such. It is not intended for comprehensive behavior testing, as
//! that should all be placed in the top-level `tests` directory for the
//! `wasm-bindgen`... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/cli/tests/wasm-bindgen/npm.rs | crates/cli/tests/wasm-bindgen/npm.rs | use crate::{Project, REPO_ROOT};
macro_rules! assert_matches {
($haystack:expr, $needle:literal) => {
let haystack = $haystack;
let re = regex::Regex::new($needle).unwrap();
assert!(
re.is_match(haystack),
"Expected\n{haystack:?}\nto match\n{re:?}"
);
};... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/cli/tests/reference/anyref-import-catch.rs | crates/cli/tests/reference/anyref-import-catch.rs | // enable-externref
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
#[wasm_bindgen(catch)]
fn foo() -> Result<(), JsValue>;
}
#[wasm_bindgen]
pub fn exported() -> Result<(), JsValue> {
foo()
}
| rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/cli/tests/reference/function-attrs.rs | crates/cli/tests/reference/function-attrs.rs | use wasm_bindgen::prelude::*;
/// Description for fn_with_attr
#[wasm_bindgen(
unchecked_return_type = "number",
return_description = "returns 1 if arg2 is true, or arg1 if arg2 is undefined or false"
)]
pub async fn fn_with_attr(
#[wasm_bindgen(js_name = "firstArg", param_description = "some number")] arg... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/cli/tests/reference/skip-jsdoc.rs | crates/cli/tests/reference/skip-jsdoc.rs | use wasm_bindgen::prelude::*;
/// Manually documented function
///
/// @param {number} arg - This is my arg. It is mine.
/// @returns to whence I came
#[wasm_bindgen(skip_jsdoc)]
pub fn docme(arg: u32) -> u32 {
arg + 1
}
/// Regular documentation.
#[wasm_bindgen]
pub fn i_has_docs(arg: u32) -> u32 {
arg + 1
}... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/cli/tests/reference/default-class.rs | crates/cli/tests/reference/default-class.rs | use wasm_bindgen::prelude::*;
#[wasm_bindgen(js_name = default)]
pub struct DefaultClass {
value: i32,
}
#[wasm_bindgen(js_class = default)]
impl DefaultClass {
#[wasm_bindgen(constructor)]
pub fn new(value: i32) -> DefaultClass {
DefaultClass { value }
}
pub fn get_value(&self) -> i32 {
... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/cli/tests/reference/self-type.rs | crates/cli/tests/reference/self-type.rs | use wasm_bindgen::prelude::*;
#[wasm_bindgen]
pub struct Test;
#[wasm_bindgen]
impl Test {
#[wasm_bindgen(constructor)]
pub fn new() -> Test {
Test
}
pub fn consume_self(self) {}
pub fn ref_self(&self) {}
pub fn ref_mut_self(&mut self) {}
pub fn self_Self(self: Self) {}
pub f... | rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/cli/tests/reference/builder.rs | crates/cli/tests/reference/builder.rs | use wasm_bindgen::prelude::*;
#[wasm_bindgen]
pub struct ClassBuilder(());
#[wasm_bindgen]
impl ClassBuilder {
pub fn builder() -> ClassBuilder {
ClassBuilder(())
}
}
| rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
wasm-bindgen/wasm-bindgen | https://github.com/wasm-bindgen/wasm-bindgen/blob/dda4821ee2fbcaa7adc58bc8c385ed8d3627a272/crates/cli/tests/reference/pointers.rs | crates/cli/tests/reference/pointers.rs | use wasm_bindgen::prelude::*;
#[wasm_bindgen]
pub fn const_pointer(input: *const u8) -> *const u8 {
u32::MAX as *const _
}
#[wasm_bindgen]
pub fn mut_pointer(input: *mut u8) -> *mut u8 {
u32::MAX as *mut _
}
| rust | Apache-2.0 | dda4821ee2fbcaa7adc58bc8c385ed8d3627a272 | 2026-01-04T15:46:52.814516Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.