summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2014-05-01Merge remote-tracking branch 'upstream/v0.10'Timothy J Fontaine
Reverted 9520adeb37f5ebe02a68669ec97770f4869705bb Conflicts: deps/cares/src/ares_parse_txt_reply.c deps/uv/.mailmap deps/uv/AUTHORS deps/uv/ChangeLog deps/uv/include/uv.h deps/uv/src/unix/error.c deps/uv/src/unix/process.c deps/uv/src/version.c deps/uv/src/win/pipe.c deps/uv/src/win/signal.c deps/uv/src/win/util.c deps/uv/test/test-spawn.c deps/uv/vcbuild.bat deps/v8/src/platform-posix.cc deps/v8/tools/gyp/v8.gyp lib/util.js src/node.cc test/simple/test-util-format.js test/simple/test-util.js
2014-05-01buffer: normalize compare() outputTrevor Norris
Because of differences in memcmp() implementation, normalize output to return -1, 0 or 1 only. Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
2014-04-30stream: split `objectMode` for DuplexVladimir Kurchatkin
This commit introduces `readableObjectMode` and `writableObjectMode` options for Duplex streams. This can be used mostly to make parsers and serializers with Transform streams. Also the docs section about stream state objects is removed, because it is not relevant anymore. The example from the section is remade to show new options. fixes #6284 Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
2014-04-30test: update test-dns.js after a60a9b0Timothy J Fontaine
resolveTxt now returns a 2-d array for all the chunks string chunks relating to the record
2014-04-30child_process: fix assertion error in spawnSyncShigeki Ohtsu
When ExitCallback was not called with an error such as ENOENT in uv_spawn, the process handle still remains refed and needs to be closed. Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
2014-04-29crypto: improve error messagesIngmar Runge
1) ThrowCryptoTypeErrors was not actually used for type-related errors. Removed it. 2) For AEAD modes, OpenSSL does not set any internal error information if Final does not complete suc- cessfully. Therefore, "TypeError:error:00000000:l ib(0):func(0):reason(0)" would be the error mess- age. Use a default message for these cases. Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-04-28buffer: add compare and equals methodsSean McArthur
compare() works like String.localeCompare such that: Buffer.compare(a, b) === a.compare(b); equals() does a native check to see if two buffers are equal. Signed-off-by: Trevor Norris <trev.norris@gmail.com>
2014-04-26util: format as Error if instanceof ErrorRod Vagg
Conflicts: lib/util.js test/simple/test-util-format.js This is a backport to fix #7253 Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-04-26vm: assign Environment to created contextDenys Zariaiev
ContextifyContext::CreateV8Context is now create context with Environment pointer Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-04-24http: add request.flush() methodBen Noordhuis
Forcibly flushes the request headers. You need this with long-lived HTTP connections where the first data isn't written until the connection has been established (think: tunneling requests over HTTP CONNECT.) Fixes #7296. Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-04-18tls: `getPeerCertificate(detailed)`Fedor Indutny
Add `raw` property to certificate, add mode to output full certificate chain.
2014-04-18tls: support OCSP on client and serverFedor Indutny
2014-04-15url: treat \ the same as /isaacs
See https://code.google.com/p/chromium/issues/detail?id=25916 Parse URLs with backslashes the same as web browsers, by replacing all backslashes with forward slashes, except those that occur after the first # character.
2014-04-15events: check if _events is an own propertyVladimir Kurchatkin
Without this check it is possible to have the _events object shared amongst instances. Fixes #7157 Signed-off-by: Trevor Norris <trev.norris@gmail.com>
2014-04-14fs: return blksize on stats objectTrevor Norris
Oversight to not pass blksize to fs.Stats on initialization. Also added a test to make sure the object property has been set. Since now on Windows both blksize and blocks will simply be set to undefined.
2014-04-14child_process: fix deadlock when sending handlesFedor Indutny
Fix possible deadlock, when handles are sent in both direction simultaneously. In such rare cases, both sides may queue their `NODE_HANDLE_ACK` replies and wait for them. fix #7465
2014-04-10buffer: return uint if MSB is 1 in readUInt32goussardg
Fix issue where a signed integer is returned. Example: var b = new Buffer(4); b.writeUInt32BE(0xffffffff); b.readUInt32BE(0) == -1 Signed-off-by: Trevor Norris <trev.norris@gmail.com>
2014-04-11buffer: truncate buffer after string decodeFedor Indutny
When our estimates for a storage size are higher than the actual length of decoded data, the destination buffer should be truncated. Otherwise `Buffer::Length` will give misleading information to C++ layer. fix #7365 Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-04-11test: remove vm-infinite-recursionFedor Indutny
It doesn't work reliably on all platforms. see #7432 Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-04-10test: add `reuseAddr` in dgram-multicast...Fedor Indutny
Add `reuseAddr` option in `test-dgram-multicast-multi-process.js`
2014-04-10dgram: introduce `reuseAddr` optionFedor Indutny
Introduce new signature for both `dgram.createSocket` method and `dgram.Socket` constructor: dgram.createSocket(options, [listener]) Options should contain `type` property and may contain `reuseAddr` property. When `reuseAddr` is `true` - SO_REUSEADDR will be issued on socket on bind. fix #7415 Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-04-08test: fix test-cryptoFedor Indutny
2014-04-08http: do not emit EOF non-readable socketFedor Indutny
Socket may become not `readable`, but http should not rely on this property and should not think that it means that no data will ever arrive from it. In fact, it may arrive in a next tick and, since `this.push(null)` was already called, it will result in a error like this: Error: stream.push() after EOF at readableAddChunk (_stream_readable.js:143:15) at IncomingMessage.Readable.push (_stream_readable.js:123:10) at HTTPParser.parserOnBody (_http_common.js:132:22) at Socket.socketOnData (_http_client.js:277:20) at Socket.EventEmitter.emit (events.js:101:17) at Socket.Readable.read (_stream_readable.js:367:10) at Socket.socketCloseListener (_http_client.js:196:10) at Socket.EventEmitter.emit (events.js:123:20) at TCP.close (net.js:479:12) fix #6784
2014-04-02domain: don't crash on "throw null"Alex Kocharin
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
2014-04-02node: add signature to SET_PROTOTYPE_METHODC. Scott Ananian
This prevents segfaults when a native method is reassigned to a different object (which corrupts args.This()). When unwrapping, clients should use args.Holder() instead of args.This(). Closes #6690. Signed-off-by: Trevor Norris <trev.norris@gmail.com>
2014-04-02src: fix up after v8 upgradeBen Noordhuis
The two biggest changes are that v8::Script::New() has been removed and that a v8::Script object now has to be explicitly bound to a context if you want to run it from another context. We can accommodate both changes without breaking the vm module's public API or even the internal JS API.
2014-04-01test: make test-smalloc endian awareAndrew Low
The test/simple/test-smalloc.js has an implicit assumption of the byte order of the data stored for Double and Uint32 values. On a big endian platform this test fails without these patches. Use os.endianness() to detect the endian of the platform and use it to gate the static value used for comparison.
2014-03-29crypto: move `createCredentials` to tlsFedor Indutny
Move `createCredentials` to `tls` module and rename it to `createSecureContext`. Make it use default values from `tls` module: `DEFAULT_CIPHERS` and `DEFAULT_ECDH_CURVE`. fix #7249
2014-03-28http: better client "protocol not supported" errorNathan Rajlich
Include the "expected protocol" in the Error message string, which evaluates to "http:" for the `http` core module, and "https:" for the `https` module. Closes #7355.
2014-03-27tls: do not call SNICallback unless presentFedor Indutny
When asynchronously parsing ClientHello for session resumption - SNICallback may not be set. Check if it is present before invoking it. fix #7010
2014-03-27tls: force readable/writable to `true`Fedor Indutny
These are an old and deprecated properties that was used by previous stream implementation, and are still in use in some user-land modules. Prior to this commit, they were read from the underlying socket, which may be non-readable/non-writable while connecting or while staying uninitialized. Force set them to `true`, just to make sure that there will be no inconsistency. fix #7152
2014-03-24http: use defaultAgent.protocol in protocol checkNathan Rajlich
Default to the `defaultAgent.protocol` when comparing the user-specified `options.protocol` string. This is so that `http.Agent` instances do not need to specify their own `protocol` field, since we have the relevant information already from the `defaultAgent`. Note that the test case could be separately cherry-picked to the `v0.10` branch, since it already passes correctly. Fixes #7349. Fixes the regression described in: http://git.io/2ds-WQ
2014-03-21vm: share security token between contextsFedor Indutny
By default, each `v8::Context` has a different Security Token, which prevents access to one context from another. fix #7140
2014-03-17test: update our branched weakref to v8 3.24Timothy J Fontaine
2014-03-14src, test: fix up ObjectWrap, `make test-addons`Ben Noordhuis
V8 was upgraded from 3.22 to 3.24 in commit 1c7bf24. Upgrade source files in test/addons/ and automatically generated tests from doc/api/addons.markdown to the new V8 API. This coincidentally fixes a bug in src/node_object_wrap.h where it was still using the old V8 weak persistent handle interface, which is gone in 3.24.
2014-03-13src: update to v8 3.24 APIsFedor Indutny
2014-03-12readline: consider newlines for cursor positionYazhong Liu
Fixes #7266. Closes #7279.
2014-03-10mdb_v8: update to latest versionBryan Cantrill
* ::jsstack -v prints function defintion * ::jsprint works with objects with only numeric properties * update tests to use builtin mdb_v8 * add more symbols to postmortem script - pending upstream inclusion
2014-03-10Merge remote-tracking branch 'upstream/v0.10'Timothy J Fontaine
Conflicts: src/node.cc src/node.js test/message/max_tick_depth_trace.out
2014-03-11crypto: do not lowercase cipher/hash namesFedor Indutny
`crypto.getCiphers()` and `crypto.getHashes()` should prefer lower-case variants of names, but should not introduce them. fix #7282
2014-03-10test: timers-ordering should be more preciseTimothy J Fontaine
Internally we use hrtime to schedule when a timer will fire, to avoid the perils of clock drift or other external operation making time go backward. The timers ordering test should use the same timing mechanism
2014-03-10buffer: fix typo in `SlowBuffer`Vladimir Kurchatkin
2014-03-10buffer: allow toString to accept Infinity for endBrian White
2014-03-05test: test sending a handle twiceBenoit Vallée
Added test-cluster-send-handle-twice.js testing to send a handle twice to the parent process.
2014-03-04crypto: allow setting add'l authenticated dataBrian White
2014-03-03timer: don't reschedule timer bucket in a domainGreg Brail
If two timers run on the same tick, and the first timer uses a domain, and then catches an exception and disposes of the domain, then the second timer never runs. (And even if the first timer does not dispose of the domain, the second timer could run under the wrong domain.) This happens because timer.js uses "process.nextTick()" to schedule continued processing of the timers for that tick. However, there was an exception inside a domain, then "process.nextTick()" runs under the domain of the first timer function, and will do nothing if the domain has been disposed. To avoid this, we temporarily save the value of "process.domain" before calling nextTick so that it does not run inside any domain.
2014-03-03src: domain should not replace nextTick functionTimothy J Fontaine
Previously if you cached process.nextTick and then require('domain') subsequent nextTick() calls would not be caught because enqueued functions were taking the wrong path. This keeps nextTick to a single function reference and changes the implementation details after domain has been required.
2014-03-02Merge remote-tracking branch 'origin/v0.10'Fedor Indutny
Conflicts: configure lib/_stream_readable.js lib/http.js src/node_dtrace.cc
2014-02-28doc: document `beforeExit` and add more testsSam Roberts
2014-02-28src: emit 'beforeExit' event on process objectBen Noordhuis
Unlike the 'exit' event, this event allows the user to schedule more work and thereby postpone the exit. That also means that the 'beforeExit' event may be emitted many times, see the attached test case for an example. Refs #6305.