summaryrefslogtreecommitdiff
path: root/doc/api/vm.md
diff options
context:
space:
mode:
Diffstat (limited to 'doc/api/vm.md')
-rw-r--r--doc/api/vm.md28
1 files changed, 28 insertions, 0 deletions
diff --git a/doc/api/vm.md b/doc/api/vm.md
index defa029821..e7aafb9e74 100644
--- a/doc/api/vm.md
+++ b/doc/api/vm.md
@@ -637,6 +637,34 @@ console.log(globalVar);
// 1000
```
+## vm.compileFunction(code[, params[, options]])
+<!-- YAML
+added: REPLACEME
+-->
+* `code` {string} The body of the function to compile.
+* `params` {string[]} An array of strings containing all parameters for the
+ function.
+* `options` {Object}
+ * `filename` {string} Specifies the filename used in stack traces produced
+ by this script. **Default:** `''`.
+ * `lineOffset` {number} Specifies the line number offset that is displayed
+ in stack traces produced by this script. **Default:** `0`.
+ * `columnOffset` {number} Specifies the column number offset that is displayed
+ in stack traces produced by this script. **Default:** `0`.
+ * `cachedData` {Buffer} Provides an optional `Buffer` with V8's code cache
+ data for the supplied source.
+ * `produceCachedData` {boolean} Specifies whether to produce new cache data.
+ **Default:** `false`.
+ * `parsingContext` {Object} The sandbox/context in which the said function
+ should be compiled in.
+ * `contextExtensions` {Object[]} An array containing a collection of context
+ extensions (objects wrapping the current scope) to be applied while
+ compiling. **Default:** `[]`.
+
+Compiles the given code into the provided context/sandbox (if no context is
+supplied, the current context is used), and returns it wrapped inside a
+function with the given `params`.
+
## vm.createContext([sandbox[, options]])
<!-- YAML
added: v0.3.1