Code Monkey home page Code Monkey logo

Comments (3)

eric-seppanen avatar eric-seppanen commented on June 15, 2024 1

Thanks @daxpedda. I investigated all the SubtleCrypto methods and I believe they can all take shared references.

I opened PR #3797 making the change.

from wasm-bindgen.

eric-seppanen avatar eric-seppanen commented on June 15, 2024

I notice a few other uses of &mut in SubtleCrypto methods that seem suspicious, e.g. verify_with_xxx_and_yyy_and_u8_array methods accept data: &mut [u8]. This refers to the data over which a signature should be verified; mutating the data would be quite unexpected.

from wasm-bindgen.

daxpedda avatar daxpedda commented on June 15, 2024

See The wasm-bindgen Guide on "Type Translations in web-sys".

We can add exceptions here:

pub(crate) static IMMUTABLE_SLICE_WHITELIST: Lazy<BTreeSet<&'static str>> = Lazy::new(|| {
BTreeSet::from_iter(vec![
// ImageData
"ImageData",
// WebGlRenderingContext, WebGl2RenderingContext
"uniform1fv",
"uniform2fv",
"uniform3fv",
"uniform4fv",
"uniform1iv",
"uniform2iv",
"uniform3iv",
"uniform4iv",
"uniformMatrix2fv",
"uniformMatrix3fv",
"uniformMatrix4fv",
"uniformMatrix2x3fv",
"uniformMatrix2x4fv",
"uniformMatrix3x2fv",
"uniformMatrix3x4fv",
"uniformMatrix4x2fv",
"uniformMatrix4x3fv",
"vertexAttrib1fv",
"vertexAttrib2fv",
"vertexAttrib3fv",
"vertexAttrib4fv",
"bufferData",
"bufferSubData",
"texImage2D",
"texSubImage2D",
"compressedTexImage2D",
// WebGl2RenderingContext
"uniform1uiv",
"uniform2uiv",
"uniform3uiv",
"uniform4uiv",
"texImage3D",
"texSubImage3D",
"compressedTexImage3D",
"clearBufferfv",
"clearBufferiv",
"clearBufferuiv",
// WebSocket
"send",
// WebGPU
"setBindGroup",
"writeBuffer",
"writeTexture",
// AudioBuffer
"copyToChannel",
// FontFace
"FontFace", // TODO: Add another type's functions here. Leave a comment header with the type name
// FileSystemSyncAccessHandle and FileSystemWritableFileStream
"write",
])
});

I'm happy to review a PR adding exceptions to any SubtleCrypto methods.

from wasm-bindgen.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.