diff --git a/deps/v8/src/v8natives.js b/deps/v8/src/v8natives.js
index 0afe231c8cd..95ea731c00d 100644
--- a/deps/v8/src/v8natives.js
+++ b/deps/v8/src/v8natives.js
@@ -157,6 +157,17 @@ function GlobalEval(x) {
}
+// execScript for IE compatibility.
+function GlobalExecScript(expr, lang) {
+ // NOTE: We don't care about the character casing.
+ if (!lang || /javascript/i.test(lang)) {
+ var f = %CompileString(ToString(expr));
+ f.call(%GlobalReceiver(global));
+ }
+ return null;
+}
+
+
// ----------------------------------------------------------------------------
@@ -176,7 +187,8 @@ function SetupGlobal() {
"isFinite", GlobalIsFinite,
"parseInt", GlobalParseInt,
"parseFloat", GlobalParseFloat,
- "eval", GlobalEval
+ "eval", GlobalEval,
+ "execScript", GlobalExecScript
));
}
diff --git a/deps/v8/test/mjsunit/execScript-case-insensitive.js b/deps/v8/test/mjsunit/execScript-case-insensitive.js
new file mode 100644
index 00000000000..468d65747ea
--- /dev/null
+++ b/deps/v8/test/mjsunit/execScript-case-insensitive.js
@@ -0,0 +1,34 @@
+// Copyright 2008 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+var x = 0;
+execScript('x = 1', 'javascript');
+assertEquals(1, x);
+
+execScript('x = 2', 'JavaScript');
+assertEquals(2, x);
+
diff --git a/deps/v8/test/mjsunit/function-names.js b/deps/v8/test/mjsunit/function-names.js
index 5ed0b794e8f..c083f18f5d4 100644
--- a/deps/v8/test/mjsunit/function-names.js
+++ b/deps/v8/test/mjsunit/function-names.js
@@ -128,6 +128,6 @@ var globalFunctions = [
"encodeURI", "encodeURIComponent", "Error", "TypeError",
"RangeError", "SyntaxError", "ReferenceError", "EvalError",
"URIError", "isNaN", "isFinite", "parseInt", "parseFloat",
- "eval"];
+ "eval", "execScript"];
TestFunctionNames(this, globalFunctions);
diff --git a/deps/v8/test/mjsunit/regress/regress-1341167.js b/deps/v8/test/mjsunit/regress/regress-1341167.js
new file mode 100644
index 00000000000..194a7b886a1
--- /dev/null
+++ b/deps/v8/test/mjsunit/regress/regress-1341167.js
@@ -0,0 +1,33 @@
+// Copyright 2008 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Make sure that 'this' is bound to the global object when using
+// execScript.
+
+var result;
+execScript("result = this");
+assertTrue(result === this);
diff --git a/doc/api/buffers.markdown b/doc/api/buffers.markdown
index 616ccf6fb22..ae24855fb60 100644
--- a/doc/api/buffers.markdown
+++ b/doc/api/buffers.markdown
@@ -16,6 +16,9 @@ method. Here are the different string encodings;
* `'ascii'` - for 7 bit ASCII data only. This encoding method is very fast, and will
strip the high bit if set.
+Note that this encoding converts a null character (`'\0'` or `'\u0000'`) into
+`0x20` (character code of a space). If you want to convert a null character
+into `0x00`, you should use `'utf8'`.
* `'utf8'` - Multi byte encoded Unicode characters. Many web pages and other document formats use UTF-8.
diff --git a/doc/api/fs.markdown b/doc/api/fs.markdown
index 7df7ee11583..669b61dc515 100644
--- a/doc/api/fs.markdown
+++ b/doc/api/fs.markdown
@@ -255,8 +255,27 @@ Synchronous close(2).
### fs.open(path, flags, [mode], [callback])
-Asynchronous file open. See open(2). Flags can be 'r', 'r+', 'w', 'w+', 'a',
-or 'a+'. `mode` defaults to 0666. The callback gets two arguments `(err, fd)`.
+Asynchronous file open. See open(2). `flags` can be:
+
+* `'r'` - Open file for reading.
+An exception occurs if the file does not exist.
+
+* `'r+'` - Open file for reading and writing.
+An exception occurs if the file does not exist.
+
+* `'w'` - Open file for writing.
+The file is created (if it does not exist) or truncated (if it exists).
+
+* `'w+'` - Open file for reading and writing.
+The file is created (if it does not exist) or truncated (if it exists).
+
+* `'a'` - Open file for appending.
+The file is created if it does not exist.
+
+* `'a+'` - Open file for reading and appending.
+The file is created if it does not exist.
+
+`mode` defaults to `0666`. The callback gets two arguments `(err, fd)`.
### fs.openSync(path, flags, [mode])
@@ -419,6 +438,12 @@ Objects returned from `fs.stat()` and `fs.lstat()` are of this type.
`ReadStream` is a `Readable Stream`.
+### Event: 'open'
+
+`function (fd) { }`
+
+ `fd` is the file descriptor used by the ReadStream.
+
### fs.createReadStream(path, [options])
Returns a new ReadStream object (See `Readable Stream`).
diff --git a/doc/api/globals.markdown b/doc/api/globals.markdown
index d2678fd8c8e..f5c353b2fb4 100644
--- a/doc/api/globals.markdown
+++ b/doc/api/globals.markdown
@@ -79,6 +79,15 @@ A reference to the current module. In particular
for more information.
`module` isn't actually a global but rather local to each module.
+
+### exports
+
+An object which is shared between all instances of the current module and
+made accessible through `require()`.
+`exports` is the same as the `module.exports` object. See `src/node.js`
+for more information.
+`exports` isn't actually a global but rather local to each module.
+
### setTimeout(cb, ms)
### clearTimeout(t)
### setInterval(cb, ms)
diff --git a/doc/api/http.markdown b/doc/api/http.markdown
index cc99da5399a..7af538513c0 100644
--- a/doc/api/http.markdown
+++ b/doc/api/http.markdown
@@ -52,7 +52,7 @@ per connection (in the case of keep-alive connections).
### Event: 'checkContinue'
-`function (request, response) {}`
+`function (request, response) { }`
Emitted each time a request with an http Expect: 100-continue is received.
If this event isn't listened for, the server will automatically respond
@@ -68,7 +68,7 @@ not be emitted.
### Event: 'upgrade'
-`function (request, socket, head)`
+`function (request, socket, head) { }`
Emitted each time a client requests a http upgrade. If this event isn't
listened for, then clients requesting an upgrade will have their connections
@@ -84,7 +84,7 @@ sent to the server on that socket.
### Event: 'clientError'
-`function (exception) {}`
+`function (exception) { }`
If a client connection emits an 'error' event - it will forwarded here.
@@ -394,6 +394,10 @@ Options:
- `path`: Request path. Should include query string and fragments if any.
E.G. `'/index.html?page=12'`
- `headers`: An object containing request headers.
+- `agent`: Controls `Agent` behavior. Possible values:
+ - `undefined` (default): use default `Agent` for this host and port.
+ - `Agent` object: explicitly use the passed in `Agent`.
+ - `false`: explicitly generate a new `Agent` for this host and port. `Agent` will not be re-used.
`http.request()` returns an instance of the `http.ClientRequest`
class. The `ClientRequest` instance is a writable stream. If one needs to
@@ -483,7 +487,7 @@ Options:
### Event: 'upgrade'
-`function (response, socket, head)`
+`function (response, socket, head) { }`
Emitted each time a server responds to a request with an upgrade. If this
event isn't being listened for, clients receiving an upgrade header will have
@@ -537,14 +541,6 @@ A client server pair that show you how to listen for the `upgrade` event using `
});
-### Event: 'continue'
-
-`function ()`
-
-Emitted when the server sends a '100 Continue' HTTP response, usually because
-the request contained 'Expect: 100-continue'. This is an instruction that
-the client should send the request body.
-
### agent.maxSockets
By default set to 5. Determines how many concurrent sockets the agent can have open.
@@ -600,6 +596,14 @@ This is a `Writable Stream`.
This is an `EventEmitter` with the following events:
+### Event: 'continue'
+
+`function () { }`
+
+Emitted when the server sends a '100 Continue' HTTP response, usually because
+the request contained 'Expect: 100-continue'. This is an instruction that
+the client should send the request body.
+
### Event 'response'
`function (response) { }`
@@ -646,18 +650,27 @@ The response implements the `Readable Stream` interface.
### Event: 'data'
-`function (chunk) {}`
+`function (chunk) { }`
Emitted when a piece of the message body is received.
### Event: 'end'
-`function () {}`
+`function () { }`
Emitted exactly once for each message. No arguments. After
emitted no other events will be emitted on the response.
+### Event: 'close'
+
+`function (err) { }`
+
+Indicates that the underlaying connection was terminated before
+`end` event was emitted.
+See [http.ServerRequest](#http.ServerRequest)'s `'close'` event for more
+information.
+
### response.statusCode
The 3-digit HTTP response status code. E.G. `404`.
diff --git a/doc/api/modules.markdown b/doc/api/modules.markdown
index 9dfa1c486ab..30e06363f56 100644
--- a/doc/api/modules.markdown
+++ b/doc/api/modules.markdown
@@ -318,7 +318,6 @@ Because `module` provides a `filename` property (normally equivalent to
`__filename`), the entry point of the current application can be obtained
by checking `require.main.filename`.
-
## AMD Compatibility
Node's modules have access to a function named `define`, which may be
diff --git a/doc/api/stdio.markdown b/doc/api/stdio.markdown
index a24d0572c63..d4153934e45 100644
--- a/doc/api/stdio.markdown
+++ b/doc/api/stdio.markdown
@@ -35,7 +35,7 @@ Mark a time.
Finish timer, record output. Example
console.time('100-elements');
- while (var i = 0; i < 100; i++) {
+ for (var i = 0; i < 100; i++) {
;
}
console.timeEnd('100-elements');
diff --git a/doc/favicon.ico b/doc/favicon.ico
index 6916dbc03e4..49ac26563f6 100644
Binary files a/doc/favicon.ico and b/doc/favicon.ico differ
diff --git a/doc/index.html b/doc/index.html
index a3e21bcbec6..ba874daf93a 100644
--- a/doc/index.html
+++ b/doc/index.html
@@ -24,7 +24,7 @@
To echo the evolutionary nature of Node, we've added some punch and playfulness to its identity. All it needs now is a good home with you, download and have fun!