mirror of
https://github.com/denoland/deno.git
synced 2024-11-27 16:10:57 -05:00
b2cd254c35
Deno v1.39 introduces `vm.runInNewContext`. This may cause problems when using `Object.prototype.isPrototypeOf` to check built-in types. ```js import vm from "node:vm"; const err = new Error(); const crossErr = vm.runInNewContext(`new Error()`); console.assert( !(crossErr instanceof Error) ); console.assert( Object.getPrototypeOf(err) !== Object.getPrototypeOf(crossErr) ); ``` This PR changes to check using internal slots solves them. --- current: ``` > import vm from "node:vm"; undefined > vm.runInNewContext(`new Error("message")`) Error {} > vm.runInNewContext(`new Date("2018-12-10T02:26:59.002Z")`) Date {} ``` this PR: ``` > import vm from "node:vm"; undefined > vm.runInNewContext(`new Error("message")`) Error: message at <anonymous>:1:1 > vm.runInNewContext(`new Date("2018-12-10T02:26:59.002Z")`) 2018-12-10T02:26:59.002Z ``` --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com> |
||
---|---|---|
.. | ||
01_broadcast_channel.js | ||
Cargo.toml | ||
in_memory_broadcast_channel.rs | ||
lib.deno_broadcast_channel.d.ts | ||
lib.rs | ||
README.md |
deno_broadcast_channel
This crate implements the BroadcastChannel functions of Deno.
Spec: https://html.spec.whatwg.org/multipage/web-messaging.html