mirror of
https://github.com/nodejs/node.git
synced 2026-11-26 21:58:26 -05:00
doc: removed unnecessary util imports from vm examples
PR-URL: https://github.com/nodejs/node/pull/33179 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This commit is contained in:
1 parent
903862089b
commit
0cee4c3eae
1 file changed
-5
@@ -160,7 +160,6 @@ the value of another global variable, then execute the code multiple times.
|
||||
The globals are contained in the `context` object.
|
||||
|
||||
```js
|
||||
const util = require('util');
|
||||
const vm = require('vm');
|
||||
|
||||
const context = {
|
||||
@@ -235,7 +234,6 @@ the code multiple times in different contexts. The globals are set on and
|
||||
contained within each individual `context`.
|
||||
|
||||
```js
|
||||
const util = require('util');
|
||||
const vm = require('vm');
|
||||
|
||||
const script = new vm.Script('globalVar = "set"');
|
||||
@@ -791,7 +789,6 @@ properties but also having the built-in objects and functions any standard
|
||||
will remain unchanged.
|
||||
|
||||
```js
|
||||
const util = require('util');
|
||||
const vm = require('vm');
|
||||
|
||||
global.globalVar = 3;
|
||||
@@ -896,7 +893,6 @@ The following example compiles and executes different scripts using a single
|
||||
[contextified][] object:
|
||||
|
||||
```js
|
||||
const util = require('util');
|
||||
const vm = require('vm');
|
||||
|
||||
const contextObject = { globalVar: 1 };
|
||||
@@ -992,7 +988,6 @@ The following example compiles and executes code that increments a global
|
||||
variable and sets a new one. These globals are contained in the `contextObject`.
|
||||
|
||||
```js
|
||||
const util = require('util');
|
||||
const vm = require('vm');
|
||||
|
||||
const contextObject = {
|
||||
|
||||
Reference in new issue
Block a user