Browse Source

Merge remote-tracking branch 'ry/v0.10'

Conflicts:
	src/node.cc
	src/node_version.h
v0.11.0-release
isaacs 12 years ago
parent
commit
97c70a6628
  1. 2
      AUTHORS
  2. 37
      ChangeLog
  3. 21
      deps/npm/doc/cli/disputes.md
  4. 21
      deps/npm/html/doc/disputes.html
  5. 10
      deps/npm/lib/cache.js
  6. 25
      deps/npm/man/man1/disputes.1
  7. 12
      deps/npm/node_modules/lru-cache/README.md
  8. 52
      deps/npm/node_modules/lru-cache/lib/lru-cache.js
  9. 9
      deps/npm/node_modules/lru-cache/package.json
  10. 25
      deps/npm/node_modules/lru-cache/s.js
  11. 28
      deps/npm/node_modules/lru-cache/test/basic.js
  12. 7
      deps/npm/node_modules/node-gyp/addon.gypi
  13. 23
      deps/npm/node_modules/node-gyp/lib/build.js
  14. 13
      deps/npm/node_modules/node-gyp/lib/configure.js
  15. 2
      deps/npm/node_modules/node-gyp/lib/install.js
  16. 1
      deps/npm/node_modules/node-gyp/lib/node-gyp.js
  17. 20
      deps/npm/node_modules/node-gyp/package.json
  18. 13
      deps/npm/node_modules/tar/package.json
  19. 3
      deps/npm/node_modules/tar/test/pack.js
  20. 6
      deps/npm/package.json
  21. 8
      deps/openssl/openssl.gyp
  22. 23
      deps/uv/.mailmap
  23. 26
      deps/uv/AUTHORS
  24. 45
      deps/uv/ChangeLog
  25. 2
      deps/uv/README.md
  26. 2
      deps/uv/config-mingw.mk
  27. 7
      deps/uv/config-unix.mk
  28. 14
      deps/uv/include/uv.h
  29. 10
      deps/uv/src/unix/stream.c
  30. 1
      deps/uv/src/unix/udp.c
  31. 60
      deps/uv/src/version.c
  32. 1
      deps/uv/test/test-udp-send-and-recv.c
  33. 9
      deps/uv/uv.gyp
  34. 4
      doc/api/addons.markdown
  35. 27
      doc/api/child_process.markdown
  36. 2
      doc/api/debugger.markdown
  37. 2
      doc/api/dns.markdown
  38. 170
      doc/api/domain.markdown
  39. 2
      doc/api/http.markdown
  40. 2
      doc/api/tty.markdown
  41. 87
      doc/blog/release/v0.10.2.md
  42. 17
      lib/_stream_readable.js
  43. 5
      lib/domain.js
  44. 7
      lib/timers.js
  45. 26
      lib/tls.js
  46. 54
      src/node.cc
  47. 8
      src/node.js
  48. 5
      src/node_crypto.cc
  49. 39
      test/simple/test-domain-from-timer.js
  50. 106
      test/simple/test-stream-readable-event.js
  51. 68
      test/simple/test-tls-client-abort3.js
  52. 8
      test/simple/test-writedouble.js
  53. 12
      test/simple/test-writefloat.js

2
AUTHORS

@ -429,3 +429,5 @@ Henry Chin <hheennrryy@gmail.com>
Julian Gruber <julian@juliangruber.com> Julian Gruber <julian@juliangruber.com>
JeongHoon Byun <outsideris@gmail.com> JeongHoon Byun <outsideris@gmail.com>
Iskren Ivov Chernev <iskren.chernev@gmail.com> Iskren Ivov Chernev <iskren.chernev@gmail.com>
Alexey Kupershtokh <alexey.kupershtokh@gmail.com>
Benjamin Ruston <benjy.ruston@gmail.com>

37
ChangeLog

@ -1,4 +1,39 @@
2013.03.21, Version 0.10.1 (Stable) 2013.03.28, Version 0.10.2 (Stable)
* npm: Upgrade to 1.2.15
* uv: Upgrade to 0.10.3
* tls: handle SSL_ERROR_ZERO_RETURN (Fedor Indutny)
* tls: handle errors before calling C++ methods (Fedor Indutny)
* tls: remove harmful unnecessary bounds checking (Marcel Laverdet)
* crypto: make getCiphers() return non-SSL ciphers (Ben Noordhuis)
* crypto: check randomBytes() size argument (Ben Noordhuis)
* timers: do not calculate Timeout._when property (Alexey Kupershtokh)
* timers: fix off-by-one ms error (Alexey Kupershtokh)
* timers: handle signed int32 overflow in enroll() (Fedor Indutny)
* stream: Fix stall in Transform under very specific conditions (Gil Pedersen)
* stream: Handle late 'readable' event listeners (isaacs)
* stream: Fix early end in Writables on zero-length writes (isaacs)
* domain: fix domain callback from MakeCallback (Trevor Norris)
* child_process: don't emit same handle twice (Ben Noordhuis)
* child_process: fix sending utf-8 to child process (Ben Noordhuis)
2013.03.21, Version 0.10.1 (Stable), c274d1643589bf104122674a8c3fd147527a667d
* npm: upgrade to 1.2.15 * npm: upgrade to 1.2.15

21
deps/npm/doc/cli/disputes.md

@ -15,9 +15,9 @@ There sometimes arise cases where a user publishes a module, and then
later, some other user wants to use that name. Here are some common later, some other user wants to use that name. Here are some common
ways that happens (each of these is based on actual events.) ways that happens (each of these is based on actual events.)
1. Bob writes a JavaScript module `foo`, which is not node-specific. 1. Joe writes a JavaScript module `foo`, which is not node-specific.
Bob doesn't use node at all. Joe wants to use `foo` in node, so he Joe doesn't use node at all. Bob wants to use `foo` in node, so he
wraps it in an npm module. Some time later, Bob starts using node, wraps it in an npm module. Some time later, Joe starts using node,
and wants to take over management of his program. and wants to take over management of his program.
2. Bob writes an npm module `foo`, and publishes it. Perhaps much 2. Bob writes an npm module `foo`, and publishes it. Perhaps much
later, Joe finds a bug in `foo`, and fixes it. He sends a pull later, Joe finds a bug in `foo`, and fixes it. He sends a pull
@ -49,7 +49,8 @@ Joe's appropriate course of action in each case is the same.
the `foo` package. the `foo` package.
3. After a reasonable amount of time, if Bob has not responded, or if 3. After a reasonable amount of time, if Bob has not responded, or if
Bob and Joe can't come to any sort of resolution, email isaacs Bob and Joe can't come to any sort of resolution, email isaacs
<i@izs.me> and we'll sort it out. <i@izs.me> and we'll sort it out. ("Reasonable" is usually about 4
weeks, but extra time is allowed around common holidays.)
## REASONING ## REASONING
@ -71,17 +72,23 @@ Some things are not allowed, and will be removed without discussion if
they are brought to the attention of the npm registry admins, including they are brought to the attention of the npm registry admins, including
but not limited to: but not limited to:
1. Malware (that is, a module designed to exploit or harm the machine on 1. Malware (that is, a package designed to exploit or harm the machine on
which it is installed) which it is installed).
2. Violations of copyright or licenses (for example, cloning an 2. Violations of copyright or licenses (for example, cloning an
MIT-licensed program, and then removing or changing the copyright and MIT-licensed program, and then removing or changing the copyright and
license statement) license statement).
3. Illegal content. 3. Illegal content.
4. "Squatting" on a package name that you *plan* to use, but aren't 4. "Squatting" on a package name that you *plan* to use, but aren't
actually using. Sorry, I don't care how great the name is, or how actually using. Sorry, I don't care how great the name is, or how
perfect a fit it is for the thing that someday might happen. If perfect a fit it is for the thing that someday might happen. If
someone wants to use it today, and you're just taking up space with someone wants to use it today, and you're just taking up space with
an empty tarball, you're going to be evicted. an empty tarball, you're going to be evicted.
5. Putting empty packages in the registry. Packages must have SOME
functionality. It can be silly, but it can't be *nothing*. (See
also: squatting.)
6. Doing weird things with the registry, like using it as your own
personal application database or otherwise putting non-packagey
things into it.
If you see bad behavior like this, please report it right away. If you see bad behavior like this, please report it right away.

21
deps/npm/html/doc/disputes.html

@ -20,9 +20,9 @@
later, some other user wants to use that name. Here are some common later, some other user wants to use that name. Here are some common
ways that happens (each of these is based on actual events.)</p> ways that happens (each of these is based on actual events.)</p>
<ol><li>Bob writes a JavaScript module <code>foo</code>, which is not node-specific. <ol><li>Joe writes a JavaScript module <code>foo</code>, which is not node-specific.
Bob doesn&#39;t use node at all. Joe wants to use <code>foo</code> in node, so he Joe doesn&#39;t use node at all. Bob wants to use <code>foo</code> in node, so he
wraps it in an npm module. Some time later, Bob starts using node, wraps it in an npm module. Some time later, Joe starts using node,
and wants to take over management of his program.</li><li>Bob writes an npm module <code>foo</code>, and publishes it. Perhaps much and wants to take over management of his program.</li><li>Bob writes an npm module <code>foo</code>, and publishes it. Perhaps much
later, Joe finds a bug in <code>foo</code>, and fixes it. He sends a pull later, Joe finds a bug in <code>foo</code>, and fixes it. He sends a pull
request to Bob, but Bob doesn&#39;t have the time to deal with it, request to Bob, but Bob doesn&#39;t have the time to deal with it,
@ -49,7 +49,8 @@ isaacs <a href="mailto:i@izs.me">i@izs.me</a> to the CC list of the email. Ment
that Bob can run <code>npm owner add joe foo</code> to add Joe as an owner of that Bob can run <code>npm owner add joe foo</code> to add Joe as an owner of
the <code>foo</code> package.</li><li>After a reasonable amount of time, if Bob has not responded, or if the <code>foo</code> package.</li><li>After a reasonable amount of time, if Bob has not responded, or if
Bob and Joe can&#39;t come to any sort of resolution, email isaacs Bob and Joe can&#39;t come to any sort of resolution, email isaacs
<a href="mailto:i@izs.me">i@izs.me</a> and we&#39;ll sort it out.</li></ol> <a href="mailto:i@izs.me">i@izs.me</a> and we&#39;ll sort it out. (&quot;Reasonable&quot; is usually about 4
weeks, but extra time is allowed around common holidays.)</li></ol>
<h2 id="REASONING">REASONING</h2> <h2 id="REASONING">REASONING</h2>
@ -71,14 +72,18 @@ feeling good about the interaction.</p>
they are brought to the attention of the npm registry admins, including they are brought to the attention of the npm registry admins, including
but not limited to:</p> but not limited to:</p>
<ol><li>Malware (that is, a module designed to exploit or harm the machine on <ol><li>Malware (that is, a package designed to exploit or harm the machine on
which it is installed)</li><li>Violations of copyright or licenses (for example, cloning an which it is installed).</li><li>Violations of copyright or licenses (for example, cloning an
MIT-licensed program, and then removing or changing the copyright and MIT-licensed program, and then removing or changing the copyright and
license statement)</li><li>Illegal content.</li><li>&quot;Squatting&quot; on a package name that you <em>plan</em> to use, but aren&#39;t license statement).</li><li>Illegal content.</li><li>&quot;Squatting&quot; on a package name that you <em>plan</em> to use, but aren&#39;t
actually using. Sorry, I don&#39;t care how great the name is, or how actually using. Sorry, I don&#39;t care how great the name is, or how
perfect a fit it is for the thing that someday might happen. If perfect a fit it is for the thing that someday might happen. If
someone wants to use it today, and you&#39;re just taking up space with someone wants to use it today, and you&#39;re just taking up space with
an empty tarball, you&#39;re going to be evicted.</li></ol> an empty tarball, you&#39;re going to be evicted.</li><li>Putting empty packages in the registry. Packages must have SOME
functionality. It can be silly, but it can&#39;t be <em>nothing</em>. (See
also: squatting.)</li><li>Doing weird things with the registry, like using it as your own
personal application database or otherwise putting non-packagey
things into it.</li></ol>
<p>If you see bad behavior like this, please report it right away.</p> <p>If you see bad behavior like this, please report it right away.</p>

10
deps/npm/lib/cache.js

@ -140,6 +140,7 @@ function read (name, ver, forceBypass, cb) {
} }
readJson(jsonFile, function (er, data) { readJson(jsonFile, function (er, data) {
er = needName(er, data)
er = needVersion(er, data) er = needVersion(er, data)
if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er) if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er)
if (er) return addNamed(name, ver, c) if (er) return addNamed(name, ver, c)
@ -722,6 +723,7 @@ function addNameVersion (name, ver, data, cb) {
if (!er) readJson( path.join( npm.cache, name, ver if (!er) readJson( path.join( npm.cache, name, ver
, "package", "package.json" ) , "package", "package.json" )
, function (er, data) { , function (er, data) {
er = needName(er, data)
er = needVersion(er, data) er = needVersion(er, data)
if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er) if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er)
if (er) return fetchit() if (er) return fetchit()
@ -1011,6 +1013,7 @@ function addPlacedTarball_ (p, name, uid, gid, resolvedSum, cb) {
return cb(er) return cb(er)
} }
readJson(path.join(folder, "package.json"), function (er, data) { readJson(path.join(folder, "package.json"), function (er, data) {
er = needName(er, data)
er = needVersion(er, data) er = needVersion(er, data)
if (er) { if (er) {
log.error("addPlacedTarball", "Couldn't read json in %j" log.error("addPlacedTarball", "Couldn't read json in %j"
@ -1057,6 +1060,7 @@ function addLocalDirectory (p, name, shasum, cb) {
if (p.indexOf(npm.cache) === 0) return cb(new Error( if (p.indexOf(npm.cache) === 0) return cb(new Error(
"Adding a cache directory to the cache will make the world implode.")) "Adding a cache directory to the cache will make the world implode."))
readJson(path.join(p, "package.json"), function (er, data) { readJson(path.join(p, "package.json"), function (er, data) {
er = needName(er, data)
er = needVersion(er, data) er = needVersion(er, data)
if (er) return cb(er) if (er) return cb(er)
deprCheck(data) deprCheck(data)
@ -1183,6 +1187,12 @@ function unlock (u, cb) {
lockFile.unlock(lockFileName(u), cb) lockFile.unlock(lockFileName(u), cb)
} }
function needName(er, data) {
return er ? er
: (data && !data.name) ? new Error("No name provided")
: null
}
function needVersion(er, data) { function needVersion(er, data) {
return er ? er return er ? er
: (data && !data.version) ? new Error("No version provided") : (data && !data.version) ? new Error("No version provided")

25
deps/npm/man/man1/disputes.1

@ -28,9 +28,9 @@ later, some other user wants to use that name\. Here are some common
ways that happens (each of these is based on actual events\.) ways that happens (each of these is based on actual events\.)
. .
.IP "1" 4 .IP "1" 4
Bob writes a JavaScript module \fBfoo\fR, which is not node\-specific\. Joe writes a JavaScript module \fBfoo\fR, which is not node\-specific\.
Bob doesn\'t use node at all\. Joe wants to use \fBfoo\fR in node, so he Joe doesn\'t use node at all\. Bob wants to use \fBfoo\fR in node, so he
wraps it in an npm module\. Some time later, Bob starts using node, wraps it in an npm module\. Some time later, Joe starts using node,
and wants to take over management of his program\. and wants to take over management of his program\.
. .
.IP "2" 4 .IP "2" 4
@ -75,7 +75,8 @@ the \fBfoo\fR package\.
. .
.IP "3" 4 .IP "3" 4
After a reasonable amount of time, if Bob has not responded, or if After a reasonable amount of time, if Bob has not responded, or if
Bob and Joe can\'t come to any sort of resolution, email isaacs \fIi@izs\.me\fR and we\'ll sort it out\. Bob and Joe can\'t come to any sort of resolution, email isaacs \fIi@izs\.me\fR and we\'ll sort it out\. ("Reasonable" is usually about 4
weeks, but extra time is allowed around common holidays\.)
. .
.IP "" 0 .IP "" 0
. .
@ -99,13 +100,13 @@ they are brought to the attention of the npm registry admins, including
but not limited to: but not limited to:
. .
.IP "1" 4 .IP "1" 4
Malware (that is, a module designed to exploit or harm the machine on Malware (that is, a package designed to exploit or harm the machine on
which it is installed) which it is installed)\.
. .
.IP "2" 4 .IP "2" 4
Violations of copyright or licenses (for example, cloning an Violations of copyright or licenses (for example, cloning an
MIT\-licensed program, and then removing or changing the copyright and MIT\-licensed program, and then removing or changing the copyright and
license statement) license statement)\.
. .
.IP "3" 4 .IP "3" 4
Illegal content\. Illegal content\.
@ -117,6 +118,16 @@ perfect a fit it is for the thing that someday might happen\. If
someone wants to use it today, and you\'re just taking up space with someone wants to use it today, and you\'re just taking up space with
an empty tarball, you\'re going to be evicted\. an empty tarball, you\'re going to be evicted\.
. .
.IP "5" 4
Putting empty packages in the registry\. Packages must have SOME
functionality\. It can be silly, but it can\'t be \fInothing\fR\|\. (See
also: squatting\.)
.
.IP "6" 4
Doing weird things with the registry, like using it as your own
personal application database or otherwise putting non\-packagey
things into it\.
.
.IP "" 0 .IP "" 0
. .
.P .P

12
deps/npm/node_modules/lru-cache/README.md

@ -26,7 +26,8 @@ away.
## Options ## Options
* `max` The maximum number of items. Not setting this is kind of * `max` The maximum size of the cache, checked by applying the length
function to all values in the cache. Not setting this is kind of
silly, since that's the whole purpose of this lib, but it defaults silly, since that's the whole purpose of this lib, but it defaults
to `Infinity`. to `Infinity`.
* `maxAge` Maximum age in ms. Items are not pro-actively pruned out * `maxAge` Maximum age in ms. Items are not pro-actively pruned out
@ -59,6 +60,15 @@ away.
Both of these will update the "recently used"-ness of the key. Both of these will update the "recently used"-ness of the key.
They do what you think. They do what you think.
* `peek(key)`
Returns the key value (or `undefined` if not found) without
updating the "recently used"-ness of the key.
(If you find yourself using this a lot, you *might* be using the
wrong sort of data structure, but there are some use cases where
it's handy.)
* `del(key)` * `del(key)`
Deletes a key out of the cache. Deletes a key out of the cache.

52
deps/npm/node_modules/lru-cache/lib/lru-cache.js

@ -48,6 +48,7 @@ function LRUCache (options) {
var cache = Object.create(null) // hash of items by key var cache = Object.create(null) // hash of items by key
, lruList = Object.create(null) // list of items in order of use recency , lruList = Object.create(null) // list of items in order of use recency
, mru = 0 // most recently used , mru = 0 // most recently used
, lru = 0 // least recently used
, length = 0 // number of items in the list , length = 0 // number of items in the list
, itemCount = 0 , itemCount = 0
@ -138,6 +139,7 @@ function LRUCache (options) {
} }
cache = {} cache = {}
lruList = {} lruList = {}
lru = 0
mru = 0 mru = 0
length = 0 length = 0
itemCount = 0 itemCount = 0
@ -191,38 +193,54 @@ function LRUCache (options) {
} }
this.get = function (key) { this.get = function (key) {
if (!hOP(cache, key)) return return get(key, true)
}
this.peek = function (key) {
return get(key, false)
}
function get (key, doUse) {
var hit = cache[key] var hit = cache[key]
if (hit) {
if (maxAge && (Date.now() - hit.now > maxAge)) { if (maxAge && (Date.now() - hit.now > maxAge)) {
this.del(key) del(hit)
return allowStale ? hit.value : undefined if (!allowStale) hit = undefined
} else {
if (doUse) use(hit)
}
if (hit) hit = hit.value
} }
delete lruList[hit.lu] return hit
}
function use (hit) {
shiftLU(hit)
hit.lu = mru ++ hit.lu = mru ++
lruList[hit.lu] = hit lruList[hit.lu] = hit
return hit.value
} }
this.del = function (key) { this.del = function (key) {
if (!hOP(cache, key)) return del(cache[key])
var hit = cache[key]
if (dispose) dispose(key, hit.value)
delete cache[key]
delete lruList[hit.lu]
length -= hit.length
itemCount --
} }
function trim () { function trim () {
if (length <= max) return while (lru < mru && length > max)
for (var k in lruList) { del(lruList[lru])
if (length <= max) break; }
var hit = lruList[k]
function shiftLU(hit) {
delete lruList[ hit.lu ]
while (lru < mru && !lruList[lru]) lru ++
}
function del(hit) {
if (hit) {
if (dispose) dispose(hit.key, hit.value) if (dispose) dispose(hit.key, hit.value)
length -= hit.length length -= hit.length
itemCount -- itemCount --
delete cache[ hit.key ] delete cache[ hit.key ]
delete lruList[k] shiftLU(hit)
} }
} }
} }

9
deps/npm/node_modules/lru-cache/package.json

@ -1,7 +1,7 @@
{ {
"name": "lru-cache", "name": "lru-cache",
"description": "A cache object that deletes the least-recently-used items.", "description": "A cache object that deletes the least-recently-used items.",
"version": "2.2.2", "version": "2.3.0",
"author": { "author": {
"name": "Isaac Z. Schlueter", "name": "Isaac Z. Schlueter",
"email": "i@izs.me" "email": "i@izs.me"
@ -15,7 +15,8 @@
"url": "git://github.com/isaacs/node-lru-cache.git" "url": "git://github.com/isaacs/node-lru-cache.git"
}, },
"devDependencies": { "devDependencies": {
"tap": "" "tap": "",
"weak": ""
}, },
"license": { "license": {
"type": "MIT", "type": "MIT",
@ -51,8 +52,8 @@
"email": "jesse.dailey@gmail.com" "email": "jesse.dailey@gmail.com"
} }
], ],
"readme": "# lru cache\n\nA cache object that deletes the least-recently-used items.\n\n## Usage:\n\n```javascript\nvar LRU = require(\"lru-cache\")\n , options = { max: 500\n , length: function (n) { return n * 2 }\n , dispose: function (key, n) { n.close() }\n , maxAge: 1000 * 60 * 60 }\n , cache = LRU(options)\n , otherCache = LRU(50) // sets just the max size\n\ncache.set(\"key\", \"value\")\ncache.get(\"key\") // \"value\"\n\ncache.reset() // empty the cache\n```\n\nIf you put more stuff in it, then items will fall out.\n\nIf you try to put an oversized thing in it, then it'll fall out right\naway.\n\n## Options\n\n* `max` The maximum number of items. Not setting this is kind of\n silly, since that's the whole purpose of this lib, but it defaults\n to `Infinity`.\n* `maxAge` Maximum age in ms. Items are not pro-actively pruned out\n as they age, but if you try to get an item that is too old, it'll\n drop it and return undefined instead of giving it to you.\n* `length` Function that is used to calculate the length of stored\n items. If you're storing strings or buffers, then you probably want\n to do something like `function(n){return n.length}`. The default is\n `function(n){return 1}`, which is fine if you want to store `n`\n like-sized things.\n* `dispose` Function that is called on items when they are dropped\n from the cache. This can be handy if you want to close file\n descriptors or do other cleanup tasks when items are no longer\n accessible. Called with `key, value`. It's called *before*\n actually removing the item from the internal cache, so if you want\n to immediately put it back in, you'll have to do that in a\n `nextTick` or `setTimeout` callback or it won't do anything.\n* `stale` By default, if you set a `maxAge`, it'll only actually pull\n stale items out of the cache when you `get(key)`. (That is, it's\n not pre-emptively doing a `setTimeout` or anything.) If you set\n `stale:true`, it'll return the stale value before deleting it. If\n you don't set this, then it'll return `undefined` when you try to\n get a stale entry, as if it had already been deleted.\n\n## API\n\n* `set(key, value)`\n* `get(key) => value`\n\n Both of these will update the \"recently used\"-ness of the key.\n They do what you think.\n\n* `del(key)`\n\n Deletes a key out of the cache.\n\n* `reset()`\n\n Clear the cache entirely, throwing away all values.\n\n* `has(key)`\n\n Check if a key is in the cache, without updating the recent-ness\n or deleting it for being stale.\n\n* `forEach(function(value,key,cache), [thisp])`\n\n Just like `Array.prototype.forEach`. Iterates over all the keys\n in the cache, in order of recent-ness. (Ie, more recently used\n items are iterated over first.)\n\n* `keys()`\n\n Return an array of the keys in the cache.\n\n* `values()`\n\n Return an array of the values in the cache.\n", "readme": "# lru cache\n\nA cache object that deletes the least-recently-used items.\n\n## Usage:\n\n```javascript\nvar LRU = require(\"lru-cache\")\n , options = { max: 500\n , length: function (n) { return n * 2 }\n , dispose: function (key, n) { n.close() }\n , maxAge: 1000 * 60 * 60 }\n , cache = LRU(options)\n , otherCache = LRU(50) // sets just the max size\n\ncache.set(\"key\", \"value\")\ncache.get(\"key\") // \"value\"\n\ncache.reset() // empty the cache\n```\n\nIf you put more stuff in it, then items will fall out.\n\nIf you try to put an oversized thing in it, then it'll fall out right\naway.\n\n## Options\n\n* `max` The maximum size of the cache, checked by applying the length\n function to all values in the cache. Not setting this is kind of\n silly, since that's the whole purpose of this lib, but it defaults\n to `Infinity`.\n* `maxAge` Maximum age in ms. Items are not pro-actively pruned out\n as they age, but if you try to get an item that is too old, it'll\n drop it and return undefined instead of giving it to you.\n* `length` Function that is used to calculate the length of stored\n items. If you're storing strings or buffers, then you probably want\n to do something like `function(n){return n.length}`. The default is\n `function(n){return 1}`, which is fine if you want to store `n`\n like-sized things.\n* `dispose` Function that is called on items when they are dropped\n from the cache. This can be handy if you want to close file\n descriptors or do other cleanup tasks when items are no longer\n accessible. Called with `key, value`. It's called *before*\n actually removing the item from the internal cache, so if you want\n to immediately put it back in, you'll have to do that in a\n `nextTick` or `setTimeout` callback or it won't do anything.\n* `stale` By default, if you set a `maxAge`, it'll only actually pull\n stale items out of the cache when you `get(key)`. (That is, it's\n not pre-emptively doing a `setTimeout` or anything.) If you set\n `stale:true`, it'll return the stale value before deleting it. If\n you don't set this, then it'll return `undefined` when you try to\n get a stale entry, as if it had already been deleted.\n\n## API\n\n* `set(key, value)`\n* `get(key) => value`\n\n Both of these will update the \"recently used\"-ness of the key.\n They do what you think.\n\n* `peek(key)`\n\n Returns the key value (or `undefined` if not found) without\n updating the \"recently used\"-ness of the key.\n\n (If you find yourself using this a lot, you *might* be using the\n wrong sort of data structure, but there are some use cases where\n it's handy.)\n\n* `del(key)`\n\n Deletes a key out of the cache.\n\n* `reset()`\n\n Clear the cache entirely, throwing away all values.\n\n* `has(key)`\n\n Check if a key is in the cache, without updating the recent-ness\n or deleting it for being stale.\n\n* `forEach(function(value,key,cache), [thisp])`\n\n Just like `Array.prototype.forEach`. Iterates over all the keys\n in the cache, in order of recent-ness. (Ie, more recently used\n items are iterated over first.)\n\n* `keys()`\n\n Return an array of the keys in the cache.\n\n* `values()`\n\n Return an array of the values in the cache.\n",
"readmeFilename": "README.md", "readmeFilename": "README.md",
"_id": "lru-cache@2.2.2", "_id": "lru-cache@2.3.0",
"_from": "lru-cache@latest" "_from": "lru-cache@latest"
} }

25
deps/npm/node_modules/lru-cache/s.js

@ -0,0 +1,25 @@
var LRU = require('lru-cache');
var max = +process.argv[2] || 10240;
var more = 1024;
var cache = LRU({
max: max, maxAge: 86400e3
});
// fill cache
for (var i = 0; i < max; ++i) {
cache.set(i, {});
}
var start = process.hrtime();
// adding more items
for ( ; i < max+more; ++i) {
cache.set(i, {});
}
var end = process.hrtime(start);
var msecs = end[0] * 1E3 + end[1] / 1E6;
console.log('adding %d items took %d ms', more, msecs.toPrecision(5));

28
deps/npm/node_modules/lru-cache/test/basic.js

@ -299,3 +299,31 @@ test("stale", function(t) {
t.end() t.end()
}, 15) }, 15)
}) })
test("lru update via set", function(t) {
var cache = LRU({ max: 2 });
cache.set('foo', 1);
cache.set('bar', 2);
cache.del('bar');
cache.set('baz', 3);
cache.set('qux', 4);
t.equal(cache.get('foo'), undefined)
t.equal(cache.get('bar'), undefined)
t.equal(cache.get('baz'), 3)
t.equal(cache.get('qux'), 4)
t.end()
})
test("least recently set w/ peek", function (t) {
var cache = new LRU(2)
cache.set("a", "A")
cache.set("b", "B")
t.equal(cache.peek("a"), "A")
cache.set("c", "C")
t.equal(cache.get("c"), "C")
t.equal(cache.get("b"), "B")
t.equal(cache.get("a"), undefined)
t.end()
})

7
deps/npm/node_modules/node-gyp/addon.gypi

@ -12,7 +12,12 @@
['_type=="loadable_module"', { ['_type=="loadable_module"', {
'product_extension': 'node', 'product_extension': 'node',
'defines': [ 'BUILDING_NODE_EXTENSION' ], 'defines': [ 'BUILDING_NODE_EXTENSION' ],
}] }],
['_type=="static_library"', {
# set to `1` to *disable* the -T thin archive 'ld' flag.
# older linkers don't support this flag.
'standalone_static_library': '<(standalone_static_library)'
}],
], ],
'conditions': [ 'conditions': [

23
deps/npm/node_modules/node-gyp/lib/build.js

@ -119,22 +119,33 @@ function build (gyp, argv, callback) {
function findMsbuild () { function findMsbuild () {
log.verbose('could not find "msbuild.exe" in PATH - finding location in registry') log.verbose('could not find "msbuild.exe" in PATH - finding location in registry')
var notfoundErr = new Error('Can\'t find "msbuild.exe". Do you have Microsoft Visual Studio C++ 2008+ installed?') var notfoundErr = new Error('Can\'t find "msbuild.exe". Do you have Microsoft Visual Studio C++ 2008+ installed?')
exec('reg query "HKLM\\Software\\Microsoft\\MSBuild\\ToolsVersions" /s', function (err, stdout, stderr) { var cmd = 'reg query "HKLM\\Software\\Microsoft\\MSBuild\\ToolsVersions" /s'
var reVers = /Software\\Microsoft\\MSBuild\\ToolsVersions\\([^\r]+)\r\n\s+MSBuildToolsPath\s+REG_SZ\s+([^\r]+)/gi if (process.arch !== 'ia32')
cmd += ' /reg:32'
exec(cmd, function (err, stdout, stderr) {
var reVers = /ToolsVersions\\([^\\]+)$/i
, rePath = /\r\n[ \t]+MSBuildToolsPath[ \t]+REG_SZ[ \t]+([^\r]+)/i
, msbuilds = [] , msbuilds = []
, r , r
, msbuildPath , msbuildPath
if (err) { if (err) {
return callback(notfoundErr) return callback(notfoundErr)
} }
while (r = reVers.exec(stdout)) { stdout.split('\r\n\r\n').forEach(function(l) {
if (parseFloat(r[1], 10) >= 3.5) { if (!l) return
l = l.trim()
if (r = reVers.exec(l.substring(0, l.indexOf('\r\n')))) {
var ver = parseFloat(r[1], 10)
if (ver >= 3.5) {
if (r = rePath.exec(l)) {
msbuilds.push({ msbuilds.push({
version: parseFloat(r[1], 10), version: ver,
path: r[2] path: r[1]
}) })
} }
} }
}
})
msbuilds.sort(function (x, y) { msbuilds.sort(function (x, y) {
return (x.version < y.version ? -1 : 1) return (x.version < y.version ? -1 : 1)
}) })

13
deps/npm/node_modules/node-gyp/lib/configure.js

@ -14,7 +14,6 @@ var fs = require('graceful-fs')
, semver = require('semver') , semver = require('semver')
, mkdirp = require('mkdirp') , mkdirp = require('mkdirp')
, cp = require('child_process') , cp = require('child_process')
, exec = cp.exec
, spawn = cp.spawn , spawn = cp.spawn
, execFile = cp.execFile , execFile = cp.execFile
, win = process.platform == 'win32' , win = process.platform == 'win32'
@ -91,7 +90,8 @@ function configure (gyp, argv, callback) {
} }
function checkPythonVersion () { function checkPythonVersion () {
execFile(python, ['-c', 'import platform; print(platform.python_version());'], function (err, stdout) { var env = { TERM: 'dumb', PATH: process.env.PATH };
execFile(python, ['-c', 'import platform; print(platform.python_version());'], { env: env }, function (err, stdout) {
if (err) { if (err) {
return callback(err) return callback(err)
} }
@ -166,11 +166,7 @@ function configure (gyp, argv, callback) {
var cp = spawn('cmd', ['/C', '%WINDIR%\\SysWOW64\\reg', 'query', 'HKLM\\Software\\Microsoft\\VCExpress\\10.0\\Setup\\VC', '/v', 'ProductDir']) var cp = spawn('cmd', ['/C', '%WINDIR%\\SysWOW64\\reg', 'query', 'HKLM\\Software\\Microsoft\\VCExpress\\10.0\\Setup\\VC', '/v', 'ProductDir'])
cp.on('exit', function (code) { cp.on('exit', function (code) {
hasVCExpress = (code === 0) hasVCExpress = (code === 0)
if (code !== 0) {
checkVC2012Express(cb) checkVC2012Express(cb)
} else {
cb()
}
}) })
} }
@ -180,7 +176,7 @@ function configure (gyp, argv, callback) {
if (code !== 0) { if (code !== 0) {
checkVCExpress64(cb) checkVCExpress64(cb)
} else { } else {
cb() checkVC2012Express(cb)
} }
}) })
} }
@ -291,6 +287,9 @@ function configure (gyp, argv, callback) {
// don't copy dev libraries with nodedir option // don't copy dev libraries with nodedir option
variables.copy_dev_lib = !gyp.opts.nodedir variables.copy_dev_lib = !gyp.opts.nodedir
// disable -T "thin" static archives by default
variables.standalone_static_library = gyp.opts.thin ? 0 : 1;
// loop through the rest of the opts and add the unknown ones as variables. // loop through the rest of the opts and add the unknown ones as variables.
// this allows for module-specific configure flags like: // this allows for module-specific configure flags like:
// //

2
deps/npm/node_modules/node-gyp/lib/install.js

@ -38,7 +38,7 @@ function install (gyp, argv, callback) {
} }
} }
var distUrl = gyp.opts['dist-url'] || 'http://nodejs.org/dist' var distUrl = gyp.opts['dist-url'] || gyp.opts.disturl || 'http://nodejs.org/dist'
// Determine which node dev files version we are installing // Determine which node dev files version we are installing

1
deps/npm/node_modules/node-gyp/lib/node-gyp.js

@ -86,6 +86,7 @@ proto.configDefs = {
, python: String // 'configure' , python: String // 'configure'
, 'dist-url': String // 'install' , 'dist-url': String // 'install'
, jobs: String // 'build' , jobs: String // 'build'
, thin: String // 'configure'
} }
/** /**

20
deps/npm/node_modules/node-gyp/package.json

File diff suppressed because one or more lines are too long

13
deps/npm/node_modules/tar/package.json

@ -6,7 +6,7 @@
}, },
"name": "tar", "name": "tar",
"description": "tar for node", "description": "tar for node",
"version": "0.1.16", "version": "0.1.17",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git://github.com/isaacs/node-tar.git" "url": "git://github.com/isaacs/node-tar.git"
@ -15,9 +15,6 @@
"scripts": { "scripts": {
"test": "tap test/*.js" "test": "tap test/*.js"
}, },
"engines": {
"node": "~0.5.9 || 0.6 || 0.7 || 0.8"
},
"dependencies": { "dependencies": {
"inherits": "1.x", "inherits": "1.x",
"block-stream": "*", "block-stream": "*",
@ -30,6 +27,10 @@
"license": "BSD", "license": "BSD",
"readme": "# node-tar\n\nTar for Node.js.\n\n## Goals of this project\n\n1. Be able to parse and reasonably extract the contents of any tar file\n created by any program that creates tar files, period.\n\n At least, this includes every version of:\n\n * bsdtar\n * gnutar\n * solaris posix tar\n * Joerg Schilling's star (\"Schilly tar\")\n\n2. Create tar files that can be extracted by any of the following tar\n programs:\n\n * bsdtar/libarchive version 2.6.2\n * gnutar 1.15 and above\n * SunOS Posix tar\n * Joerg Schilling's star (\"Schilly tar\")\n\n3. 100% test coverage. Speed is important. Correctness is slightly\n more important.\n\n4. Create the kind of tar interface that Node users would want to use.\n\n5. Satisfy npm's needs for a portable tar implementation with a\n JavaScript interface.\n\n6. No excuses. No complaining. No tolerance for failure.\n\n## But isn't there already a tar.js?\n\nYes, there are a few. This one is going to be better, and it will be\nfanatically maintained, because npm will depend on it.\n\nThat's why I need to write it from scratch. Creating and extracting\ntarballs is such a large part of what npm does, I simply can't have it\nbe a black box any longer.\n\n## Didn't you have something already? Where'd it go?\n\nIt's in the \"old\" folder. It's not functional. Don't use it.\n\nIt was a useful exploration to learn the issues involved, but like most\nsoftware of any reasonable complexity, node-tar won't be useful until\nit's been written at least 3 times.\n", "readme": "# node-tar\n\nTar for Node.js.\n\n## Goals of this project\n\n1. Be able to parse and reasonably extract the contents of any tar file\n created by any program that creates tar files, period.\n\n At least, this includes every version of:\n\n * bsdtar\n * gnutar\n * solaris posix tar\n * Joerg Schilling's star (\"Schilly tar\")\n\n2. Create tar files that can be extracted by any of the following tar\n programs:\n\n * bsdtar/libarchive version 2.6.2\n * gnutar 1.15 and above\n * SunOS Posix tar\n * Joerg Schilling's star (\"Schilly tar\")\n\n3. 100% test coverage. Speed is important. Correctness is slightly\n more important.\n\n4. Create the kind of tar interface that Node users would want to use.\n\n5. Satisfy npm's needs for a portable tar implementation with a\n JavaScript interface.\n\n6. No excuses. No complaining. No tolerance for failure.\n\n## But isn't there already a tar.js?\n\nYes, there are a few. This one is going to be better, and it will be\nfanatically maintained, because npm will depend on it.\n\nThat's why I need to write it from scratch. Creating and extracting\ntarballs is such a large part of what npm does, I simply can't have it\nbe a black box any longer.\n\n## Didn't you have something already? Where'd it go?\n\nIt's in the \"old\" folder. It's not functional. Don't use it.\n\nIt was a useful exploration to learn the issues involved, but like most\nsoftware of any reasonable complexity, node-tar won't be useful until\nit's been written at least 3 times.\n",
"readmeFilename": "README.md", "readmeFilename": "README.md",
"_id": "tar@0.1.16", "_id": "tar@0.1.17",
"_from": "tar@~0.1.12" "dist": {
"shasum": "408c8a95deb8e78a65b59b1a51a333183a32badc"
},
"_from": "tar@0.1.17",
"_resolved": "https://registry.npmjs.org/tar/-/tar-0.1.17.tgz"
} }

3
deps/npm/node_modules/tar/test/pack.js

@ -50,8 +50,7 @@ var tap = require("tap")
"NODETAR.repository.type": pkg.repository.type, "NODETAR.repository.type": pkg.repository.type,
"NODETAR.repository.url": pkg.repository.url, "NODETAR.repository.url": pkg.repository.url,
"NODETAR.main": pkg.main, "NODETAR.main": pkg.main,
"NODETAR.scripts.test": pkg.scripts.test, "NODETAR.scripts.test": pkg.scripts.test } ]
"NODETAR.engines.node": pkg.engines.node } ]
, [ 'entry', , [ 'entry',
{ path: 'fixtures/', { path: 'fixtures/',

6
deps/npm/package.json

@ -44,14 +44,14 @@
"rimraf": "2", "rimraf": "2",
"request": "~2.9", "request": "~2.9",
"which": "1", "which": "1",
"tar": "~0.1.12", "tar": "~0.1.17",
"fstream": "~0.1.22", "fstream": "~0.1.22",
"block-stream": "*", "block-stream": "*",
"inherits": "1", "inherits": "1",
"mkdirp": "~0.3.3", "mkdirp": "~0.3.3",
"read": "~1.0.4", "read": "~1.0.4",
"lru-cache": "~2.2.2", "lru-cache": "~2.3.0",
"node-gyp": "~0.8.5", "node-gyp": "~0.9.3",
"fstream-npm": "~0.1.3", "fstream-npm": "~0.1.3",
"uid-number": "0", "uid-number": "0",
"archy": "0", "archy": "0",

8
deps/openssl/openssl.gyp

@ -16,7 +16,13 @@
# No clue what these are for. # No clue what these are for.
'L_ENDIAN', 'L_ENDIAN',
'PURIFY', 'PURIFY',
'_REENTRANT' '_REENTRANT',
# Heartbeat is a TLS extension, that couldn't be turned off or
# asked to be not advertised. Unfortunately this is unacceptable for
# Microsoft's IIS, which seems to be ignoring whole ClientHello after
# seeing this extension.
'OPENSSL_NO_HEARTBEATS',
], ],
'sources': [ 'sources': [
'openssl/ssl/bio_ssl.c', 'openssl/ssl/bio_ssl.c',

23
deps/uv/.mailmap

@ -1,13 +1,16 @@
# update AUTHORS with: Alan Gutierrez <alan@prettyrobots.com> <alan@blogometer.com>
# git log --all --reverse --format='%aN <%aE>' | perl -ne 'BEGIN{print "# Authors ordered by first contribution.\n"} print unless $h{$_}; $h{$_} = 1' > AUTHORS Bert Belder <bertbelder@gmail.com> <info@2bs.nl>
<rm@joyent.com> <rm@fingolfin.org> Bert Belder <bertbelder@gmail.com> <user@ChrUbuntu.(none)>
<ryan@joyent.com> <ry@tinyclouds.org> Brandon Philips <brandon.philips@rackspace.com> <brandon@ifup.org>
<bertbelder@gmail.com> <info@2bs.nl> Brian White <mscdex@mscdex.net> <mscdex@gmail.com>
<alan@prettyrobots.com> <alan@blogometer.com>
San-Tai Hsu <vanilla@fatpipi.com>
Isaac Z. Schlueter <i@izs.me>
Saúl Ibarra Corretgé <saghul@gmail.com>
Yuki OKUMURA <mjt@cltn.org>
Frank Denis <github@pureftpd.org> Frank Denis <github@pureftpd.org>
Isaac Z. Schlueter <i@izs.me>
Robert Mustacchi <rm@joyent.com> <rm@fingolfin.org>
Ryan Dahl <ryan@joyent.com> <ry@tinyclouds.org>
Ryan Emery <seebees@gmail.com> Ryan Emery <seebees@gmail.com>
San-Tai Hsu <vanilla@fatpipi.com>
Saúl Ibarra Corretgé <saghul@gmail.com>
Shigeki Ohtsu <ohtsu@iij.ad.jp> <ohtsu@ohtsu.org>
Timothy J. Fontaine <tjfontaine@gmail.com>
Yasuhiro Matsumoto <mattn.jp@gmail.com> Yasuhiro Matsumoto <mattn.jp@gmail.com>
Yuki Okumura <mjt@cltn.org>

26
deps/uv/AUTHORS

@ -28,7 +28,7 @@ Marek Jelen <marek@jelen.biz>
Fedor Indutny <fedor.indutny@gmail.com> Fedor Indutny <fedor.indutny@gmail.com>
Saúl Ibarra Corretgé <saghul@gmail.com> Saúl Ibarra Corretgé <saghul@gmail.com>
Felix Geisendörfer <felix@debuggable.com> Felix Geisendörfer <felix@debuggable.com>
Yuki OKUMURA <mjt@cltn.org> Yuki Okumura <mjt@cltn.org>
Roman Shtylman <shtylman@gmail.com> Roman Shtylman <shtylman@gmail.com>
Frank Denis <github@pureftpd.org> Frank Denis <github@pureftpd.org>
Carter Allen <CarterA@opt-6.com> Carter Allen <CarterA@opt-6.com>
@ -44,7 +44,6 @@ Dan VerWeire <dverweire@gmail.com>
Brandon Benvie <brandon@bbenvie.com> Brandon Benvie <brandon@bbenvie.com>
Brandon Philips <brandon.philips@rackspace.com> Brandon Philips <brandon.philips@rackspace.com>
Nathan Rajlich <nathan@tootallnate.net> Nathan Rajlich <nathan@tootallnate.net>
Brandon Philips <brandon@ifup.org>
Charlie McConnell <charlie@charlieistheman.com> Charlie McConnell <charlie@charlieistheman.com>
Vladimir Dronnikov <dronnikov@gmail.com> Vladimir Dronnikov <dronnikov@gmail.com>
Aaron Bieber <qbit@deftly.net> Aaron Bieber <qbit@deftly.net>
@ -54,8 +53,29 @@ Erik Dubbelboer <erik@dubbelboer.com>
Keno Fischer <kenof@stanford.edu> Keno Fischer <kenof@stanford.edu>
Ira Cooper <Ira.Cooper@mathworks.com> Ira Cooper <Ira.Cooper@mathworks.com>
Andrius Bentkus <andrius.bentkus@gmail.com> Andrius Bentkus <andrius.bentkus@gmail.com>
Brian White <mscdex@gmail.com>
Iñaki Baz Castillo <ibc@aliax.net> Iñaki Baz Castillo <ibc@aliax.net>
Mark Cavage <mark.cavage@joyent.com> Mark Cavage <mark.cavage@joyent.com>
George Yohng <georgegh@oss3d.com> George Yohng <georgegh@oss3d.com>
Xidorn Quan <quanxunzhen@gmail.com> Xidorn Quan <quanxunzhen@gmail.com>
Roman Neuhauser <rneuhauser@suse.cz>
Shuhei Tanuma <shuhei.tanuma@gmail.com>
Bryan Cantrill <bcantrill@acm.org>
Trond Norbye <trond.norbye@gmail.com>
Tim Holy <holy@wustl.edu>
Prancesco Pertugio <meh@schizofreni.co>
Leonard Hecker <leonard.hecker91@gmail.com>
Andrew Paprocki <andrew@ishiboo.com>
Luigi Grilli <luigi.grilli@gmail.com>
Shannen Saez <shannenlaptop@gmail.com>
Artur Adib <arturadib@gmail.com>
Hiroaki Nakamura <hnakamur@gmail.com>
Ting-Yu Lin <ph.minamo@cytisan.com>
Stephen Gallagher <sgallagh@redhat.com>
Shane Holloway <shane.holloway@ieee.org>
Andrew Shaffer <darawk@gmail.com>
Vlad Tudose <vlad.tudose@intel.com>
Ben Leslie <benno@benno.id.au>
Tim Bradshaw <tfb@cley.com>
Timothy J. Fontaine <tjfontaine@gmail.com>
Marc Schlaich <marc.schlaich@googlemail.com>
Brian Mazza <louseman@gmail.com>

45
deps/uv/ChangeLog

@ -0,0 +1,45 @@
2013.02.04, Version 0.10.3 (Stable)
Changes since version 0.10.2:
* include: remove extraneous const from uv_version() (Ben Noordhuis)
* doc: update README, replace `OS` by `PLATFORM` (Ben Noordhuis)
* build: simplify .buildstamp rule (Ben Noordhuis)
* build: disable -Wstrict-aliasing on darwin (Ben Noordhuis)
* darwin: don't select(&exceptfds) in fallback path (Ben Noordhuis)
* unix: don't clear flags after closing UDP handle (Saúl Ibarra Corretgé)
2013.03.25, Version 0.10.2 (Stable)
This is the first officially versioned release of libuv. Starting now
libuv will make releases independently of Node.js.
Changes since Node.js v0.10.0:
* test: add tap output for windows (Timothy J. Fontaine)
* unix: fix uv_tcp_simultaneous_accepts() logic (Ben Noordhuis)
* include: bump UV_VERSION_MINOR (Ben Noordhuis)
* unix: improve uv_guess_handle() implementation (Ben Noordhuis)
* stream: run try_select only for pipes and ttys (Fedor Indutny)
Changes since Node.js v0.10.1:
* build: rename OS to PLATFORM (Ben Noordhuis)
* unix: make uv_timer_init() initialize repeat (Brian Mazza)
* unix: make timers handle large timeouts (Ben Noordhuis)
* build: add OBJC makefile var (Ben Noordhuis)
* Add `uv_version()` and `uv_version_string()` APIs (Bert Belder)

2
deps/uv/README.md

@ -64,7 +64,7 @@ To build via Makefile simply execute:
MinGW users should run this instead: MinGW users should run this instead:
make OS=mingw make PLATFORM=mingw
Out-of-tree builds are supported: Out-of-tree builds are supported:

2
deps/uv/config-mingw.mk

@ -35,7 +35,7 @@ RUNNER_LDFLAGS=$(LDFLAGS)
RUNNER_LIBS=-lws2_32 -lpsapi -liphlpapi RUNNER_LIBS=-lws2_32 -lpsapi -liphlpapi
RUNNER_SRC=test/runner-win.c RUNNER_SRC=test/runner-win.c
libuv.a: $(WIN_OBJS) src/fs-poll.o src/inet.o src/uv-common.o libuv.a: $(WIN_OBJS) src/fs-poll.o src/inet.o src/uv-common.o src/version.o
$(AR) rcs $@ $^ $(AR) rcs $@ $^
src/%.o: src/%.c include/uv.h include/uv-private/uv-win.h src/%.o: src/%.c include/uv.h include/uv-private/uv-win.h

7
deps/uv/config-unix.mk

@ -18,6 +18,8 @@
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE. # IN THE SOFTWARE.
OBJC ?= $(CC)
E= E=
CSTDFLAG=--std=c89 -pedantic -Wall -Wextra -Wno-unused-parameter CSTDFLAG=--std=c89 -pedantic -Wall -Wextra -Wno-unused-parameter
CFLAGS += -g CFLAGS += -g
@ -53,6 +55,7 @@ OBJS += src/unix/udp.o
OBJS += src/fs-poll.o OBJS += src/fs-poll.o
OBJS += src/uv-common.o OBJS += src/uv-common.o
OBJS += src/inet.o OBJS += src/inet.o
OBJS += src/version.o
ifeq (sunos,$(PLATFORM)) ifeq (sunos,$(PLATFORM))
CPPFLAGS += -D__EXTENSIONS__ -D_XOPEN_SOURCE=500 CPPFLAGS += -D__EXTENSIONS__ -D_XOPEN_SOURCE=500
@ -145,7 +148,7 @@ include/uv-private/uv-unix.h: \
src/unix/internal.h: src/unix/linux-syscalls.h src/unix/internal.h: src/unix/linux-syscalls.h
src/.buildstamp src/unix/.buildstamp test/.buildstamp: src/.buildstamp src/unix/.buildstamp test/.buildstamp:
mkdir -p $(dir $@) mkdir -p $(@D)
touch $@ touch $@
src/unix/%.o src/unix/%.pic.o: src/unix/%.c include/uv.h include/uv-private/uv-unix.h src/unix/internal.h src/unix/.buildstamp src/unix/%.o src/unix/%.pic.o: src/unix/%.c include/uv.h include/uv-private/uv-unix.h src/unix/internal.h src/unix/.buildstamp
@ -161,4 +164,4 @@ clean-platform:
$(RM) test/run-{tests,benchmarks}.dSYM $(OBJS) $(OBJS:%.o=%.pic.o) $(RM) test/run-{tests,benchmarks}.dSYM $(OBJS) $(OBJS:%.o=%.pic.o)
%.pic.o %.o: %.m %.pic.o %.o: %.m
$(CC) $(CPPFLAGS) $(CFLAGS) -c $^ -o $@ $(OBJC) $(CPPFLAGS) $(CFLAGS) -c $^ -o $@

14
deps/uv/include/uv.h

@ -228,6 +228,20 @@ typedef enum {
} uv_run_mode; } uv_run_mode;
/*
* Returns the libuv version packed into a single integer. 8 bits are used for
* each component, with the patch number stored in the 8 least significant
* bits. E.g. for libuv 1.2.3 this would return 0x010203.
*/
UV_EXTERN unsigned int uv_version(void);
/*
* Returns the libuv version number as a string. For non-release versions
* "-pre" is appended, so the version number could be "1.2.3-pre".
*/
UV_EXTERN const char* uv_version_string(void);
/* /*
* This function must be called before any other functions in libuv. * This function must be called before any other functions in libuv.
* *

10
deps/uv/src/unix/stream.c

@ -131,7 +131,6 @@ static void uv__stream_osx_select(void* arg) {
char buf[1024]; char buf[1024];
fd_set sread; fd_set sread;
fd_set swrite; fd_set swrite;
fd_set serror;
int events; int events;
int fd; int fd;
int r; int r;
@ -154,17 +153,15 @@ static void uv__stream_osx_select(void* arg) {
/* Watch fd using select(2) */ /* Watch fd using select(2) */
FD_ZERO(&sread); FD_ZERO(&sread);
FD_ZERO(&swrite); FD_ZERO(&swrite);
FD_ZERO(&serror);
if (uv_is_readable(stream)) if (uv_is_readable(stream))
FD_SET(fd, &sread); FD_SET(fd, &sread);
if (uv_is_writable(stream)) if (uv_is_writable(stream))
FD_SET(fd, &swrite); FD_SET(fd, &swrite);
FD_SET(fd, &serror);
FD_SET(s->int_fd, &sread); FD_SET(s->int_fd, &sread);
/* Wait indefinitely for fd events */ /* Wait indefinitely for fd events */
r = select(max_fd + 1, &sread, &swrite, &serror, NULL); r = select(max_fd + 1, &sread, &swrite, NULL, NULL);
if (r == -1) { if (r == -1) {
if (errno == EINTR) if (errno == EINTR)
continue; continue;
@ -203,8 +200,6 @@ static void uv__stream_osx_select(void* arg) {
events |= UV__POLLIN; events |= UV__POLLIN;
if (FD_ISSET(fd, &swrite)) if (FD_ISSET(fd, &swrite))
events |= UV__POLLOUT; events |= UV__POLLOUT;
if (FD_ISSET(fd, &serror))
events |= UV__POLLERR;
uv_mutex_lock(&s->mutex); uv_mutex_lock(&s->mutex);
s->events |= events; s->events |= events;
@ -249,7 +244,8 @@ static void uv__stream_osx_select_cb(uv_async_t* handle, int status) {
s->events = 0; s->events = 0;
uv_mutex_unlock(&s->mutex); uv_mutex_unlock(&s->mutex);
assert(0 == (events & UV__POLLERR)); assert(events != 0);
assert(events == (events & (UV__POLLIN | UV__POLLOUT)));
/* Invoke callback on event-loop */ /* Invoke callback on event-loop */
if ((events & UV__POLLIN) && uv__io_active(&stream->io_watcher, UV__POLLIN)) if ((events & UV__POLLIN) && uv__io_active(&stream->io_watcher, UV__POLLIN))

1
deps/uv/src/unix/udp.c

@ -79,7 +79,6 @@ void uv__udp_finish_close(uv_udp_t* handle) {
} }
/* Now tear down the handle. */ /* Now tear down the handle. */
handle->flags = 0;
handle->recv_cb = NULL; handle->recv_cb = NULL;
handle->alloc_cb = NULL; handle->alloc_cb = NULL;
/* but _do not_ touch close_cb */ /* but _do not_ touch close_cb */

60
deps/uv/src/version.c

@ -0,0 +1,60 @@
/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/
/*
* Versions with an even minor version (e.g. 0.6.1 or 1.0.4) are API and ABI
* stable. When the minor version is odd, the API can change between patch
* releases.
*/
#define UV_VERSION_MAJOR 0
#define UV_VERSION_MINOR 10
#define UV_VERSION_PATCH 3
#define UV_VERSION_IS_RELEASE 1
#define UV_VERSION ((UV_VERSION_MAJOR << 16) | \
(UV_VERSION_MINOR << 8) | \
(UV_VERSION_PATCH))
#define UV_STRINGIFY(v) UV_STRINGIFY_HELPER(v)
#define UV_STRINGIFY_HELPER(v) #v
#define UV_VERSION_STRING_BASE UV_STRINGIFY(UV_VERSION_MAJOR) "." \
UV_STRINGIFY(UV_VERSION_MINOR) "." \
UV_STRINGIFY(UV_VERSION_PATCH)
#if UV_VERSION_IS_RELEASE
# define UV_VERSION_STRING UV_VERSION_STRING_BASE
#else
# define UV_VERSION_STRING UV_VERSION_STRING_BASE "-pre"
#endif
unsigned int uv_version(void) {
return UV_VERSION;
}
const char* uv_version_string(void) {
return UV_VERSION_STRING;
}

1
deps/uv/test/test-udp-send-and-recv.c

@ -53,6 +53,7 @@ static uv_buf_t alloc_cb(uv_handle_t* handle, size_t suggested_size) {
static void close_cb(uv_handle_t* handle) { static void close_cb(uv_handle_t* handle) {
CHECK_HANDLE(handle); CHECK_HANDLE(handle);
ASSERT(uv_is_closing(handle));
close_cb_called++; close_cb_called++;
} }

9
deps/uv/uv.gyp

@ -56,6 +56,7 @@
'src/inet.c', 'src/inet.c',
'src/uv-common.c', 'src/uv-common.c',
'src/uv-common.h', 'src/uv-common.h',
'src/version.c'
], ],
'conditions': [ 'conditions': [
[ 'OS=="win"', { [ 'OS=="win"', {
@ -114,7 +115,6 @@
'-pedantic', '-pedantic',
'-Wall', '-Wall',
'-Wextra', '-Wextra',
'-Wstrict-aliasing',
'-Wno-unused-parameter', '-Wno-unused-parameter',
], ],
'sources': [ 'sources': [
@ -180,6 +180,11 @@
'_DARWIN_USE_64_BIT_INODE=1', '_DARWIN_USE_64_BIT_INODE=1',
] ]
}], }],
[ 'OS!="mac"', {
# Enable on all platforms except OS X. The antique gcc/clang that
# ships with Xcode emits waaaay too many false positives.
'cflags': [ '-Wstrict-aliasing' ],
}],
[ 'OS=="linux"', { [ 'OS=="linux"', {
'sources': [ 'sources': [
'src/unix/linux-core.c', 'src/unix/linux-core.c',
@ -424,5 +429,3 @@
} }
] ]
} }

4
doc/api/addons.markdown

@ -12,8 +12,8 @@ knowledge of several libraries:
- [libuv](https://github.com/joyent/libuv), C event loop library. - [libuv](https://github.com/joyent/libuv), C event loop library.
Anytime one needs to wait for a file descriptor to become readable, Anytime one needs to wait for a file descriptor to become readable,
wait for a timer, or wait for a signal to received one will need to wait for a timer, or wait for a signal to be received one will need
interface with libuv. That is, if you perform any I/O, libuv will to interface with libuv. That is, if you perform any I/O, libuv will
need to be used. need to be used.
- Internal Node libraries. Most importantly is the `node::ObjectWrap` - Internal Node libraries. Most importantly is the `node::ObjectWrap`

27
doc/api/child_process.markdown

@ -26,6 +26,19 @@ which can be piped to and from.
The ChildProcess class is not intended to be used directly. Use the The ChildProcess class is not intended to be used directly. Use the
`spawn()` or `fork()` methods to create a Child Process instance. `spawn()` or `fork()` methods to create a Child Process instance.
### Event: 'error'
* `err` {Error Object} the error.
Emitted when:
1. The process could not be spawned, or
2. The process could not be killed, or
3. Sending a message to the child process failed for whatever reason.
See also [`ChildProcess#kill()`](#child_process_child_kill_signal) and
[`ChildProcess#send()`](#child_process_child_send_message_sendhandle).
### Event: 'exit' ### Event: 'exit'
* `code` {Number} the exit code, if it exited normally. * `code` {Number} the exit code, if it exited normally.
@ -125,8 +138,15 @@ be sent `'SIGTERM'`. See `signal(7)` for a list of available signals.
// send SIGHUP to process // send SIGHUP to process
grep.kill('SIGHUP'); grep.kill('SIGHUP');
Note that while the function is called `kill`, the signal delivered to the child May emit an `'error'` event when the signal cannot be delivered. Sending a
process may not actually kill it. `kill` really just sends a signal to a process. signal to a child process that has already exited is not an error but may
have unforeseen consequences: if the PID (the process ID) has been reassigned
to another process, the signal will be delivered to that process instead.
What happens next is anyone's guess.
Note that while the function is called `kill`, the signal delivered to the
child process may not actually kill it. `kill` really just sends a signal
to a process.
See `kill(2)` See `kill(2)`
@ -172,6 +192,9 @@ The `sendHandle` option to `child.send()` is for sending a TCP server or
socket object to another process. The child will receive the object as its socket object to another process. The child will receive the object as its
second argument to the `message` event. second argument to the `message` event.
Emits an `'error'` event if the message cannot be sent, for example because
the child process has already exited.
#### Example: sending server object #### Example: sending server object
Here is an example of sending a server: Here is an example of sending a server:

2
doc/api/debugger.markdown

@ -97,7 +97,7 @@ prints the active watchers. To remove a watcher, type
* `next`, `n` - Step next * `next`, `n` - Step next
* `step`, `s` - Step in * `step`, `s` - Step in
* `out`, `o` - Step out * `out`, `o` - Step out
* `pause` - Pause running code (like pause button in Developer TOols) * `pause` - Pause running code (like pause button in Developer Tools)
### Breakpoints ### Breakpoints

2
doc/api/dns.markdown

@ -7,7 +7,7 @@ use C-Ares except for `dns.lookup` which uses `getaddrinfo(3)` in a thread
pool. C-Ares is much faster than `getaddrinfo` but the system resolver is pool. C-Ares is much faster than `getaddrinfo` but the system resolver is
more constant with how other programs operate. When a user does more constant with how other programs operate. When a user does
`net.connect(80, 'google.com')` or `http.get({ host: 'google.com' })` the `net.connect(80, 'google.com')` or `http.get({ host: 'google.com' })` the
`dns.lookup` method is used. Users who need to do a large number of look ups `dns.lookup` method is used. Users who need to do a large number of lookups
quickly should use the methods that go through C-Ares. quickly should use the methods that go through C-Ares.
Here is an example which resolves `'www.google.com'` then reverse Here is an example which resolves `'www.google.com'` then reverse

170
doc/api/domain.markdown

@ -7,17 +7,159 @@ single group. If any of the event emitters or callbacks registered to a
domain emit an `error` event, or throw an error, then the domain object domain emit an `error` event, or throw an error, then the domain object
will be notified, rather than losing the context of the error in the will be notified, rather than losing the context of the error in the
`process.on('uncaughtException')` handler, or causing the program to `process.on('uncaughtException')` handler, or causing the program to
exit with an error code. exit immediately with an error code.
This feature is new in Node version 0.8. It is a first pass, and is ## Warning: Don't Ignore Errors!
expected to change significantly in future versions. Please use it and
provide feedback.
Due to their experimental nature, the Domains features are disabled unless <!-- type=misc -->
the `domain` module is loaded at least once. No domains are created or
registered by default. This is by design, to prevent adverse effects on Domain error handlers are not a substitute for closing down your
current programs. It is expected to be enabled by default in future process when an error occurs.
Node.js versions.
By the very nature of how `throw` works in JavaScript, there is almost
never any way to safely "pick up where you left off", without leaking
references, or creating some other sort of undefined brittle state.
The safest way to respond to a thrown error is to shut down the
process. Of course, in a normal web server, you might have many
connections open, and it is not reasonable to abruptly shut those down
because an error was triggered by someone else.
The better approach is send an error response to the request that
triggered the error, while letting the others finish in their normal
time, and stop listening for new requests in that worker.
In this way, `domain` usage goes hand-in-hand with the cluster module,
since the master process can fork a new worker when a worker
encounters an error. For node programs that scale to multiple
machines, the terminating proxy or service registry can take note of
the failure, and react accordingly.
For example, this is not a good idea:
```javascript
// XXX WARNING! BAD IDEA!
var d = require('domain').create();
d.on('error', function(er) {
// The error won't crash the process, but what it does is worse!
// Though we've prevented abrupt process restarting, we are leaking
// resources like crazy if this ever happens.
// This is no better than process.on('uncaughtException')!
console.log('error, but oh well', er.message);
});
require('http').createServer(function(req, res) {
handleRequest(req, res);
}).listen(PORT);
```
By using the context of a domain, and the resilience of separating our
program into multiple worker processes, we can react more
appropriately, and handle errors with much greater safety.
```javascript
// Much better!
var cluster = require('cluster');
var PORT = +process.env.PORT || 1337;
if (cluster.isMaster) {
// In real life, you'd probably use more than just 2 workers,
// and perhaps not put the master and worker in the same file.
//
// You can also of course get a bit fancier about logging, and
// implement whatever custom logic you need to prevent DoS
// attacks and other bad behavior.
//
// See the options in the cluster documentation.
//
// The important thing is that the master does very little,
// increasing our resilience to unexpected errors.
cluster.fork();
cluster.fork();
cluster.on('disconnect', function(worker) {
console.error('disconnect!');
cluster.fork();
});
} else {
// the worker
//
// This is where we put our bugs!
var domain = require('domain');
// See the cluster documentation for more details about using
// worker processes to serve requests. How it works, caveats, etc.
var server = require('http').createServer(function(req, res) {
var d = domain.create();
d.on('error', function(er) {
console.error('error', er.stack);
// Note: we're in dangerous territory!
// By definition, something unexpected occurred,
// which we probably didn't want.
// Anything can happen now! Be very careful!
try {
// make sure we close down within 30 seconds
var killtimer = setTimeout(function() {
process.exit(1);
}, 30000);
// But don't keep the process open just for that!
killtimer.unref();
// stop taking new requests.
server.close();
// Let the master know we're dead. This will trigger a
// 'disconnect' in the cluster master, and then it will fork
// a new worker.
cluster.worker.disconnect();
// try to send an error to the request that triggered the problem
res.statusCode = 500;
res.setHeader('content-type', 'text/plain');
res.end('Oops, there was a problem!\n');
} catch (er2) {
// oh well, not much we can do at this point.
console.error('Error sending 500!', er2.stack);
}
});
// Because req and res were created before this domain existed,
// we need to explicitly add them.
// See the explanation of implicit vs explicit binding below.
d.add(req);
d.add(res);
// Now run the handler function in the domain.
d.run(function() {
handleRequest(req, res);
});
});
server.listen(PORT);
}
// This part isn't important. Just an example routing thing.
// You'd put your fancy application logic here.
function handleRequest(req, res) {
switch(req.url) {
case '/error':
// We do some async stuff, and then...
setTimeout(function() {
// Whoops!
flerb.bark();
});
break;
default:
res.end('ok');
}
}
```
## Additions to Error objects ## Additions to Error objects
@ -38,7 +180,7 @@ are added to it.
<!--type=misc--> <!--type=misc-->
If domains are in use, then all new EventEmitter objects (including If domains are in use, then all **new** EventEmitter objects (including
Stream objects, requests, responses, etc.) will be implicitly bound to Stream objects, requests, responses, etc.) will be implicitly bound to
the active domain at the time of their creation. the active domain at the time of their creation.
@ -53,7 +195,7 @@ were, then it would be too easy to prevent request and response objects
from being properly garbage collected. from being properly garbage collected.
If you *want* to nest Domain objects as children of a parent Domain, If you *want* to nest Domain objects as children of a parent Domain,
then you must explicitly add them, and then dispose of them later. then you must explicitly add them.
Implicit binding routes thrown errors and `'error'` events to the Implicit binding routes thrown errors and `'error'` events to the
Domain's `error` event, but does not register the EventEmitter on the Domain's `error` event, but does not register the EventEmitter on the
@ -94,14 +236,8 @@ serverDomain.run(function() {
try { try {
res.writeHead(500); res.writeHead(500);
res.end('Error occurred, sorry.'); res.end('Error occurred, sorry.');
res.on('close', function() {
// forcibly shut down any other things added to this domain
reqd.dispose();
});
} catch (er) { } catch (er) {
console.error('Error sending 500', er, req.url); console.error('Error sending 500', er, req.url);
// tried our best. clean up anything remaining.
reqd.dispose();
} }
}); });
}).listen(1337); }).listen(1337);

2
doc/api/http.markdown

@ -230,7 +230,7 @@ The response implements the [Writable Stream][] interface. This is an
`function () { }` `function () { }`
Indicates that the underlaying connection was terminated before Indicates that the underlying connection was terminated before
`response.end()` was called or able to flush. `response.end()` was called or able to flush.
### response.writeContinue() ### response.writeContinue()

2
doc/api/tty.markdown

@ -46,7 +46,7 @@ of the `tty.ReadStream` instance.
to the resulting mode. to the resulting mode.
## Class WriteStream ## Class: WriteStream
A `net.Socket` subclass that represents the writable portion of a tty. In normal A `net.Socket` subclass that represents the writable portion of a tty. In normal
circumstances, `process.stdout` will be the only `tty.WriteStream` instance circumstances, `process.stdout` will be the only `tty.WriteStream` instance

87
doc/blog/release/v0.10.2.md

@ -0,0 +1,87 @@
date: Thu Mar 28 13:00:39 PDT 2013
version: 0.10.2
category: release
title: Node v0.10.2 (Stable)
slug: node-v0-10-2-stable
2013.03.28, Version 0.10.2 (Stable)
* npm: Upgrade to 1.2.15
* uv: Upgrade to 0.10.3
* tls: handle SSL_ERROR_ZERO_RETURN (Fedor Indutny)
* tls: handle errors before calling C++ methods (Fedor Indutny)
* tls: remove harmful unnecessary bounds checking (Marcel Laverdet)
* crypto: make getCiphers() return non-SSL ciphers (Ben Noordhuis)
* crypto: check randomBytes() size argument (Ben Noordhuis)
* timers: do not calculate Timeout._when property (Alexey Kupershtokh)
* timers: fix off-by-one ms error (Alexey Kupershtokh)
* timers: handle signed int32 overflow in enroll() (Fedor Indutny)
* stream: Fix stall in Transform under very specific conditions (Gil Pedersen)
* stream: Handle late 'readable' event listeners (isaacs)
* stream: Fix early end in Writables on zero-length writes (isaacs)
* domain: fix domain callback from MakeCallback (Trevor Norris)
* child_process: don't emit same handle twice (Ben Noordhuis)
* child_process: fix sending utf-8 to child process (Ben Noordhuis)
Source Code: http://nodejs.org/dist/v0.10.2/node-v0.10.2.tar.gz
Macintosh Installer (Universal): http://nodejs.org/dist/v0.10.2/node-v0.10.2.pkg
Windows Installer: http://nodejs.org/dist/v0.10.2/node-v0.10.2-x86.msi
Windows x64 Installer: http://nodejs.org/dist/v0.10.2/x64/node-v0.10.2-x64.msi
Windows x64 Files: http://nodejs.org/dist/v0.10.2/x64/
Linux 32-bit Binary: http://nodejs.org/dist/v0.10.2/node-v0.10.2-linux-x86.tar.gz
Linux 64-bit Binary: http://nodejs.org/dist/v0.10.2/node-v0.10.2-linux-x64.tar.gz
Solaris 32-bit Binary: http://nodejs.org/dist/v0.10.2/node-v0.10.2-sunos-x86.tar.gz
Solaris 64-bit Binary: http://nodejs.org/dist/v0.10.2/node-v0.10.2-sunos-x64.tar.gz
Other release files: http://nodejs.org/dist/v0.10.2/
Website: http://nodejs.org/docs/v0.10.2/
Documentation: http://nodejs.org/docs/v0.10.2/api/
Shasums:
```
860ed25d3e77d4676b5512f87f3f98b6783ee258 node-v0.10.2-darwin-x64.tar.gz
811eb3b66651dfffeaf928496e8eecab5c9304fb node-v0.10.2-darwin-x86.tar.gz
0013be477da5d066471390c9964f796356b48948 node-v0.10.2-linux-x64.tar.gz
97c3a052d833bfc799bc9b748520a15cfb189a58 node-v0.10.2-linux-x86.tar.gz
17bc5bf26af7da790e6b0c4cbb2b73ea1c9f2ed5 node-v0.10.2-sunos-x64.tar.gz
5e02e35cc15ae56953921ad4c8e45b849c736e20 node-v0.10.2-sunos-x86.tar.gz
2adb1bf5919fb8adeaf96edd8a8ed16d71a3f8f8 node-v0.10.2-x86.msi
73ff97a4d2d3bb1f468db2654b5b59a28f868cce node-v0.10.2.pkg
759a05eff48ff0b54e55748012c5c45502f7cecd node-v0.10.2.tar.gz
6c1336a61395747fed20a12c8977a2b2ecf23354 node.exe
f0775d4f649ee9c3d5614fdb26e64bc7d000cd5d node.exp
9860c6eb9062fbdc50b515f4ccab179f74dd3ec8 node.lib
d41d99a3921022533c1760e15447ce3acf050a7d node.pdb
1dbd11a5278831356daca035fe5bbbe1062798b4 x64/node-v0.10.2-x64.msi
d36abd4ecf02c522e8c75fce24eab1ce800d6458 x64/node.exe
295a950fe3c1c3ceb04249474388b891bf2a39ed x64/node.exp
b64eabafc3f9498552b3ea97bd0d922db1f90f75 x64/node.lib
1f31d6c0079e9f2c9a6de3d956649d83ca6e7a25 x64/node.pdb
```

17
lib/_stream_readable.js

@ -65,6 +65,7 @@ function ReadableState(options, stream) {
// that we're awaiting a 'readable' event emission. // that we're awaiting a 'readable' event emission.
this.needReadable = false; this.needReadable = false;
this.emittedReadable = false; this.emittedReadable = false;
this.readableListening = false;
// object stream flag. Used to make read(n) ignore n and to // object stream flag. Used to make read(n) ignore n and to
@ -235,7 +236,7 @@ Readable.prototype.read = function(n) {
// the 'readable' event and move on. // the 'readable' event and move on.
if (n === 0 && if (n === 0 &&
state.needReadable && state.needReadable &&
state.length >= state.highWaterMark) { (state.length >= state.highWaterMark || state.ended)) {
emitReadable(this); emitReadable(this);
return null; return null;
} }
@ -378,7 +379,6 @@ function emitReadable(stream) {
} }
function emitReadable_(stream) { function emitReadable_(stream) {
var state = stream._readableState;
stream.emit('readable'); stream.emit('readable');
} }
@ -655,8 +655,19 @@ Readable.prototype.on = function(ev, fn) {
if (ev === 'data' && !this._readableState.flowing) if (ev === 'data' && !this._readableState.flowing)
emitDataEvents(this); emitDataEvents(this);
if (ev === 'readable' && !this._readableState.reading) if (ev === 'readable' && this.readable) {
var state = this._readableState;
if (!state.readableListening) {
state.readableListening = true;
state.emittedReadable = false;
state.needReadable = true;
if (!state.reading) {
this.read(0); this.read(0);
} else if (state.length) {
emitReadable(this, state);
}
}
}
return res; return res;
}; };

5
lib/domain.js

@ -32,9 +32,8 @@ var endMethods = ['end', 'abort', 'destroy', 'destroySoon'];
// a few side effects. // a few side effects.
events.usingDomains = true; events.usingDomains = true;
// replace tickers with domain specific implementation // let the process know we're using domains
process.nextTick = process._nextDomainTick; process._usingDomains();
process._tickCallback = process._tickDomainCallback;
exports.Domain = Domain; exports.Domain = Domain;

7
lib/timers.js

@ -263,12 +263,15 @@ var Timeout = function(after) {
this._idleTimeout = after; this._idleTimeout = after;
this._idlePrev = this; this._idlePrev = this;
this._idleNext = this; this._idleNext = this;
this._when = Date.now() + after; this._idleStart = null;
this._onTimeout = null;
}; };
Timeout.prototype.unref = function() { Timeout.prototype.unref = function() {
if (!this._handle) { if (!this._handle) {
var delay = this._when - Date.now(); var now = Date.now();
if (!this._idleStart) this._idleStart = now;
var delay = this._idleStart + this._idleTimeout - now;
if (delay < 0) delay = 0; if (delay < 0) delay = 0;
exports.unenroll(this); exports.unenroll(this);
this._handle = new Timer(); this._handle = new Timer();

26
lib/tls.js

@ -335,7 +335,10 @@ CryptoStream.prototype._write = function write(data, encoding, cb) {
written = this.pair.ssl.encIn(data, 0, data.length); written = this.pair.ssl.encIn(data, 0, data.length);
} }
var self = this; // Handle and report errors
if (this.pair.ssl && this.pair.ssl.error) {
return cb(this.pair.error(true));
}
// Force SSL_read call to cycle some states/data inside OpenSSL // Force SSL_read call to cycle some states/data inside OpenSSL
this.pair.cleartext.read(0); this.pair.cleartext.read(0);
@ -345,11 +348,6 @@ CryptoStream.prototype._write = function write(data, encoding, cb) {
this.pair.encrypted.read(0); this.pair.encrypted.read(0);
} }
// Handle and report errors
if (this.pair.ssl && this.pair.ssl.error) {
return cb(this.pair.error());
}
// Get NPN and Server name when ready // Get NPN and Server name when ready
this.pair.maybeInitFinished(); this.pair.maybeInitFinished();
@ -919,24 +917,28 @@ SecurePair.prototype.destroy = function() {
}; };
SecurePair.prototype.error = function() { SecurePair.prototype.error = function(returnOnly) {
var err = this.ssl.error; var err = this.ssl.error;
this.ssl.error = null; this.ssl.error = null;
if (!this._secureEstablished) { if (!this._secureEstablished) {
if (!err) { // Emit ECONNRESET instead of zero return
err = new Error('socket hang up'); if (!err || err.message === 'ZERO_RETURN') {
err.code = 'ECONNRESET'; var connReset = new Error('socket hang up');
connReset.code = 'ECONNRESET';
connReset.sslError = err && err.message;
err = connReset;
} }
this.destroy(); this.destroy();
this.emit('error', err); if (!returnOnly) this.emit('error', err);
} else if (this._isServer && } else if (this._isServer &&
this._rejectUnauthorized && this._rejectUnauthorized &&
/peer did not return a certificate/.test(err.message)) { /peer did not return a certificate/.test(err.message)) {
// Not really an error. // Not really an error.
this.destroy(); this.destroy();
} else { } else {
this.cleartext.emit('error', err); if (!returnOnly) this.cleartext.emit('error', err);
} }
return err; return err;
}; };

54
src/node.cc

@ -102,7 +102,6 @@ Persistent<String> domain_symbol;
// declared in node_internals.h // declared in node_internals.h
Persistent<Object> process; Persistent<Object> process;
static Persistent<Function> process_tickDomainCallback;
static Persistent<Function> process_tickFromSpinner; static Persistent<Function> process_tickFromSpinner;
static Persistent<Function> process_tickCallback; static Persistent<Function> process_tickCallback;
@ -134,6 +133,7 @@ static bool use_debug_agent = false;
static bool debug_wait_connect = false; static bool debug_wait_connect = false;
static int debug_port=5858; static int debug_port=5858;
static int max_stack_size = 0; static int max_stack_size = 0;
static bool using_domains = false;
// used by C++ modules as well // used by C++ modules as well
bool no_deprecation = false; bool no_deprecation = false;
@ -899,6 +899,30 @@ Handle<Value> FromConstructorTemplate(Persistent<FunctionTemplate> t,
} }
Handle<Value> UsingDomains(const Arguments& args) {
HandleScope scope;
if (using_domains)
return scope.Close(Undefined());
using_domains = true;
Local<Value> tdc_v = process->Get(String::New("_tickDomainCallback"));
Local<Value> ndt_v = process->Get(String::New("_nextDomainTick"));
if (!tdc_v->IsFunction()) {
fprintf(stderr, "process._tickDomainCallback assigned to non-function\n");
abort();
}
if (!ndt_v->IsFunction()) {
fprintf(stderr, "process._nextDomainTick assigned to non-function\n");
abort();
}
Local<Function> tdc = tdc_v.As<Function>();
Local<Function> ndt = ndt_v.As<Function>();
process->Set(String::New("_tickCallback"), tdc);
process->Set(String::New("nextTick"), ndt);
process_tickCallback = Persistent<Function>::New(tdc);
return Undefined();
}
Handle<Value> Handle<Value>
MakeDomainCallback(const Handle<Object> object, MakeDomainCallback(const Handle<Object> object,
const Handle<Function> callback, const Handle<Function> callback,
@ -906,17 +930,6 @@ MakeDomainCallback(const Handle<Object> object,
Handle<Value> argv[]) { Handle<Value> argv[]) {
// TODO Hook for long stack traces to be made here. // TODO Hook for long stack traces to be made here.
// lazy load _tickDomainCallback
if (process_tickDomainCallback.IsEmpty()) {
Local<Value> cb_v = process->Get(String::New("_tickDomainCallback"));
if (!cb_v->IsFunction()) {
fprintf(stderr, "process._tickDomainCallback assigned to non-function\n");
abort();
}
Local<Function> cb = cb_v.As<Function>();
process_tickDomainCallback = Persistent<Function>::New(node_isolate, cb);
}
// lazy load domain specific symbols // lazy load domain specific symbols
if (enter_symbol.IsEmpty()) { if (enter_symbol.IsEmpty()) {
enter_symbol = NODE_PSYMBOL("enter"); enter_symbol = NODE_PSYMBOL("enter");
@ -931,6 +944,8 @@ MakeDomainCallback(const Handle<Object> object,
TryCatch try_catch; TryCatch try_catch;
bool has_domain = domain_v->IsObject();
if (has_domain) {
domain = domain_v->ToObject(); domain = domain_v->ToObject();
assert(!domain.IsEmpty()); assert(!domain.IsEmpty());
if (domain->Get(disposed_symbol)->IsTrue()) { if (domain->Get(disposed_symbol)->IsTrue()) {
@ -945,6 +960,7 @@ MakeDomainCallback(const Handle<Object> object,
FatalException(try_catch); FatalException(try_catch);
return Undefined(node_isolate); return Undefined(node_isolate);
} }
}
Local<Value> ret = callback->Call(object, argc, argv); Local<Value> ret = callback->Call(object, argc, argv);
@ -953,6 +969,7 @@ MakeDomainCallback(const Handle<Object> object,
return Undefined(node_isolate); return Undefined(node_isolate);
} }
if (has_domain) {
exit = Local<Function>::Cast(domain->Get(exit_symbol)); exit = Local<Function>::Cast(domain->Get(exit_symbol));
assert(!exit.IsEmpty()); assert(!exit.IsEmpty());
exit->Call(domain, 0, NULL); exit->Call(domain, 0, NULL);
@ -961,6 +978,7 @@ MakeDomainCallback(const Handle<Object> object,
FatalException(try_catch); FatalException(try_catch);
return Undefined(node_isolate); return Undefined(node_isolate);
} }
}
if (tick_infobox.length == 0) { if (tick_infobox.length == 0) {
tick_infobox.index = 0; tick_infobox.index = 0;
@ -969,7 +987,7 @@ MakeDomainCallback(const Handle<Object> object,
} }
// process nextTicks after call // process nextTicks after call
process_tickDomainCallback->Call(process, 0, NULL); process_tickCallback->Call(process, 0, NULL);
if (try_catch.HasCaught()) { if (try_catch.HasCaught()) {
FatalException(try_catch); FatalException(try_catch);
@ -1033,10 +1051,8 @@ MakeCallback(const Handle<Object> object,
HandleScope scope(node_isolate); HandleScope scope(node_isolate);
Local<Function> callback = object->Get(symbol).As<Function>(); Local<Function> callback = object->Get(symbol).As<Function>();
Local<Value> domain = object->Get(domain_symbol);
// has domain, off with you if (using_domains)
if (!domain->IsNull() && !domain->IsUndefined())
return scope.Close(MakeDomainCallback(object, callback, argc, argv)); return scope.Close(MakeDomainCallback(object, callback, argc, argv));
return scope.Close(MakeCallback(object, callback, argc, argv)); return scope.Close(MakeCallback(object, callback, argc, argv));
} }
@ -2347,9 +2363,7 @@ Handle<Object> SetupProcessObject(int argc, char *argv[]) {
versions->Set(String::NewSymbol("node"), String::New(NODE_VERSION+1)); versions->Set(String::NewSymbol("node"), String::New(NODE_VERSION+1));
versions->Set(String::NewSymbol("v8"), String::New(V8::GetVersion())); versions->Set(String::NewSymbol("v8"), String::New(V8::GetVersion()));
versions->Set(String::NewSymbol("ares"), String::New(ARES_VERSION_STR)); versions->Set(String::NewSymbol("ares"), String::New(ARES_VERSION_STR));
versions->Set(String::NewSymbol("uv"), String::New( versions->Set(String::NewSymbol("uv"), String::New(uv_version_string()));
NODE_STRINGIFY(UV_VERSION_MAJOR) "."
NODE_STRINGIFY(UV_VERSION_MINOR)));
versions->Set(String::NewSymbol("zlib"), String::New(ZLIB_VERSION)); versions->Set(String::NewSymbol("zlib"), String::New(ZLIB_VERSION));
#if HAVE_OPENSSL #if HAVE_OPENSSL
// Stupid code to slice out the version string. // Stupid code to slice out the version string.
@ -2495,6 +2509,8 @@ Handle<Object> SetupProcessObject(int argc, char *argv[]) {
NODE_SET_METHOD(process, "binding", Binding); NODE_SET_METHOD(process, "binding", Binding);
NODE_SET_METHOD(process, "_usingDomains", UsingDomains);
// values use to cross communicate with processNextTick // values use to cross communicate with processNextTick
Local<Object> info_box = Object::New(); Local<Object> info_box = Object::New();
info_box->SetIndexedPropertiesToExternalArrayData(&tick_infobox, info_box->SetIndexedPropertiesToExternalArrayData(&tick_infobox,

8
src/node.js

@ -331,12 +331,12 @@
var index = 1; var index = 1;
var depth = 2; var depth = 2;
process._tickCallback = _tickCallback;
process._tickFromSpinner = _tickFromSpinner;
// needs to be accessible from cc land
process._tickDomainCallback = _tickDomainCallback;
process.nextTick = nextTick; process.nextTick = nextTick;
// needs to be accessible from cc land
process._nextDomainTick = _nextDomainTick; process._nextDomainTick = _nextDomainTick;
process._tickCallback = _tickCallback;
process._tickDomainCallback = _tickDomainCallback;
process._tickFromSpinner = _tickFromSpinner;
// the maximum number of times it'll process something like // the maximum number of times it'll process something like
// nextTick(function f(){nextTick(f)}) // nextTick(function f(){nextTick(f)})

5
src/node_crypto.cc

@ -945,6 +945,11 @@ int Connection::HandleSSLError(const char* func, int rv, ZeroStatus zs) {
DEBUG_PRINT("[%p] SSL: %s want read\n", ssl_, func); DEBUG_PRINT("[%p] SSL: %s want read\n", ssl_, func);
return 0; return 0;
} else if (err == SSL_ERROR_ZERO_RETURN) {
handle_->Set(String::New("error"),
Exception::Error(String::New("ZERO_RETURN")));
return rv;
} else { } else {
HandleScope scope(node_isolate); HandleScope scope(node_isolate);
BUF_MEM* mem; BUF_MEM* mem;

39
test/simple/test-domain-from-timer.js

@ -0,0 +1,39 @@
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
// Simple tests of most basic domain functionality.
var common = require('../common');
var assert = require('assert');
// timeouts call the callback directly from cc, so need to make sure the
// domain will be used regardless
setTimeout(function() {
var domain = require('domain');
var d = domain.create();
d.run(function() {
process.nextTick(function() {
console.trace('in nexttick', process.domain === d)
assert.equal(process.domain, d);
});
});
});

106
test/simple/test-stream-readable-event.js

@ -0,0 +1,106 @@
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
var common = require('../common');
var assert = require('assert');
var Readable = require('stream').Readable;
(function first() {
// First test, not reading when the readable is added.
// make sure that read(0) triggers a readable event.
var r = new Readable({
highWaterMark: 3
});
r._read = function(n) {
r.push(new Buffer(new Array(n + 1).join('x')));
};
// This triggers a 'readable' event, which is lost.
r.push(new Buffer('blerg'));
var caughtReadable = false;
setTimeout(function() {
r.on('readable', function() {
caughtReadable = true;
});
});
process.on('exit', function() {
assert(caughtReadable);
console.log('ok 1');
});
})();
(function second() {
// second test, make sure that readable is re-emitted if there's
// already a length, while it IS reading.
var r = new Readable({
highWaterMark: 3
});
r._read = function(n) {
setTimeout(function() {
r.push(new Buffer(new Array(n + 1).join('x')));
});
};
// This triggers a 'readable' event, which is lost.
r.push(new Buffer('blerg'));
var caughtReadable = false;
process.nextTick(function() {
r.on('readable', function() {
caughtReadable = true;
});
});
process.on('exit', function() {
assert(caughtReadable);
console.log('ok 2');
});
})();
(function third() {
// Third test, not reading when the stream has not passed
// the highWaterMark but *has* reached EOF.
var r = new Readable({
highWaterMark: 30
});
// This triggers a 'readable' event, which is lost.
r.push(new Buffer('blerg'));
r.push(null);
var caughtReadable = false;
setTimeout(function() {
r.on('readable', function() {
caughtReadable = true;
});
});
process.on('exit', function() {
assert(caughtReadable);
console.log('ok 3');
});
})();

68
test/simple/test-tls-client-abort3.js

@ -0,0 +1,68 @@
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
if (!process.versions.openssl) {
console.error('Skipping because node compiled without OpenSSL.');
process.exit(0);
}
var common = require('../common');
var common = require('../common');
var tls = require('tls');
var fs = require('fs');
var assert = require('assert');
var options = {
key: fs.readFileSync(common.fixturesDir + '/test_key.pem'),
cert: fs.readFileSync(common.fixturesDir + '/test_cert.pem')
};
var gotError = 0,
gotRequest = 0,
connected = 0;
var server = tls.createServer(options, function(c) {
gotRequest++;
c.on('data', function(data) {
console.log(data.toString());
});
c.on('close', function() {
server.close();
});
}).listen(common.PORT, function() {
var c = tls.connect(common.PORT, { rejectUnauthorized: false }, function() {
connected++;
c.pair.ssl.shutdown();
c.write('123');
c.destroy();
});
c.once('error', function() {
gotError++;
});
});
process.once('exit', function() {
assert.equal(gotError, 1);
assert.equal(gotRequest, 1);
assert.equal(connected, 1);
});

8
test/simple/test-writedouble.js

@ -168,7 +168,9 @@ function test(clazz) {
buffer.writeDoubleBE(NaN, 0); buffer.writeDoubleBE(NaN, 0);
buffer.writeDoubleLE(NaN, 8); buffer.writeDoubleLE(NaN, 8);
ASSERT.equal(0x7F, buffer[0]); // Darwin ia32 does the other kind of NaN.
// Compiler bug. No one really cares.
ASSERT(0x7F === buffer[0] || 0xFF === buffer[0]);
ASSERT.equal(0xF8, buffer[1]); ASSERT.equal(0xF8, buffer[1]);
ASSERT.equal(0x00, buffer[2]); ASSERT.equal(0x00, buffer[2]);
ASSERT.equal(0x00, buffer[3]); ASSERT.equal(0x00, buffer[3]);
@ -183,7 +185,9 @@ function test(clazz) {
ASSERT.equal(0x00, buffer[12]); ASSERT.equal(0x00, buffer[12]);
ASSERT.equal(0x00, buffer[13]); ASSERT.equal(0x00, buffer[13]);
ASSERT.equal(0xF8, buffer[14]); ASSERT.equal(0xF8, buffer[14]);
ASSERT.equal(0x7F, buffer[15]); // Darwin ia32 does the other kind of NaN.
// Compiler bug. No one really cares.
ASSERT(0x7F === buffer[15] || 0xFF === buffer[15]);
ASSERT.ok(isNaN(buffer.readDoubleBE(0))); ASSERT.ok(isNaN(buffer.readDoubleBE(0)));
ASSERT.ok(isNaN(buffer.readDoubleLE(8))); ASSERT.ok(isNaN(buffer.readDoubleLE(8)));
} }

12
test/simple/test-writefloat.js

@ -99,7 +99,9 @@ function test(clazz) {
buffer.writeFloatBE(-Infinity, 0); buffer.writeFloatBE(-Infinity, 0);
buffer.writeFloatLE(-Infinity, 4); buffer.writeFloatLE(-Infinity, 4);
ASSERT.equal(0xFF, buffer[0]); // Darwin ia32 does the other kind of NaN.
// Compiler bug. No one really cares.
ASSERT(0xFF === buffer[0] || 0x7F === buffer[0]);
ASSERT.equal(0x80, buffer[1]); ASSERT.equal(0x80, buffer[1]);
ASSERT.equal(0x00, buffer[2]); ASSERT.equal(0x00, buffer[2]);
ASSERT.equal(0x00, buffer[3]); ASSERT.equal(0x00, buffer[3]);
@ -112,14 +114,18 @@ function test(clazz) {
buffer.writeFloatBE(NaN, 0); buffer.writeFloatBE(NaN, 0);
buffer.writeFloatLE(NaN, 4); buffer.writeFloatLE(NaN, 4);
ASSERT.equal(0x7F, buffer[0]); // Darwin ia32 does the other kind of NaN.
// Compiler bug. No one really cares.
ASSERT(0x7F === buffer[0] || 0xFF === buffer[0]);
ASSERT.equal(0xc0, buffer[1]); ASSERT.equal(0xc0, buffer[1]);
ASSERT.equal(0x00, buffer[2]); ASSERT.equal(0x00, buffer[2]);
ASSERT.equal(0x00, buffer[3]); ASSERT.equal(0x00, buffer[3]);
ASSERT.equal(0x00, buffer[4]); ASSERT.equal(0x00, buffer[4]);
ASSERT.equal(0x00, buffer[5]); ASSERT.equal(0x00, buffer[5]);
ASSERT.equal(0xc0, buffer[6]); ASSERT.equal(0xc0, buffer[6]);
ASSERT.equal(0x7F, buffer[7]); // Darwin ia32 does the other kind of NaN.
// Compiler bug. No one really cares.
ASSERT(0x7F === buffer[7] || 0xFF === buffer[7]);
ASSERT.ok(isNaN(buffer.readFloatBE(0))); ASSERT.ok(isNaN(buffer.readFloatBE(0)));
ASSERT.ok(isNaN(buffer.readFloatLE(4))); ASSERT.ok(isNaN(buffer.readFloatLE(4)));
} }

Loading…
Cancel
Save