Skip to content

Commit bc0118e

Browse files
committed
Remove process.compile from docs
1 parent b842fbd commit bc0118e

1 file changed

Lines changed: 0 additions & 26 deletions

File tree

doc/api/process.markdown

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -143,32 +143,6 @@ Changes the current working directory of the process or throws an exception if t
143143
}
144144

145145

146-
### process.compile(code, filename)
147-
148-
Similar to `eval` except that you can specify a `filename` for better
149-
error reporting and the `code` cannot see the local scope. The value of `filename`
150-
will be used as a filename if a stack trace is generated by the compiled code.
151-
152-
Example of using `process.compile` and `eval` to run the same code:
153-
154-
var localVar = 123,
155-
compiled, evaled;
156-
157-
compiled = process.compile('localVar = 1;', 'myfile.js');
158-
console.log('localVar: ' + localVar + ', compiled: ' + compiled);
159-
evaled = eval('localVar = 1;');
160-
console.log('localVar: ' + localVar + ', evaled: ' + evaled);
161-
162-
// localVar: 123, compiled: 1
163-
// localVar: 1, evaled: 1
164-
165-
`process.compile` does not have access to the local scope, so `localVar` is unchanged.
166-
`eval` does have access to the local scope, so `localVar` is changed.
167-
168-
In case of syntax error in `code`, `process.compile` exits node.
169-
170-
See also: `Script`
171-
172146

173147
### process.cwd()
174148

0 commit comments

Comments
 (0)