summaryrefslogtreecommitdiff
path: root/lib/buffer.js
Commit message (Collapse)AuthorAgeFilesLines
* worker: add public method for marking objects as untransferableAnna Henningsen2020-06-251-4/+2
| | | | | | | | | | | | | | | We currently mark a number of `ArrayBuffer`s as not transferable, including the `Buffer` pool and ones with finalizers provided by C++ addons. There is no good reason to assume that userland code might not encounter similar problems, for example when doing `ArrayBuffer` pooling similar to ours. Therefore, provide an API that lets userland code also mark objects as not transferable. PR-URL: https://github.com/nodejs/node/pull/33979 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host>
* buffer: remove hoisted variableNikolai Vavilov2020-05-231-3/+2
| | | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/33470 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
* buffer: improve copy() performanceNikolai Vavilov2020-05-091-1/+1
| | | | | | | | | | There is no need to create a slice when sourceEnd is out of bounds. PR-URL: https://github.com/nodejs/node/pull/33214 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
* buffer: add type check in bidirectionalIndexOfGerhard Stoebich2020-04-131-1/+4
| | | | | | | | | | | | | Add a type check in bidirectionalIndexOf to avoid using something else as Buffer. This may happen if e.g. lastIndexOf is called with invalid this. PR-URL: https://github.com/nodejs/node/pull/32770 Fixes: https://github.com/nodejs/node/issues/32753 Fixes: https://github.com/nodejs/node/issues/32747 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
* buffer: mark pool ArrayBuffer as untransferableAnna Henningsen2020-04-131-1/+4
| | | | | | | | | | | | | | | | | | This removes a footgun in which users could attempt to transfer the pooled ArrayBuffer underlying a regular `Buffer`, which would lead to all `Buffer`s that share the same pool being rendered unusable as well, and potentially break creation of new pooled `Buffer`s. This disables this kind of transfer. Refs: https://github.com/nodejs/node/issues/32752 PR-URL: https://github.com/nodejs/node/pull/32759 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: James M Snell <jasnell@gmail.com>
* buffer: improve from() performanceBrian White2020-02-081-16/+13
| | | | | | PR-URL: https://github.com/nodejs/node/pull/31615 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
* buffer: improve concat() performanceBrian White2020-01-281-3/+6
| | | | | | | PR-URL: https://github.com/nodejs/node/pull/31522 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
* buffer: improve fill(number) performanceBrian White2020-01-261-5/+26
| | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/31489 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
* lib: replace use of Error with primordialsSebastien Ahkrin2020-01-041-0/+1
| | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/31163 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
* buffer: improve .from() error detailsRuben Bridgewater2019-12-201-5/+9
| | | | | | | | | | This makes sure the original input is passed to the error in case no matching inputs are found. Instead of passing along all values, only valid or possibliy valid values are passed through. That way invalid values end up in the error case with the original input. PR-URL: https://github.com/nodejs/node/pull/29675 Reviewed-By: Rich Trott <rtrott@gmail.com>
* lib: replace Symbol.species by SymbolSpeciesSebastien Ahkrin2019-12-161-2/+2
| | | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/30950 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com>
* lib: replace Symbol.toPrimitive to SymbolToPrimitive primordialsSebastien Ahkrin2019-12-131-2/+3
| | | | | | | | PR-URL: https://github.com/nodejs/node/pull/30905 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
* lib: replace Symbol global by the primordials SymbolSebastien Ahkrin2019-12-081-0/+1
| | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/30737 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
* lib: use static Number properties from primordialsMichaël Zasso2019-11-301-6/+9
| | | | | | PR-URL: https://github.com/nodejs/node/pull/30686 Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
* lib: enforce use of Array from primordialsMichaël Zasso2019-11-271-2/+4
| | | | | | | PR-URL: https://github.com/nodejs/node/pull/30635 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
* lib: flatten access to primordialsMichaël Zasso2019-11-251-11/+7
| | | | | | | | | | | | | | Store all primordials as properties of the primordials object. Static functions are prefixed by the constructor's name and prototype methods are prefixed by the constructor's name followed by "Prototype". For example: primordials.Object.keys becomes primordials.ObjectKeys. PR-URL: https://github.com/nodejs/node/pull/30610 Refs: https://github.com/nodejs/node/issues/29766 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
* buffer: change var to letVladislav Botvin2019-11-091-6/+6
| | | | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/30292 Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
* buffer: improve performance caused by primordialsJizu Sun2019-11-041-14/+26
| | | | | | | | | | | | | | | | | | This is my first PR, and it's based on the code-and-learn guidances This restore some performance after introducing primordialias. Refs: https://github.com/nodejs/node/issues/29766 Refs: https://github.com/nodejs/code-and-learn/issues/97 Refs: https://github.com/nodejs/node/pull/29633 PR-URL: https://github.com/nodejs/node/pull/30235 Refs: https://github.com/nodejs/node/issues/29766 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
* buffer: correct indexOf() error messageBrian White2019-08-281-1/+1
| | | | | | PR-URL: https://github.com/nodejs/node/pull/29217 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net>
* buffer: consolidate encoding parsingBrian White2019-08-281-180/+179
| | | | | | PR-URL: https://github.com/nodejs/node/pull/29217 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net>
* buffer: correct concat() error messageBrian White2019-08-211-1/+1
| | | | | | | | PR-URL: https://github.com/nodejs/node/pull/29198 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
* buffer: improve equals() performanceBrian White2019-08-211-1/+5
| | | | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/29199 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
* buffer: improve copy() performanceBrian White2019-08-141-1/+69
| | | | | | PR-URL: https://github.com/nodejs/node/pull/29066 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
* buffer: remove unreachable codeRich Trott2019-04-301-5/+1
| | | | | | | | | | | | Remove unreachable code from lib/buffer.js. PR-URL: https://github.com/nodejs/node/pull/27445 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
* buffer: use stricter range checksRuben Bridgewater2019-04-151-43/+30
| | | | | | | | | | | | This validates the input to make sure the arguments do not overflow. Before, if the input would overflow, it would cause the write to be performt in the wrong spot / result in unexpected behavior. Instead, just use a strict number validation. PR-URL: https://github.com/nodejs/node/pull/27045 Fixes: https://github.com/nodejs/node/issues/27043 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
* lib: enforce the use of Object from primordialsMichaël Zasso2019-04-121-1/+1
| | | | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/27146 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host>
* buffer: fix custom inspection with extra propertiesRuben Bridgewater2019-04-081-8/+18
| | | | | | | | | | This broke due to a recent change that prevents exposing inspect internals. It now relies on the public API instead and should be a bit more robust due to that. PR-URL: https://github.com/nodejs/node/pull/27074 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
* lib: remove `env: node` in eslint config for lib filesJoyee Cheung2019-04-061-8/+15
| | | | | | | | | | | | | | This patch removes the redundant `require-globals` custom eslint rule by removing `env: node` in the eslint config and whitelist the globals that can be accessed in native modules instead of black listing them. This makes sense for our `lib/` files because here we are creating the Node.js environment instead of running in a normal user land Node.js environment. PR-URL: https://github.com/nodejs/node/pull/27082 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
* buffer: fix concat error messageRuben Bridgewater2019-04-041-2/+1
| | | | | | | | | | The list argument may only be of type array, not of any other type as it actually suggests. PR-URL: https://github.com/nodejs/node/pull/27050 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
* lib: force using primordials for JSON, Math and ReflectMichaël Zasso2019-04-031-0/+2
| | | | | | | | | | | | Use the "no-restricted-globals" ESLint rule to lint for it. PR-URL: https://github.com/nodejs/node/pull/27027 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
* buffer: use stricter `from()` input validationRuben Bridgewater2019-03-301-24/+14
| | | | | | | | | | | | So far we did not throw an error for all types of invalid input. Functions do not return a buffer anymore and `number` and `symbol` validation is also improved. PR-URL: https://github.com/nodejs/node/pull/26825 Fixes: https://github.com/nodejs/node/issues/26741 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
* benchmark,doc,lib: capitalize more commentsRuben Bridgewater2019-03-271-1/+1
| | | | | | PR-URL: https://github.com/nodejs/node/pull/26849 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
* lib: refactor Error.captureStackTrace() usageRuben Bridgewater2019-03-231-20/+17
| | | | | | | | | | | | | | | | | When using `Errors.captureStackFrames` the error's stack property is set again. This adds a helper function that wraps this functionality in a simple API that does not only set the stack including the `code` property but it also improves the performance to create the error. The helper works for thrown errors and errors returned from wrapped functions in case they are Node.js core errors. PR-URL: https://github.com/nodejs/node/pull/26738 Fixes: https://github.com/nodejs/node/issues/26669 Fixes: https://github.com/nodejs/node/issues/20253 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
* buffer: harden SlowBuffer creationZYSzys2019-03-111-2/+0
| | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/26272 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
* buffer: avoid materializing ArrayBuffer for creationAnna Henningsen2019-03-011-6/+2
| | | | | | | | | Do not create an `ArrayBuffer` if the engine’s settings avoid it and we don’t need it. PR-URL: https://github.com/nodejs/node/pull/26301 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* buffer: harden validation of buffer allocation sizeZYSzys2019-02-211-3/+6
| | | | | | | | | | | | | | This makes using `NaN` as the buffer size throw an error. Fixes: https://github.com/nodejs/node/issues/26151 PR-URL: https://github.com/nodejs/node/pull/26162 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
* buffer: move Buffer prototype wiring into internal/buffer.jsJoyee Cheung2019-01-101-36/+6
| | | | | | | | | | | | | | | | Instead of exposing the Buffer prototype methods through an object in `internal/buffer.js` and then iterating over it to put the methods on the prototype, create a function in `internal/buffer.js` to do this. Also moves the creaton of the `FastBuffer` class into `internal/buffer.js` and expose it directly instead of writing it onto that module later. PR-URL: https://github.com/nodejs/node/pull/25292 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
* buffer: move initialization of buffer prototype into node.jsJoyee Cheung2019-01-101-8/+32
| | | | | | | | | | | | Instead of exposing it in `lib/internal/buffer.js` after deleting it from the binding and then do the initialization in `lib/buffer.js`, which results in an implicit dependency on the order in which these modules are loaded. PR-URL: https://github.com/nodejs/node/pull/25292 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
* buffer: refactor checks for SlowBuffer creationP. Mike2019-01-051-18/+15
| | | | | | PR-URL: https://github.com/nodejs/node/pull/25266 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
* lib: expose all type checks from the internal types moduleRuben Bridgewater2018-12-271-1/+1
| | | | | | | | | | | | Combine all type checks on the internal types module and do not use the types binding anywhere else anymore. This makes sure all of those checks exist when required. PR-URL: https://github.com/nodejs/node/pull/25149 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com>
* buffer: inspect extra propertiesRuben Bridgewater2018-12-271-1/+22
| | | | | | | | | This makes sure extra properties on buffers are not ignored anymore when inspecting the buffer. PR-URL: https://github.com/nodejs/node/pull/25150 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
* buffer: simplify codeRuben Bridgewater2018-12-241-19/+16
| | | | | | | | | | | This refactors some code for simplicity. It also removes a call indirection used in the buffers custom inspect function. PR-URL: https://github.com/nodejs/node/pull/25151 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Masashi Hirano <shisama07@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
* lib: remove internalBinding('config').pendingDeprecationJoyee Cheung2018-12-141-4/+2
| | | | | | | | | | | Instead use `require('internal/options').getOptionValue('--pending-deprecation')` PR-URL: https://github.com/nodejs/node/pull/24962 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
* tools: capitalize sentencesRuben Bridgewater2018-12-101-1/+1
| | | | | | | | | | | | This adds the `capitalized-comments` eslint rule to verify that actual sentences use capital letters as starting letters. It ignores special words and all lines below 62 characters. PR-URL: https://github.com/nodejs/node/pull/24808 Reviewed-By: Sam Ruby <rubys@intertwingly.net> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
* src,lib: make process.binding('config') internalMasashi Hirano2018-12-051-2/+2
| | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/23400 Refs: https://github.com/nodejs/node/issues/22160 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
* buffer: move process.binding('buffer') to internalBindingWeijia Wang2018-10-151-1/+1
| | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/22370 Refs: https://github.com/nodejs/node/issues/22160 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
* buffer: unconditionally use internalBindingcjihrig2018-10-081-8/+1
| | | | | | | | | | | | With the removal of test-buffer-bindingobj-no-zerofill.js, internalBinding can be used unconditionally to assign isAnyArrayBuffer(). PR-URL: https://github.com/nodejs/node/pull/23234 Refs: https://github.com/nodejs/node/issues/22160 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Gus Caplan <me@gus.host>
* icu: make process.binding('icu') internalcjihrig2018-10-081-1/+1
| | | | | | | | PR-URL: https://github.com/nodejs/node/pull/23234 Refs: https://github.com/nodejs/node/issues/22160 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Gus Caplan <me@gus.host>
* bootstrapper: move internalBinding to NativeModuleGus Caplan2018-10-041-1/+0
| | | | | | | | | | | | | | | | | | internalBinding is used so often that it should just automatically be available for usage in internals. PR-URL: https://github.com/nodejs/node/pull/23025 Refs: https://github.com/nodejs/node/commit/2a9eb31 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
* errors: use ERR_OUT_OF_RANGE for index errorsRich Trott2018-09-261-55/+56
| | | | | | | | | | | | | Remove ERR_INDEX_OUT_OF_RANGE in favor of ERR_OUT_OF_RANGE which is capable of providing more detail. (In one instance, use ERR_BUFFER_OUT_OF_BOUNDS which is more accurate in that one instance.) PR-URL: https://github.com/nodejs/node/pull/22969 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Weijia Wang <starkwang@126.com>