Skip to content

Commit

Permalink
Merge branch 'v0.4'
Browse files Browse the repository at this point in the history
Conflicts:
	deps/libev/wscript
	doc/api/modules.markdown
  • Loading branch information
ry committed Jul 14, 2011
2 parents ab0d881 + 8caf7fd commit 041c983
Show file tree
Hide file tree
Showing 42 changed files with 496 additions and 71 deletions.
14 changes: 13 additions & 1 deletion deps/v8/src/v8natives.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}


// ----------------------------------------------------------------------------


Expand All @@ -176,7 +187,8 @@ function SetupGlobal() {
"isFinite", GlobalIsFinite,
"parseInt", GlobalParseInt,
"parseFloat", GlobalParseFloat,
"eval", GlobalEval
"eval", GlobalEval,
"execScript", GlobalExecScript
));
}

Expand Down
34 changes: 34 additions & 0 deletions deps/v8/test/mjsunit/execScript-case-insensitive.js
Original file line number Diff line number Diff line change
@@ -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);

2 changes: 1 addition & 1 deletion deps/v8/test/mjsunit/function-names.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
33 changes: 33 additions & 0 deletions deps/v8/test/mjsunit/regress/regress-1341167.js
Original file line number Diff line number Diff line change
@@ -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);
3 changes: 3 additions & 0 deletions doc/api/buffers.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
29 changes: 27 additions & 2 deletions doc/api/fs.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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])

Expand Down Expand Up @@ -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`).
Expand Down
9 changes: 9 additions & 0 deletions doc/api/globals.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
41 changes: 27 additions & 14 deletions doc/api/http.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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.

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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) { }`
Expand Down Expand Up @@ -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`.
Expand Down
1 change: 0 additions & 1 deletion doc/api/modules.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion doc/api/stdio.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
Binary file modified doc/favicon.ico
Binary file not shown.
4 changes: 3 additions & 1 deletion doc/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<div id="toc">
<ol>
<li><a href="#download">Download</a></li>
<li><a href="https://github.com/joyent/node/raw/v0.4/ChangeLog">ChangeLog</a></li>
<li><a href="https://github.com/joyent/node/wiki/ChangeLog">ChangeLog</a></li>
<li><a href="#about">About</a></li>
<li><a href="http://nodejs.org/docs/v0.4.9/api">v0.4.9 docs</a></li>
<li><a href="http://nodejs.org/docs/v0.5.0/api">v0.5.0 docs</a></li>
Expand All @@ -33,13 +33,15 @@
<li><a href="http://blog.nodejs.org/">Blog</a></li>
<li><a href="https://github.com/joyent/node/wiki/Community">Community</a></li>
<li><a href="http://chat.nodejs.org/">Demo</a></li>
<li><a href="/logos/">Logos</a></li>
<li><a href="http://jobs.nodejs.org/">Jobs</a></li>
<ol><!-- JOBS --><!-- JOBS --></ol>
</ol>
</div>
<div id="content">

<!-- <h1><a href="http://nodejs.org/">Node</a></h1> -->
<br /><br />
<img id="logo" src="logo.png" alt="node.js"/>

<p id="introduction">
Expand Down
Binary file modified doc/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 041c983

Please sign in to comment.