node/lib
Jackson Tian 748d2b4de1 buffer: make byteLength work with Buffer correctly
Make the byteLength work correctly when input is Buffer.

e.g:

```js
// The incomplete unicode string
Buffer.byteLength(new Buffer([0xe4, 0xb8, 0xad, 0xe6, 0x96]))
```
The old output: 9
The new output: 5

PR-URL: https://github.com/nodejs/node/pull/4738
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2016-02-15 11:30:23 -08:00
..
internal repl: make sure historyPath is trimmed 2016-02-15 11:30:23 -08:00
_debug_agent.js lib: use const to define constants 2015-01-21 16:21:31 -05:00
_debugger.js debugger: remove variable redeclarations 2016-02-15 11:30:23 -08:00
_http_agent.js http: use self.keepAlive instead of self.options.keepAlive 2016-01-19 11:52:33 -08:00
_http_client.js http: remove variable redeclaration 2016-02-15 11:30:23 -08:00
_http_common.js http: strictly forbid invalid characters from headers 2016-02-09 08:42:15 -08:00
_http_incoming.js http: fix non-string header value concatenation 2016-02-15 11:30:23 -08:00
_http_outgoing.js http: strictly forbid invalid characters from headers 2016-02-09 08:42:15 -08:00
_http_server.js lib: fix style issues after eslint update 2016-02-15 11:30:23 -08:00
_linklist.js Remove excessive copyright/license boilerplate 2015-01-12 15:30:28 -08:00
_stream_duplex.js node: allow multiple arguments passed to nextTick 2015-04-15 17:02:21 -06:00
_stream_passthrough.js lib: use const to define constants 2015-01-21 16:21:31 -05:00
_stream_readable.js stream: avoid unnecessary concat of a single buffer. 2015-10-29 08:38:40 -07:00
_stream_transform.js stream: remove useless if test in transform 2016-02-15 11:30:23 -08:00
_stream_wrap.js stream_wrap: error if stream has StringDecoder 2015-12-23 08:38:33 -08:00
_stream_writable.js stream: fix signature of _write() in a comment 2015-10-29 08:38:40 -07:00
_tls_common.js tls: destroy singleUse context immediately 2015-04-30 11:02:30 +02:00
_tls_legacy.js tls_legacy: do not read on OpenSSL's stack 2016-02-15 11:30:23 -08:00
_tls_wrap.js lib: fix style issues after eslint update 2016-02-15 11:30:23 -08:00
assert.js lib: fix style issues after eslint update 2016-02-15 11:30:23 -08:00
buffer.js buffer: make byteLength work with Buffer correctly 2016-02-15 11:30:23 -08:00
child_process.js child_process: add safety checks on stdio access 2015-12-23 08:38:33 -08:00
cluster.js cluster: ignore queryServer msgs on disconnection 2016-02-15 11:30:23 -08:00
console.js lib: fix eslint styles 2015-05-09 12:10:02 +09:00
constants.js Remove excessive copyright/license boilerplate 2015-01-12 15:30:28 -08:00
crypto.js streams: refactor LazyTransform to internal/ 2015-09-15 13:53:21 -04:00
dgram.js dgram: prevent disabled optimization of bind() 2016-02-15 11:30:23 -08:00
dns.js dns: remove nonexistant exports.ADNAME 2016-01-19 11:52:38 -08:00
domain.js domains: fix handling of uncaught exceptions 2015-12-23 08:38:33 -08:00
events.js events,lib: don't require EE#listenerCount() 2015-09-06 21:39:00 +10:00
freelist.js lib,test: add freelist deprecation and test 2015-07-17 19:48:31 -07:00
fs.js lib: fix style issues after eslint update 2016-02-15 11:30:23 -08:00
http.js lib,src: remove usage of events.EventEmitter 2015-09-23 08:39:34 +10:00
https.js https: use servername in agent key 2016-01-19 11:52:32 -08:00
module.js module: move unnecessary work for early return 2016-02-15 11:30:23 -08:00
net.js net: remove hot path comment from connect 2016-02-15 11:30:23 -08:00
os.js lib: remove unused modules 2016-01-19 11:52:39 -08:00
path.js lib: fix style issues after eslint update 2016-02-15 11:30:23 -08:00
process.js src: remove excessive license boilerplate 2015-01-27 16:35:05 +11:00
punycode.js lib: add missing new for errors lib/*.js 2015-03-24 12:42:15 -07:00
querystring.js lib: fix style issues after eslint update 2016-02-15 11:30:23 -08:00
readline.js readline: Remove XXX and output debuglog 2016-02-15 11:30:23 -08:00
repl.js repl: use String#repeat instead of Array#join 2016-01-19 11:52:30 -08:00
stream.js lib,src: remove usage of events.EventEmitter 2015-09-23 08:39:34 +10:00
string_decoder.js lib: don't use global Buffer 2015-06-11 20:24:44 +02:00
sys.js util: introduce printDeprecationMessage function 2015-06-04 10:59:43 +03:00
timers.js timers: optimize callback call: bind -> arrow 2016-01-19 11:52:16 -08:00
tls.js lib: fix style issues after eslint update 2016-02-15 11:30:23 -08:00
tty.js util: prepend '(node) ' to deprecation messages 2015-07-03 16:32:29 +02:00
url.js lib: fix style issues after eslint update 2016-02-15 11:30:23 -08:00
util.js util: faster arrayToHash 2016-01-19 11:52:31 -08:00
v8.js src: add total_available_size to v8 statistics 2015-08-11 22:51:50 +02:00
vm.js lib: reduce util.is*() usage 2015-01-31 23:47:29 -05:00
zlib.js zlib: only apply drain listener if given callback 2015-12-23 08:38:33 -08:00