]> zoso.dev Git - buffer.git/log
buffer.git
6 years agoUse `util.inspect.custom` symbol if available.
Renée Kooi [Wed, 20 Jun 2018 11:38:45 +0000 (13:38 +0200)]
Use `util.inspect.custom` symbol if available.

Ports the `buffer-inspect` test from Node core.
Adds a `Buffer.prototype[util.inspect.custom]` method, which is an alias
to `Buffer.prototype.inspect`. Node already doesn't have an `.inspect`
method on Buffers anymore, but since this module has to work in browsers
that do not have Symbols, it seems better to keep it around.

In Node, this will use the builtin `util.inspect.custom` symbol. In the
browser, it will use `Symbol.for('util.inspect.custom')`. The browser
version of `util` will also use the `inspect-custom-symbol` module in
the near future.

If https://github.com/nodejs/node/pull/20857 gets merged,
`Symbol.for('util.inspect.custom')` will be used everywhere and the
dependency on `inspect-custom-symbol` could probably be dropped.

The motivation for this is API parity and the fact that Node is
removing support for the old `.inspect` method:
https://github.com/nodejs/node/pull/20722

6 years agoMerge pull request #195 from feross/greenkeeper/airtap-0.0.5
Feross Aboukhadijeh [Thu, 10 May 2018 00:11:56 +0000 (17:11 -0700)]
Merge pull request #195 from feross/greenkeeper/airtap-0.0.5

Update airtap to the latest version 🚀

6 years agochore(package): update airtap to version 0.0.5
greenkeeper[bot] [Sun, 6 May 2018 11:36:22 +0000 (11:36 +0000)]
chore(package): update airtap to version 0.0.5

6 years agostyle
Feross Aboukhadijeh [Sat, 28 Apr 2018 00:14:18 +0000 (17:14 -0700)]
style

6 years agoMerge pull request #194 from machinomy/master
Feross Aboukhadijeh [Sat, 28 Apr 2018 00:04:21 +0000 (02:04 +0200)]
Merge pull request #194 from machinomy/master

Add TypeScript declaration file

6 years agoAdd TypeScript declaration file
ukstv [Fri, 27 Apr 2018 10:48:46 +0000 (12:48 +0200)]
Add TypeScript declaration file

6 years agoairtap@0.0.4
Feross Aboukhadijeh [Sat, 17 Mar 2018 11:18:59 +0000 (13:18 +0200)]
airtap@0.0.4

6 years agoMerge pull request #188 from feross/greenkeeper/initial
Feross Aboukhadijeh [Thu, 8 Mar 2018 19:44:37 +0000 (11:44 -0800)]
Merge pull request #188 from feross/greenkeeper/initial

Update dependencies to enable Greenkeeper 🌴

6 years agoremove greenkeeper badge
Feross Aboukhadijeh [Thu, 8 Mar 2018 19:36:33 +0000 (11:36 -0800)]
remove greenkeeper badge

6 years agoMerge pull request #191 from feross/airtap-test
Feross Aboukhadijeh [Fri, 2 Mar 2018 20:54:30 +0000 (12:54 -0800)]
Merge pull request #191 from feross/airtap-test

airtap: always run browser test

6 years agoairtap: always run browser test
Feross Aboukhadijeh [Fri, 2 Mar 2018 20:43:06 +0000 (12:43 -0800)]
airtap: always run browser test

Rely on airtap to automatically skip browser tests when Travis secure variables are not available (in PRs)

6 years agouglify-js@3
Feross Aboukhadijeh [Fri, 23 Feb 2018 01:44:54 +0000 (17:44 -0800)]
uglify-js@3

6 years agodocs(readme): add Greenkeeper badge
greenkeeper[bot] [Fri, 23 Feb 2018 01:44:32 +0000 (01:44 +0000)]
docs(readme): add Greenkeeper badge

6 years agochore(package): update dependencies
greenkeeper[bot] [Fri, 23 Feb 2018 01:44:29 +0000 (01:44 +0000)]
chore(package): update dependencies

6 years agoairtap@0.0.2
Feross Aboukhadijeh [Fri, 23 Feb 2018 01:44:25 +0000 (17:44 -0800)]
airtap@0.0.2

6 years agobrowserify@16
Feross Aboukhadijeh [Fri, 23 Feb 2018 01:44:17 +0000 (17:44 -0800)]
browserify@16

6 years agois-buffer@2
Feross Aboukhadijeh [Fri, 23 Feb 2018 01:41:45 +0000 (17:41 -0800)]
is-buffer@2

6 years agoMerge pull request #186 from ChALkeR/patch-1
Feross Aboukhadijeh [Fri, 23 Feb 2018 01:41:11 +0000 (17:41 -0800)]
Merge pull request #186 from ChALkeR/patch-1

new Buffer -> Buffer.from

6 years agonew Buffer -> Buffer.from
Сковорода Никита Андреевич [Thu, 22 Feb 2018 16:29:45 +0000 (19:29 +0300)]
new Buffer -> Buffer.from

This is benign due to the module nature, but just for consistency.

6 years agoMerge pull request #185 from feross/airtap
Feross Aboukhadijeh [Wed, 21 Feb 2018 18:48:12 +0000 (10:48 -0800)]
Merge pull request #185 from feross/airtap

Replace zuul with airtap

6 years agozuul -> airtap
Feross Aboukhadijeh [Wed, 21 Feb 2018 18:41:23 +0000 (10:41 -0800)]
zuul -> airtap

6 years agostandard
Feross Aboukhadijeh [Sun, 18 Feb 2018 01:17:09 +0000 (17:17 -0800)]
standard

6 years agotest on node lts
Feross Aboukhadijeh [Fri, 16 Feb 2018 09:42:12 +0000 (01:42 -0800)]
test on node lts

6 years agoremove stray const for Safari 9 support
Feross Aboukhadijeh [Fri, 16 Feb 2018 09:32:28 +0000 (01:32 -0800)]
remove stray const for Safari 9 support

6 years agoFix isInstance() in IE11
Feross Aboukhadijeh [Fri, 16 Feb 2018 09:27:35 +0000 (01:27 -0800)]
Fix isInstance() in IE11

Confirm that function.name is not undefined

6 years agoSkip destructive test-buffer-inspect.js test
Feross Aboukhadijeh [Fri, 16 Feb 2018 09:12:49 +0000 (01:12 -0800)]
Skip destructive test-buffer-inspect.js test

6 years agoFix Buffer.inspect() output to match Node.js (test-buffer-prototype-inspect.js)
Feross Aboukhadijeh [Fri, 16 Feb 2018 09:04:55 +0000 (01:04 -0800)]
Fix Buffer.inspect() output to match Node.js (test-buffer-prototype-inspect.js)

6 years agoBuffer.isBuffer(Buffer.prototype) should be false
Feross Aboukhadijeh [Fri, 16 Feb 2018 08:58:28 +0000 (00:58 -0800)]
Buffer.isBuffer(Buffer.prototype) should be false

6 years agoerror message fix
Feross Aboukhadijeh [Fri, 16 Feb 2018 08:58:17 +0000 (00:58 -0800)]
error message fix

6 years agoparent, offset are enumerable to match Node.js
Feross Aboukhadijeh [Fri, 16 Feb 2018 08:58:12 +0000 (00:58 -0800)]
parent, offset are enumerable to match Node.js

6 years agoMatch Node.js Buffer.from() argument handling (test-buffer-from.js)
Feross Aboukhadijeh [Fri, 16 Feb 2018 08:47:03 +0000 (00:47 -0800)]
Match Node.js Buffer.from() argument handling (test-buffer-from.js)

- Handle new String() and new Boolean() using valueOf()
- Use Symbol.toPrimitive() if it exists
- Be slightly stricter with accepting .length props
- Match error messages

6 years agostyle
Feross Aboukhadijeh [Fri, 16 Feb 2018 08:42:59 +0000 (00:42 -0800)]
style

6 years agodocument that numberIsNaN is for IE11
Feross Aboukhadijeh [Fri, 16 Feb 2018 08:42:50 +0000 (00:42 -0800)]
document that numberIsNaN is for IE11

6 years agoFix error messages for invalid sizes (test-buffer-slow.js)
Feross Aboukhadijeh [Fri, 16 Feb 2018 08:17:47 +0000 (00:17 -0800)]
Fix error messages for invalid sizes (test-buffer-slow.js)

6 years agoFix error message from new Buffer(num) (test-buffer-new.js)
Feross Aboukhadijeh [Fri, 16 Feb 2018 08:14:25 +0000 (00:14 -0800)]
Fix error message from new Buffer(num) (test-buffer-new.js)

6 years agoSupport Uint8Array arguments to buf.compare() (test-buffer-compare.js)
Feross Aboukhadijeh [Fri, 16 Feb 2018 08:12:41 +0000 (00:12 -0800)]
Support Uint8Array arguments to buf.compare() (test-buffer-compare.js)

6 years agoconvert isArrayBuffer() to generic isInstance() function
Feross Aboukhadijeh [Fri, 16 Feb 2018 08:08:40 +0000 (00:08 -0800)]
convert isArrayBuffer() to generic isInstance() function

6 years agostyle
Feross Aboukhadijeh [Fri, 16 Feb 2018 07:58:34 +0000 (23:58 -0800)]
style

6 years agoreplace 'instanceof Buffer' with Buffer.isBuffer()
Feross Aboukhadijeh [Fri, 16 Feb 2018 07:58:11 +0000 (23:58 -0800)]
replace 'instanceof Buffer' with Buffer.isBuffer()

To support buffers that come from other contexts like iframes, or Buffers that come from multiple version of buffer embedded in the same browserify bundle

Always use Buffer.isBuffer!!!

6 years agoUpdate buf.compare() error message (test-buffer-compare-offset.js)
Feross Aboukhadijeh [Fri, 16 Feb 2018 07:52:19 +0000 (23:52 -0800)]
Update buf.compare() error message (test-buffer-compare-offset.js)

6 years agoMatch node.js Buffer.byteLength() behavior
Feross Aboukhadijeh [Fri, 16 Feb 2018 07:50:27 +0000 (23:50 -0800)]
Match node.js Buffer.byteLength() behavior

6 years agoIgnore test-buffer-bindingobj-no-zerofill.js
Feross Aboukhadijeh [Fri, 16 Feb 2018 07:39:36 +0000 (23:39 -0800)]
Ignore test-buffer-bindingobj-no-zerofill.js

6 years agoUpdate error message for test-buffer-bad-overload.js
Feross Aboukhadijeh [Fri, 16 Feb 2018 07:38:11 +0000 (23:38 -0800)]
Update error message for test-buffer-bad-overload.js

6 years agoskip irrelevant test file: test-buffer-sharedarraybuffer.js
Feross Aboukhadijeh [Fri, 16 Feb 2018 07:35:33 +0000 (23:35 -0800)]
skip irrelevant test file: test-buffer-sharedarraybuffer.js

6 years agoPull in new test files from Node.js core that are passing!
Feross Aboukhadijeh [Fri, 16 Feb 2018 07:35:03 +0000 (23:35 -0800)]
Pull in new test files from Node.js core that are passing!

6 years agoadd semi
Feross Aboukhadijeh [Fri, 16 Feb 2018 07:22:02 +0000 (23:22 -0800)]
add semi

6 years agodownload-node-tests: don't delete common.js
Feross Aboukhadijeh [Fri, 16 Feb 2018 07:21:32 +0000 (23:21 -0800)]
download-node-tests: don't delete common.js

6 years ago5.1.0
Feross Aboukhadijeh [Fri, 16 Feb 2018 07:16:28 +0000 (23:16 -0800)]
5.1.0

6 years agoDrop Node 0.10 support
Feross Aboukhadijeh [Fri, 16 Feb 2018 07:10:21 +0000 (23:10 -0800)]
Drop Node 0.10 support

Fix https://github.com/feross/buffer/issues/184

6 years agoBuffer.concat() accepts Uint8Array instances
Feross Aboukhadijeh [Fri, 16 Feb 2018 07:09:57 +0000 (23:09 -0800)]
Buffer.concat() accepts Uint8Array instances

Fix https://github.com/feross/buffer/issues/173

6 years agoreadme: update browser support list
Feross Aboukhadijeh [Fri, 16 Feb 2018 06:53:13 +0000 (22:53 -0800)]
readme: update browser support list

Fixes: https://github.com/feross/buffer/issues/182
6 years agodo not run ES6 tests on iOS 9.3, only run ES5 tests
Feross Aboukhadijeh [Fri, 16 Feb 2018 06:49:34 +0000 (22:49 -0800)]
do not run ES6 tests on iOS 9.3, only run ES5 tests

6 years agoUse TypedArrayView.copyWithin() when available
Feross Aboukhadijeh [Fri, 16 Feb 2018 06:46:40 +0000 (22:46 -0800)]
Use TypedArrayView.copyWithin() when available

Fixes https://github.com/feross/buffer/issues/174

6 years agofix yml syntax for list, so iPhone tests run
Feross Aboukhadijeh [Fri, 16 Feb 2018 06:45:55 +0000 (22:45 -0800)]
fix yml syntax for list, so iPhone tests run

6 years agoonly test major ios versions
Feross Aboukhadijeh [Fri, 16 Feb 2018 06:35:29 +0000 (22:35 -0800)]
only test major ios versions

6 years agoskip ES6 tests in Safari 9, only run ES5 tests
Feross Aboukhadijeh [Fri, 16 Feb 2018 06:35:05 +0000 (22:35 -0800)]
skip ES6 tests in Safari 9, only run ES5 tests

The Node.js tests contain the const keyword, which doesn't work in Safari 9 in strict mode :(

6 years agoRemove special-case copy() for len < 1000
Feross Aboukhadijeh [Fri, 16 Feb 2018 06:21:51 +0000 (22:21 -0800)]
Remove special-case copy() for len < 1000

For https://github.com/feross/buffer/issues/174

6 years agotest ios 9.3+, safari 9+, last two Edge versions
Feross Aboukhadijeh [Fri, 16 Feb 2018 06:16:55 +0000 (22:16 -0800)]
test ios 9.3+, safari 9+, last two Edge versions

Fixes https://github.com/feross/buffer/issues/182

6 years agomore robust check for invalid arguments to copy()
Feross Aboukhadijeh [Fri, 16 Feb 2018 05:56:28 +0000 (21:56 -0800)]
more robust check for invalid arguments to copy()

6 years agoRemove unneeded char from regex
Feross Aboukhadijeh [Fri, 16 Feb 2018 05:52:40 +0000 (21:52 -0800)]
Remove unneeded char from regex

We're already finding the first = and discarding it and everything that follows in the split() call a few lines below. There should be no = left in the string to remove.

6 years agoMerge branch 'vmx-sync-tests-alloc'
Feross Aboukhadijeh [Fri, 16 Feb 2018 05:48:18 +0000 (21:48 -0800)]
Merge branch 'vmx-sync-tests-alloc'

6 years agodisable flaky android test
Feross Aboukhadijeh [Fri, 16 Feb 2018 05:28:40 +0000 (21:28 -0800)]
disable flaky android test

6 years agomake properties 'parent' and 'offset' non-enumerable
Feross Aboukhadijeh [Fri, 16 Feb 2018 05:28:31 +0000 (21:28 -0800)]
make properties 'parent' and 'offset' non-enumerable

6 years agoconvert to ES5 for IE11 support
Feross Aboukhadijeh [Fri, 16 Feb 2018 05:28:09 +0000 (21:28 -0800)]
convert to ES5 for IE11 support

6 years agomove common.js to node/ folder so it doesn't run in ES5 browsers
Feross Aboukhadijeh [Fri, 16 Feb 2018 05:27:49 +0000 (21:27 -0800)]
move common.js to node/ folder so it doesn't run in ES5 browsers

6 years agoMerge pull request #181 from GeekStocks/master
Feross Aboukhadijeh [Wed, 7 Feb 2018 19:55:33 +0000 (11:55 -0800)]
Merge pull request #181 from GeekStocks/master

fix typo

6 years agofix typo
David Walton [Sat, 3 Feb 2018 06:49:26 +0000 (01:49 -0500)]
fix typo

6 years agoUse automatically downloaded test-buffer-alloc
Volker Mische [Sun, 21 Jan 2018 01:42:48 +0000 (02:42 +0100)]
Use automatically downloaded test-buffer-alloc

This commit uses the `test-buffer-alloc.js` from upstream Node.js
as of 2018-01-20.

This is part of #177.

6 years agoRemove some post-processing from download script
Volker Mische [Sun, 21 Jan 2018 00:54:18 +0000 (01:54 +0100)]
Remove some post-processing from download script

Some post-processing of the downloaded tests is no longer needed.
Use `const` and `let` instead of `var` and also import a trimmed
down version of the `common` test helper.

6 years agoRemove tests that were moved
Volker Mische [Sun, 21 Jan 2018 01:30:22 +0000 (02:30 +0100)]
Remove tests that were moved

Some tests from test-buffer.js were moved into test-buffer-alloc.js.
Remove those tests as they got updated (and fixed) in
test-buffer-alloc.js.

6 years agoFix outdated error message
Volker Mische [Sun, 21 Jan 2018 01:17:42 +0000 (02:17 +0100)]
Fix outdated error message

6 years agoAdd .parent property
Volker Mische [Sun, 21 Jan 2018 00:46:06 +0000 (01:46 +0100)]
Add .parent property

6 years agoconst is needed to fix some test
Volker Mische [Sun, 21 Jan 2018 00:37:01 +0000 (01:37 +0100)]
const is needed to fix some test

6 years agoAdd .offset property
Volker Mische [Sun, 21 Jan 2018 00:34:50 +0000 (01:34 +0100)]
Add .offset property

6 years agoFix single character fast path
Volker Mische [Sat, 20 Jan 2018 23:23:56 +0000 (00:23 +0100)]
Fix single character fast path

This fixed is based on Node.js' commit d4f00fe1098b0d7b8444565e741d8b457fd9c091
https://github.com/nodejs/node/commit/d4f00fe1098b0d7b8444565e741d8b457fd9c091

6 years agoThrow error on alloc() if value can't be encoded
Volker Mische [Sat, 20 Jan 2018 23:01:16 +0000 (00:01 +0100)]
Throw error on alloc() if value can't be encoded

6 years agoCustom implementation of toLocaleString()
Volker Mische [Sat, 20 Jan 2018 22:18:19 +0000 (23:18 +0100)]
Custom implementation of toLocaleString()

Make `toLocaleString()` to point to the same implementation as `toString()`.

6 years agoError message for "size" parameter changed
Volker Mische [Sat, 20 Jan 2018 22:11:51 +0000 (23:11 +0100)]
Error message for "size" parameter changed

6 years agoNode.js also supports Buffer creation from {buffer: ArrayBuffer}
Volker Mische [Fri, 19 Jan 2018 15:06:03 +0000 (16:06 +0100)]
Node.js also supports Buffer creation from {buffer: ArrayBuffer}

6 years agoOut of bounds error message changed
Volker Mische [Fri, 19 Jan 2018 14:49:22 +0000 (15:49 +0100)]
Out of bounds error message changed

6 years agoOut of bounds error message changed
Volker Mische [Fri, 19 Jan 2018 14:47:45 +0000 (15:47 +0100)]
Out of bounds error message changed

6 years agoError message on Buffer creation changed
Volker Mische [Fri, 19 Jan 2018 14:45:22 +0000 (15:45 +0100)]
Error message on Buffer creation changed

6 years agoThrow error when no buffer is given for `copy()`
Volker Mische [Fri, 19 Jan 2018 14:40:25 +0000 (15:40 +0100)]
Throw error when no buffer is given for `copy()`

6 years agoAdd `printSkipMessage()` stub
Volker Mische [Fri, 19 Jan 2018 00:10:01 +0000 (01:10 +0100)]
Add `printSkipMessage()` stub

We don't want to print anything, hence `printSkipMessage()` is just
a no-op to make the tests without changes pass.

6 years agoChange error message when unknown encoding is given
Volker Mische [Fri, 19 Jan 2018 00:01:12 +0000 (01:01 +0100)]
Change error message when unknown encoding is given

The error message changed from

    "encoding" must be a valid string encoding

to

    Unknown encoding: <the-given-encoding>

To make the test work, parts of Node.js's `common` module need to
be used. Add the parts that are needed with minor modifications (the
check for the return code were removed, as vanilla JS errors don't
have an error code, only Node.js errors have).

6 years agoHex strings no longer need have even number of digits
Volker Mische [Thu, 18 Jan 2018 23:44:15 +0000 (00:44 +0100)]
Hex strings no longer need have even number of digits

If a hex string has an odd number of bytes, the last byte is just
ignored in Node.js.

6 years agoTreat `=` as end of Base64 encoded string
Volker Mische [Thu, 18 Jan 2018 23:39:03 +0000 (00:39 +0100)]
Treat `=` as end of Base64 encoded string

Node.js treats an equal sign as the end of a Base64 encoded string.
Hence `Buffer.from('=bad')` results in an empty string.

6 years agotest-buffer-alloc updated from uptream
Volker Mische [Thu, 18 Jan 2018 21:55:35 +0000 (22:55 +0100)]
test-buffer-alloc updated from uptream

This commits updates the `test-buffer-alloc.js`. Tests currently
not passing are commented out and will be fixed in a subsequent
commit.

7 years ago5.0.8
Feross Aboukhadijeh [Fri, 29 Sep 2017 23:48:32 +0000 (16:48 -0700)]
5.0.8

7 years agoRemove my email from comment
Feross Aboukhadijeh [Fri, 29 Sep 2017 23:11:28 +0000 (16:11 -0700)]
Remove my email from comment

7 years ago5.0.7
Feross Aboukhadijeh [Sat, 5 Aug 2017 01:45:23 +0000 (18:45 -0700)]
5.0.7

7 years agoauthors
Feross Aboukhadijeh [Sat, 5 Aug 2017 01:40:33 +0000 (18:40 -0700)]
authors

7 years agoMerge pull request #170 from feross/arraybuffer-context
Feross Aboukhadijeh [Sat, 5 Aug 2017 01:37:18 +0000 (18:37 -0700)]
Merge pull request #170 from feross/arraybuffer-context

Treat ArrayBuffers from another context as valid

7 years agoTreat ArrayBuffers from another context as valid
Feross Aboukhadijeh [Fri, 4 Aug 2017 22:27:08 +0000 (15:27 -0700)]
Treat ArrayBuffers from another context as valid

Fixes: https://github.com/feross/buffer/issues/166
ArrayBuffers from another context (i.e. an iframe) do not pass the
`instanceof` check but they should be treated as valid.

7 years agoMerge pull request #165 from srsudar/arraybuffer-readme
Feross Aboukhadijeh [Fri, 4 Aug 2017 22:12:17 +0000 (15:12 -0700)]
Merge pull request #165 from srsudar/arraybuffer-readme

Add slice for converting to ArrayBuffer

7 years agoAdd slice for converting to ArrayBuffer
Sam Sudar [Sat, 1 Jul 2017 05:14:16 +0000 (22:14 -0700)]
Add slice for converting to ArrayBuffer

The .buffer property is an ArrayBuffer, but it is not necessarily the
same length as the original buffer. This adds further documentation to
the README to flesh out converting a Buffer to an ArrayBuffer.

7 years ago5.0.6
Feross Aboukhadijeh [Wed, 5 Apr 2017 19:05:09 +0000 (12:05 -0700)]
5.0.6

7 years agoadd back Number.isNaN shim for IE
Feross Aboukhadijeh [Wed, 5 Apr 2017 18:51:52 +0000 (11:51 -0700)]
add back Number.isNaN shim for IE

7 years agoMerge pull request #159 from feross/improvements
Feross Aboukhadijeh [Wed, 5 Apr 2017 18:37:06 +0000 (11:37 -0700)]
Merge pull request #159 from feross/improvements

support environments that lack ArrayBuffer.isView; remove old shims

7 years agoremove string.trim() shim
Feross Aboukhadijeh [Wed, 5 Apr 2017 18:28:28 +0000 (11:28 -0700)]
remove string.trim() shim