mirror of
https://github.com/denoland/deno.git
synced 2024-11-28 16:20: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> |
||
---|---|---|
.. | ||
_libuv_winerror.ts | ||
_listen.ts | ||
_node.ts | ||
_timingSafeEqual.ts | ||
_utils.ts | ||
ares.ts | ||
async_wrap.ts | ||
buffer.ts | ||
cares_wrap.ts | ||
connection_wrap.ts | ||
constants.ts | ||
crypto.ts | ||
handle_wrap.ts | ||
mod.ts | ||
node_file.ts | ||
node_options.ts | ||
pipe_wrap.ts | ||
README.md | ||
stream_wrap.ts | ||
string_decoder.ts | ||
symbols.ts | ||
tcp_wrap.ts | ||
types.ts | ||
udp_wrap.ts | ||
util.ts | ||
uv.ts |
Internal Bindings
The modules in this directory implement (simulate) C++ bindings implemented in
the ./src/
directory of the Node.js
repository.
These bindings are created in the Node.js source code by using
NODE_MODULE_CONTEXT_AWARE_INTERNAL
.
Please refer to https://github.com/nodejs/node/blob/master/src/README.md for further information.