[Feature] `vm.isContext`
See original GitHub issueIs your feature request related to a problem? Please describe.
I can’t get jsdom to work.
error: Error: Not implemented: isContext
throw new Error(message);
^
at notImplemented (https://deno.land/std@0.154.0/node/_utils.ts:23:9)
at Object.isContext (https://deno.land/std@0.154.0/node/vm.ts:62:3)
at new Window (file:///home/tom/.cache/deno/npm/registry.npmjs.org/jsdom/20.0.0/lib/jsdom/browser/Window.js:252:10)
at exports.createWindow (file:///home/tom/.cache/deno/npm/registry.npmjs.org/jsdom/20.0.0/lib/jsdom/browser/Window.js:97:10)
at new JSDOM (file:///home/tom/.cache/deno/npm/registry.npmjs.org/jsdom/20.0.0/lib/api.js:36:20)
at file:///home/tom/Code/code9/deno/test-fresh/components/Container.test.tsx:10:36
Describe the solution you’d like
Implement vm.isContext (and probably vm.createContext)
Describe alternatives you’ve considered https://deno.land/manual@v1.25.3/jsx_dom/linkedom https://deno.land/manual@v1.25.3/jsx_dom/deno_dom
Issue Analytics
- State:
- Created a year ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Node.js vm.isContext() Method
The vm.isContext() method is an inbuilt application programming interface of the vm module which is used to check if the stated object is...
Read more >VM (executing JavaScript) | Node.js v19.3.0 Documentation
VM (executing JavaScript). Class: vm. ... isContext(object); vm. ... This feature is only available with the --experimental-vm-modules command flag enabled.
Read more >Vm - node - Read the Docs
This function is useful for creating a sandbox that can be used to run multiple ... vm.isContext(sandbox). Returns whether or not a sandbox...
Read more >JavaScript VM isContext Examples
JavaScript isContext - 9 examples found. These are the top rated real world JavaScript examples of VM.isContext extracted from open source projects.
Read more >Node.js VM Module
Method, Description. createContext(), Prepares a virtual machine, or sandbox, where you can execute scripts. isContext(), Returns true if the specified ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

It’s a JS API proposal that’s currently being worked on: https://github.com/tc39/proposal-shadowrealm
Unlike most new JS APIs that Deno implements automatically because they ship in V8, this one requires some work to support in the internals of Deno. You can follow the work at denoland/deno#13239 (although the work recently had to be rolled back in denoland/deno#16366 because it was blocking certain refactors; it should hopefully be relanded in a couple weeks).
However,
vmneeds some more support indeno_core(and maybedeno_runtime) thanShadowRealmneeds, because you cannot cross objects across the realm boundary withShadowRealmbut you can withvm. This would need a lot of checking that everything is handled correctly, and that certain realm interactions happen properly, that wouldn’t be needed withShadowRealm.Oh never mind, I found https://github.com/denoland/deno/issues/13239, which is an issue tracking support. Linking this here for future reference.