From bc0118e519ac49248efa9a9698f4216cdef1dfbc Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Sat, 13 Nov 2010 15:08:09 -0800 Subject: [PATCH] Remove process.compile from docs --- doc/api/process.markdown | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/doc/api/process.markdown b/doc/api/process.markdown index 53e1b8044f..8e538d58ab 100644 --- a/doc/api/process.markdown +++ b/doc/api/process.markdown @@ -143,32 +143,6 @@ Changes the current working directory of the process or throws an exception if t } -### process.compile(code, filename) - -Similar to `eval` except that you can specify a `filename` for better -error reporting and the `code` cannot see the local scope. The value of `filename` -will be used as a filename if a stack trace is generated by the compiled code. - -Example of using `process.compile` and `eval` to run the same code: - - var localVar = 123, - compiled, evaled; - - compiled = process.compile('localVar = 1;', 'myfile.js'); - console.log('localVar: ' + localVar + ', compiled: ' + compiled); - evaled = eval('localVar = 1;'); - console.log('localVar: ' + localVar + ', evaled: ' + evaled); - - // localVar: 123, compiled: 1 - // localVar: 1, evaled: 1 - -`process.compile` does not have access to the local scope, so `localVar` is unchanged. -`eval` does have access to the local scope, so `localVar` is changed. - -In case of syntax error in `code`, `process.compile` exits node. - -See also: `Script` - ### process.cwd()