Skip to content

How to deal with unproxified methods which receive proxies? #7

@rosofo

Description

@rosofo

By definition an unproxified object's method is not under our control. If the method expects an argument, and that argument happens to be wrapped in Proxy, it may fail in an implementation dependent way.

How can we prevent this?

Example

// device has type 'Proxy(GPUDevice)'
const buf = await device.createBuffer(...); // Proxy(GPUBuffer)
const range = buf.getMappedRange(); // Proxy(Float32Array)
new Float32Array(range); // creates an empty array due to the constructor's incompatibility with Proxy

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions