Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2012-01-17 03:20:26 +0400
committerRyan Dahl <ry@tinyclouds.org>2012-01-17 03:20:26 +0400
commitca2a047b8e044e72e0bd8d2200de97ac995b945b (patch)
tree7d6bb421e1e14dbf1e7d68c9057cf99e50a8cd39 /doc
parent7584225873cd27b53f3fdfb6af5c12c6514acdfa (diff)
parent25410096b4c38eb9b17501ea06349872ab33e1ea (diff)
Merge remote branch 'origin/v0.6'
Conflicts: deps/uv/src/win/util.c src/udp_wrap.cc
Diffstat (limited to 'doc')
-rw-r--r--doc/api/vm.markdown34
-rw-r--r--doc/index.html3
-rw-r--r--doc/pipe.css38
3 files changed, 46 insertions, 29 deletions
diff --git a/doc/api/vm.markdown b/doc/api/vm.markdown
index d3e3606ef2f..3d3c1684591 100644
--- a/doc/api/vm.markdown
+++ b/doc/api/vm.markdown
@@ -9,8 +9,9 @@ JavaScript code can be compiled and run immediately or compiled, saved, and run
### vm.runInThisContext(code, [filename])
-`vm.runInThisContext()` compiles `code` as if it were loaded from `filename`,
-runs it and returns the result. Running code does not have access to local scope. `filename` is optional.
+`vm.runInThisContext()` compiles `code`, runs it and returns the result. Running
+code does not have access to local scope. `filename` is optional, it's used only
+in stack traces.
Example of using `vm.runInThisContext` and `eval` to run the same code:
@@ -38,10 +39,10 @@ and throws an exception.
### vm.runInNewContext(code, [sandbox], [filename])
-`vm.runInNewContext` compiles `code` to run in `sandbox` as if it were loaded from `filename`,
-then runs it and returns the result. Running code does not have access to local scope and
-the object `sandbox` will be used as the global object for `code`.
-`sandbox` and `filename` are optional.
+`vm.runInNewContext` compiles `code`, then runs it in `sandbox` and returns the
+result. Running code does not have access to local scope. The object `sandbox`
+will be used as the global object for `code`.
+`sandbox` and `filename` are optional, `filename` is only used in stack traces.
Example: compile and execute code that increments a global variable and sets a new one.
These globals are contained in the sandbox.
@@ -67,11 +68,12 @@ and throws an exception.
### vm.runInContext(code, context, [filename])
-`vm.runInContext` compiles `code` to run in context `context` as if it were loaded from `filename`,
-then runs it and returns the result. A (V8) context comprises a global object, together with a
-set of built-in objects and functions. Running code does not have access to local scope and
-the global object held within `context` will be used as the global object for `code`.
-`filename` is optional.
+`vm.runInContext` compiles `code`, then runs it in `context` and returns the
+result. A (V8) context comprises a global object, together with a set of
+built-in objects and functions. Running code does not have access to local scope
+and the global object held within `context` will be used as the global object
+for `code`.
+`filename` is optional, it's used only in stack traces.
Example: compile and execute code in a existing context.
@@ -107,11 +109,11 @@ to seed the initial contents of the global object used by the context.
### vm.createScript(code, [filename])
-`createScript` compiles `code` as if it were loaded from `filename`,
-but does not run it. Instead, it returns a `vm.Script` object representing this compiled code.
-This script can be run later many times using methods below.
-The returned script is not bound to any global object.
-It is bound before each run, just for that run. `filename` is optional.
+`createScript` compiles `code` but does not run it. Instead, it returns a
+`vm.Script` object representing this compiled code. This script can be run
+later many times using methods below. The returned script is not bound to any
+global object. It is bound before each run, just for that run. `filename` is
+optional, it's only used in stack traces.
In case of syntax error in `code`, `createScript` prints the syntax error to stderr
and throws an exception.
diff --git a/doc/index.html b/doc/index.html
index 151273b2c9a..61f10893d7b 100644
--- a/doc/index.html
+++ b/doc/index.html
@@ -29,7 +29,8 @@
lightweight and efficient, perfect for data-intensive real-time
applications that run across distributed devices.</p>
- <a href="#download" id="downloadbutton">Download</a>
+ <a href="#download" class="button" id="downloadbutton">Download</a>
+ <a href="http://nodejs.org/docs/latest/api/index.html" class="button" id="docsbutton">Docs</a>
</div>
<div id="quotes" class="clearfix">
<h2>Node.js in the Industry</h2>
diff --git a/doc/pipe.css b/doc/pipe.css
index b1ed7584a14..3da6d120a92 100644
--- a/doc/pipe.css
+++ b/doc/pipe.css
@@ -62,22 +62,36 @@ h1 a, h2 a, h3 a, h4 a
font-size: 14px;
}
-#intro #downloadbutton {
- background-color: #8BC84B;
- color: #46483e;
- font-weight: bold;
- font-size: 14px;
- text-transform: uppercase;
- padding: 7px 10px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
- border-radius: 4px;
+#intro .button {
+ font-weight: bold;
+ font-size: 14px;
+ text-transform: uppercase;
+ padding: 7px 10px;
+ -webkit-border-radius: 4px;
+ -moz-border-radius: 4px;
+ border-radius: 4px;
+ margin: 0 5px;
+ color: #46483e;
+}
+
+#intro .button:hover {
+ text-decoration: none;
}
+#intro #downloadbutton {
+ background-color: #8BC84B;
+}
#intro #downloadbutton:hover {
- text-decoration: none;
- background-color: #73a53e;
+ background-color: #73a53e;
+}
+
+#intro #docsbutton {
+ background-color: #d2d8ba;
+}
+
+#intro #docsbutton:hover {
+ background-color: #aab293;
}
#quotes {