Commit Graph

7653 Commits (47f3fc9a2671bca3f70726f9bbbb8f2b56ac1dc3)

Author SHA1 Message Date
isaacs 47f3fc9a26 test: add module-loading test with empty string 2013-01-16 12:27:53 -08:00
Felix Böhm 7465cf911a module: assert that require() is called with a string
as requested in #4577
2013-01-16 12:25:06 -08:00
isaacs b9ffc537e6 lint: Prefer double-quotes over single 2013-01-16 12:07:12 -08:00
Ryunosuke SATO 61741f9a83 repl: fix how to module requiring in code comment
This module requiring style is old.
This API has been changed in Node 0.1.16 726865af.
2013-01-16 10:59:22 -08:00
Dean McNamee 9fe3734f15 TypedArrays: Improve dataview perf without endian param
V8 seems to be particularly slow converting an undefined value to false
in BooleanValue.

Revert this when we upgrade to V8 3.17, or whenever the fix discussed
in http://code.google.com/p/v8/issues/detail?id=2487 lands in V8.
2013-01-16 10:54:28 -08:00
James Campos c93c99c7c3 assert that require() has a truthy path 2013-01-16 10:49:19 -08:00
isaacs 14e8f806de stream: Properly handle large reads from push-streams
Problem 1: If stream.push() triggers a 'readable' event, and the user
calls `read(n)` with some n > the highWaterMark, then the push() will
return false (indicating that they should not push any more), but no
future 'readable' event is coming (because we're above the
highWaterMark).

Solution: return true from push() when needReadable is set.

Problem 2: A read(n) for n != 0, after the stream had encountered an
EOF, would not trigger the 'end' event if the EOF was pushed in
synchronously by the _read() function.

Solution: Check for ended in stream.read() and schedule an end event if
the length now equals 0.

Fix #4585
2013-01-16 10:45:11 -08:00
Trevor Norris 7393740c7b buffer: improve read/write speed with assert
Improved assert check order of execution and added additional checks on
parameters to ensure no bad values make it through (e.g. negative offset
values).
2013-01-16 10:17:20 -08:00
Trevor Norris 22b84e6216 buffer: floating point read/write improvements
Improvements:
* floating point operations are approx 4x's faster
* Now write quiet NaN's
* all read/write on floating point now done in C, so no more need for
  lib/buffer_ieee754.js
* float values have more accurate min/max value checks
* add additional benchmarks for buffers read/write
* created benchmark/_bench_timer.js which is a simple library that
  can be included into any benchmark and provides an intelligent tracker
  for sync and async tests
* add benchmarks for DataView set methods
* add checks and tests to make sure offset is greater than 0
2013-01-16 10:17:20 -08:00
Alexandr Emelin eef0ccbcaf http: fix duplicate var initialization
IncomingMessage function contained duplicate initialization
of this._pendings. Line with one of those expressions has been
removed.
2013-01-16 17:10:14 +01:00
Mathias Bynens bc764f3dff punycode: update to v1.2.0
This update adds support for RFC 3490 separators for improved
compatibility with web browsers.
2013-01-16 16:53:11 +01:00
Ben Noordhuis 9668df8b39 v8: work around String::WriteAscii segfault
See http://code.google.com/p/v8/issues/detail?id=2493 for details.
Once the patch lands in upstream V8, this commit can be reverted.
2013-01-15 23:46:30 +01:00
Fedor Indutny b4b750b6a5 tls: follow RFC6125 more stricly
* Allow wildcards only in left-most part of hostname identifier.
* Do not match CN if altnames are present
2013-01-14 17:18:30 -08:00
isaacs 20a3c5d09c streams2: Do not allow hwm < lwm
There was previously an assert() in there, but this part of the code is
so high-volume that the added cost made a measurable dent in http_simple.

Just checking inline is fine, though, and prevents a lot of potential
hazards.
2013-01-14 16:03:38 -08:00
isaacs 27fafd4648 stream: Do not call endReadable on a non-empty stream
Say that a stream's current read queue has 101 bytes in it, and the
underlying resource has ended (ie, reached EOF).

If you do something like this:

    stream.read(100); // leave a byte behind
    stream.read(0); // read(0) for some reason

then the read(0) will get 0 from the howMuchToRead function.  Since the
stream was ended, this was incorrectly treating the 0 as a "there is no
more in the buffer", and emitting 'end' before that last byte was read.

Why have the read(0) in the first place?  We do this in some cases to
trigger the last few bytes of a net socket (such as a child process's
stdio pipes).  This was causing issues when piping a `git archive` job
to a file: the resulting tarball was incomplete, because it occasionally
was not getting the last chunk.
2013-01-14 15:22:42 -08:00
Bert Belder e501ce4b21 buffer: zero-length buffers shouldn't be slab-backed 2013-01-14 22:19:22 +01:00
Fedor Indutny 4dd70bb12c tls: allow wildcards in common name
see #4592
2013-01-14 21:10:03 +04:00
Ben Noordhuis e4598aa241 gitignore: ignore perf data files 2013-01-14 13:06:29 +01:00
yangguo@chromium.org 926c90bc64 v8: Hardfloat does not imply VFPv3, only VFPv2.
Raspberry Pi is an example.

BUG=v8:2393

Review URL: https://chromiumcodereview.appspot.com/11570061
Patch from Chi-Thanh Christopher Nguyen <nguyenchithanh@gmail.com>.

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@13232 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

This is a backport of v8/v8@44419ad089.
2013-01-13 18:26:58 +01:00
Ben Noordhuis e4f2a140d2 deps: upgrade libuv to 8e3e60f 2013-01-13 01:29:34 +01:00
Nathan Rajlich bac537b186 repl: fix lint 2013-01-12 12:14:39 -08:00
Felix Böhm 9bce5e8f3e repl: make built-in modules available by default
Closes #3564.
Closes #4578.
2013-01-12 12:10:29 -08:00
Scott Blomquist 8e311d28b0 windows: add support for '_Total' perf counters 2013-01-11 22:24:48 +01:00
Ben Noordhuis 8018113910 v8: remove optimization switches
Remove compiler switches from $(TOPLEVEL)/deps/v8/build/common.gypi,
we set them globally in $(TOPLEVEL)/common.gypi.

Commit 7b4d95a introduced the switches again, resulting in V8 getting
built without any optimizations.

This commit is essentially a rehash of commit 4b8629d.
2013-01-12 00:34:36 +04:00
Fedor Indutny d22bd9e3c4 deps: update v8 to 3.15.11.7 2013-01-12 00:10:45 +04:00
isaacs 9a4a39fc97 Now working on 0.9.7 2013-01-11 11:25:54 -08:00
isaacs f228e3cc05 Merge branch 'v0.9.6-release' 2013-01-11 11:25:37 -08:00
isaacs 9313fdc71c 2013.01.11, Version 0.9.6 (Unstable)
* V8: update to 3.15.11.5

* node: remove ev-emul.h (Ben Noordhuis)

* path: make basename and extname ignore trailing slashes (Bert Belder)

* typed arrays: fix sunos signed/unsigned char issue (Ben Noordhuis)

* child_process: Fix {stdio:'inherit'} regression (Ben Noordhuis)

* child_process: Fix pipe() from child stdio streams  (Maciej Małecki)

* child_process: make fork() execPath configurable (Bradley Meck)

* stream: Add readable.push(chunk) method (isaacs)

* dtrace: x64 ustack helper (Fedor Indutny)

* repl: fix floating point number parsing (Nirk Niggler)

* repl: allow overriding builtins (Ben Noordhuis)

* net: add localAddress and localPort to Socket (James Hight)

* fs: make pool size coincide with ReadStream bufferSize (Shigeki Ohtsu)

* typed arrays: implement load and store swizzling (Dean McNamee)

* windows: fix perfctr crash on XP and 2003 (Scott Blomquist)

* dgram: fix double implicit bind error (Ben Noordhuis)
2013-01-11 10:49:21 -08:00
isaacs 97db62b4d9 Merge remote-tracking branch 'ry/v0.8' into master
Conflicts:
	AUTHORS
	ChangeLog
	Makefile
	src/node_version.h
2013-01-11 10:18:07 -08:00
Bert Belder 6a91eab097 path: make basename and extname ignore trailing slashes
Fixes #4536
2013-01-11 18:50:09 +01:00
Ben Noordhuis b509ae67b7 typed arrays: fix sunos signed/unsigned char issue
The int8_t and uint8_t typedefs on sunos/smartos depend on a number of
compiler directives. Avoid ambiguity and specify signed and unsigned
char explicitly.

Fixes the following build error:

  ../src/stream_wrap.cc: In static member function 'static void*
  node::WriteWrap::operator new(size_t)':
  ../src/stream_wrap.cc:70:49: warning: no return statement in function
  returning non-void [-Wreturn-type]
  In file included from ../src/v8_typed_array.cc:26:0:
  ../src/v8_typed_array_bswap.h: In function 'T
  v8_typed_array::SwapBytes(T) [with T = signed char]':
  ../src/v8_typed_array_bswap.h:150:23:   instantiated from 'T
  v8_typed_array::LoadAndSwapBytes(void*) [with T = signed char]'
  ../src/v8_typed_array.cc:694:7:   instantiated from 'static
  v8::Handle<v8::Value> {anonymous}::DataView::getGeneric(const
  v8::Arguments&) [with T = signed char]'
  ../src/v8_typed_array.cc:738:40:   instantiated from here
  ../src/v8_typed_array_bswap.h:125:16: error: size of array is
  negative
2013-01-11 18:35:03 +01:00
isaacs 3383d77c61 test: child process { stdio:'inherit' } 2013-01-11 09:14:09 -08:00
Fedor Indutny d93346d0fc Revert "typed arrays: fix build on sunos"
This reverts commit 35a137cf8d.
2013-01-11 21:01:14 +04:00
Fedor Indutny 35a137cf8d typed arrays: fix build on sunos 2013-01-11 19:52:49 +04:00
Bert Belder 7be27240b5 Revert "path: fix bugs related to paths with trailing slashes"
It only does the right thing on unix, and the implementation
isn't great either.

This reverts commit bb1c03989f.
2013-01-11 16:19:21 +01:00
Ben Noordhuis 31fc52ab53 deps: upgrade libuv to 9aab5d4 2013-01-11 14:00:19 +01:00
isaacs dc0c524ce6 http: Set _dumped=false initially
The better to keep the IncomingMessage class isomorphic and avoid
creating additional hidden classes.
2013-01-10 18:16:43 -08:00
Andreas Madsen bb1c03989f path: fix bugs related to paths with trailing slashes 2013-01-10 17:58:37 -08:00
Nathan Rajlich b916774255 configure: define "arm_fpu" and "arm_neon" for ARM
v8's common.gypi file expects them to be defined now.

Closes #4534.
2013-01-10 17:13:59 -08:00
Nathan Rajlich 4fa3fd1cc0 make binary: allow custom config flags
For example, to cross-compile from my OS X laptop for Raspberry Pi, you would
do something like:

  $ make binary BINARYNAME=node-v`python tools/getnodeversion.py`-linux-arm-pi \
      DESTCPU=arm CONFIG_FLAGS="--dest-os=linux"
2013-01-10 17:05:14 -08:00
yangguo@chromium.org 438e0c6d75 v8: Hardfloat does not imply VFPv3, only VFPv2.
Raspberry Pi is an example.

BUG=v8:2393

Review URL: https://chromiumcodereview.appspot.com/11570061
Patch from Chi-Thanh Christopher Nguyen <nguyenchithanh@gmail.com>.

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@13232 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

This is a backport of v8/v8@44419ad089.
2013-01-10 17:02:59 -08:00
isaacs 9ece63b1d7 http: Don't switch the socket into old-mode 2013-01-10 13:50:06 -08:00
isaacs bc8feb151c http: Use stream.push() instead of touching _readableState 2013-01-10 13:50:06 -08:00
isaacs 840401c024 net: Use readable.push() instead of private methods 2013-01-10 13:50:05 -08:00
isaacs b43e544140 stream: Use push() for Transform._output()
This also slightly changes the semantics, in that a 'readable'
event may be triggered by the first write() call, even if a
user has not yet called read().

This happens because the Transform _write() handler is calling
read(0) to start the flow of data.  Technically, the new behavior
is more 'correct', since it is more in line with the semantics
of the 'readable' event in other streams.
2013-01-10 13:49:54 -08:00
isaacs 530585b2d1 stream: Use push() for readable.wrap() 2013-01-10 13:49:53 -08:00
isaacs a993f740f0 stream: Add readable.push(chunk) method 2013-01-10 13:49:53 -08:00
isaacs 8e37a589a6 blog, changelog: 0.8.17 was released in 2013, not 2012 2013-01-10 07:47:09 -08:00
isaacs be54423782 blog: Correct shasums for v0.8.17 2013-01-09 19:05:37 -08:00
isaacs 6d9ee4b184 blog: Add security notice to v0.8.17 post 2013-01-09 17:21:16 -08:00