Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
doc: document that const c2 = vm.createContext(c1); c1 === c2 is true
- As far as I can tell, the documentation didn't say this, so I was left
  wondering if there is a difference between `c1` and `c2` in `const c2
= vm.createContext(c1);` According to my own tests, they are equivalent.
I thought it was worth documenting as it would've saved me a bit of time
if this information were written down.
  • Loading branch information
DanKaplanSES committed Mar 4, 2024
commit 2b3402ee82c9984df3eafa9a39ad4f5dd68d2b2b
2 changes: 1 addition & 1 deletion doc/api/vm.md
Original file line number Diff line number Diff line change
Expand Up @@ -1118,7 +1118,7 @@ changes:
* Returns: {Object} contextified object.

If given a `contextObject`, the `vm.createContext()` method will [prepare
that object][contextified] so that it can be used in calls to
that object][contextified] and return a reference to it so that it can be used in calls to
[`vm.runInContext()`][] or [`script.runInContext()`][]. Inside such scripts,
the `contextObject` will be the global object, retaining all of its existing
properties but also having the built-in objects and functions any standard
Expand Down