mozilla / positron

a experimental, Electron-compatible runtime on top of Gecko
Other
562 stars 64 forks source link

reuse sandbox for main process #94

Closed mykmelez closed 8 years ago

mykmelez commented 8 years ago

This is a partial fix for #45 that coalesces sandboxes for the main process, reusing a single sandbox for all modules loaded in that process, so globals like Object return the expected results in cross-module equality comparisons. In the process, it removes the "duck typing" workaround that we landed in #26.

Sandbox coalescing for renderer processes still doesn't work, and I'm not sure why, but I've described the issue in #93, and this branch continues to use discrete sandboxes for each module loaded in that process.

I also updated some commentary and un-refactored injectModuleGlobals, which is only called at one site, and which is mis-named in any case.

@brendandahl How does this look to you?