-
Notifications
You must be signed in to change notification settings - Fork 29.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vm: Provide a way to replace the underlying global object of the GlobalProxy #31807
Comments
I'm fairly sure this is not a functionality that V8 provides, so there would need to be some upstream work first. |
While this is not something V8 provides,
This means that sandbox would not contain the global environment (you can easily access the What this feature request could do is just expose the function from step 2. V8 also allows for access checks callbacks, security token management and limiting the stack trace to the accessible context and those cannot be used on a sandbox object. For this feature request you would be able to install interfaces either on the prototype of the function from step 2 you still cannot replace the |
The FunctionTemplate in node is an implementation detail. It shouldn't technically even need to exist, it's just the result of V8's very very odd implementation of globals. |
There has been no activity on this feature request for 5 months and it is unlikely to be implemented. It will be closed 6 months after the last non-automated comment. For more information on how the project manages feature requests, please consult the feature request management document. |
Please keep this open. |
There has been no activity on this feature request for 5 months and it is unlikely to be implemented. It will be closed 6 months after the last non-automated comment. For more information on how the project manages feature requests, please consult the feature request management document. |
Please keep open. |
There has been no activity on this feature request for 5 months and it is unlikely to be implemented. It will be closed 6 months after the last non-automated comment. For more information on how the project manages feature requests, please consult the feature request management document. |
keep open |
I'm going to close this because if no one is going to work on it, then there's no point in keeping it open - and bumping it is kind of annoying because that ends up sending emails to lots of people. If you want to see this happen, you'll have to put in the work yourself, starting with V8. |
Is your feature request related to a problem? Please describe.
I’ve been looking into what’s needed to implement proper navigation in JSDOM.
This requires replacing the underlying
[[Window]]
instance of theWindowProxy
.Describe the solution you'd like
The desired solution would be an API exposed on
vm.Context
(#30709) that would perform a newmakeContext
call, replacing the underlying#global
private field and[[Window]]
private slot of theWindowProxy
, while ensuring that the following test passes:globalProxy.test.js
windows.js
(New API is called here)Describe alternatives you've considered
Just replace the
WindowImpl
instance.Viable only for when
runScripts
isn't enabled, though it might be better to use option 3 even in this case.Use
Reflect.deleteProperty
andWebIDLWindow.setup
to try and reset as much of theWindow
global object as possible (won't be able to delete non‑configurable properties, such as thesymbolProp
shown in the above example).I’d rather implement alternative 3.
Implement a custom
WindowProxy
that makes all properties configurable, while keeping track of which ones should be treated as non-configurable.with
and Proxies are currently incompatible (in
operator not working correctly when using Proxy as VM context #30985), this can be worked around usingSymbol.unscopables
.I’ll probably implement this after Refactor Window to use WebIDL2JS jsdom/jsdom#2835 is merged for Node versions without vm: introduce vm.Context #30709.
The text was updated successfully, but these errors were encountered: