question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Feature] `vm.isContext`

See original GitHub issue

Is 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:open
  • Created a year ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
andreubotellacommented, Oct 30, 2022

Could you provide some context on ShadowRealm? Is there an issue / PR about this?

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, vm needs some more support in deno_core (and maybe deno_runtime) than ShadowRealm needs, because you cannot cross objects across the realm boundary with ShadowRealm but you can with vm. This would need a lot of checking that everything is handled correctly, and that certain realm interactions happen properly, that wouldn’t be needed with ShadowRealm.

2reactions
lino-levancommented, Oct 30, 2022

Oh never mind, I found https://github.com/denoland/deno/issues/13239, which is an issue tracking support. Linking this here for future reference.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found