mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-12 04:21:21 +00:00
js-sys: Catch exceptions thrown in Reflect APIs
Proxies passed to Reflect APIs can throw for any of these operations and it is a bit of a mess.
This commit is contained in:
@ -23,3 +23,19 @@ exports.Rectangle2 = class {
|
||||
return x === y;
|
||||
}
|
||||
};
|
||||
|
||||
exports.throw_all_the_time = () => new Proxy({}, {
|
||||
getPrototypeOf() { throw new Error("nope"); },
|
||||
setPrototypeOf() { throw new Error("nope"); },
|
||||
isExtensible() { throw new Error("nope"); },
|
||||
preventExtensions() { throw new Error("nope"); },
|
||||
getOwnPropertyDescriptor() { throw new Error("nope"); },
|
||||
defineProperty() { throw new Error("nope"); },
|
||||
has() { throw new Error("nope"); },
|
||||
get() { throw new Error("nope"); },
|
||||
set() { throw new Error("nope"); },
|
||||
deleteProperty() { throw new Error("nope"); },
|
||||
ownKeys() { throw new Error("nope"); },
|
||||
apply() { throw new Error("nope"); },
|
||||
construct() { throw new Error("nope"); },
|
||||
});
|
||||
|
Reference in New Issue
Block a user