0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-30 07:27:22 +01:00
Commit Graph

378 Commits

Author SHA1 Message Date
Nikolai Vavilov
9cd83c761f buffer: remove hoisted variable
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>
2020-05-23 20:47:02 +02:00
Nikolai Vavilov
339690ce9b
buffer: improve copy() performance
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>
2020-05-09 08:04:10 +02:00
Gerhard Stoebich
aa34465ae3 buffer: add type check in bidirectionalIndexOf
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>
2020-04-13 23:22:09 +02:00
Anna Henningsen
bb5e7097e8
buffer: mark pool ArrayBuffer as untransferable
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>
2020-04-13 18:47:27 +02:00
Brian White
74291e4a7b
buffer: improve from() performance
PR-URL: https://github.com/nodejs/node/pull/31615
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-02-08 21:40:49 -05:00
Brian White
2170259940 buffer: improve concat() performance
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>
2020-01-28 19:57:20 -08:00
Brian White
59cba9a5c2
buffer: improve fill(number) performance
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>
2020-01-26 19:16:05 -05:00
Sebastien Ahkrin
c9b93e2344 lib: replace use of Error with primordials
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>
2020-01-04 14:50:18 -08:00
Ruben Bridgewater
fc28761d77
buffer: improve .from() error details
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>
2019-12-20 03:10:12 +01:00
Sebastien Ahkrin
437b6d5d4f
lib: replace Symbol.species by SymbolSpecies
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>
2019-12-16 09:48:16 +01:00
Sebastien Ahkrin
e490b2ca90 lib: replace Symbol.toPrimitive to SymbolToPrimitive primordials
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>
2019-12-13 20:05:49 -05:00
Sebastien Ahkrin
eac3f0adc4
lib: replace Symbol global by the primordials Symbol
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>
2019-12-08 13:38:58 +01:00
Michaël Zasso
1f9a5ae7aa
lib: use static Number properties from primordials
PR-URL: https://github.com/nodejs/node/pull/30686
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2019-11-30 13:45:38 +01:00
Michaël Zasso
141a6e34ee
lib: enforce use of Array from primordials
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>
2019-11-27 19:29:01 +01:00
Michaël Zasso
0646eda4fc
lib: flatten access to primordials
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>
2019-11-25 10:28:15 +01:00
Vladislav Botvin
615ec972de
buffer: change var to let
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>
2019-11-09 13:19:51 +01:00
Jizu Sun
22799be7a9 buffer: improve performance caused by primordials
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>
2019-11-04 21:25:40 +08:00
Brian White
5dc5cfba7d
buffer: correct indexOf() error message
PR-URL: https://github.com/nodejs/node/pull/29217
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2019-08-28 15:13:51 -04:00
Brian White
bb1af6c82f
buffer: consolidate encoding parsing
PR-URL: https://github.com/nodejs/node/pull/29217
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2019-08-28 15:13:38 -04:00
Brian White
775048d54c buffer: correct concat() error message
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>
2019-08-21 22:21:19 -07:00
Brian White
f0c8898fb5 buffer: improve equals() performance
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>
2019-08-21 21:42:21 -07:00
Brian White
6d351d4cc0 buffer: improve copy() performance
PR-URL: https://github.com/nodejs/node/pull/29066
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2019-08-14 15:59:32 -07:00
Rich Trott
524dd469ce buffer: remove unreachable code
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>
2019-04-30 06:37:55 -07:00
Ruben Bridgewater
693401d0dd
buffer: use stricter range checks
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>
2019-04-15 17:21:34 +02:00
Michaël Zasso
908292cf1f lib: enforce the use of Object from primordials
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>
2019-04-12 05:38:45 +02:00
Ruben Bridgewater
d834275a48 buffer: fix custom inspection with extra properties
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>
2019-04-08 08:55:46 +02:00
Joyee Cheung
de23055536
lib: remove env: node in eslint config for lib files
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>
2019-04-06 12:04:36 +08:00
Ruben Bridgewater
4f094c0ae6
buffer: fix concat error message
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>
2019-04-04 14:21:11 +02:00
Michaël Zasso
0817840f77 lib: force using primordials for JSON, Math and Reflect
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>
2019-04-03 21:36:08 +08:00
Ruben Bridgewater
75eaf25e78
buffer: use stricter from() input validation
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>
2019-03-30 13:28:24 +01:00
Ruben Bridgewater
b08a867d60
benchmark,doc,lib: capitalize more comments
PR-URL: https://github.com/nodejs/node/pull/26849
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
2019-03-27 17:20:06 +01:00
Ruben Bridgewater
bfbce289c3
lib: refactor Error.captureStackTrace() usage
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>
2019-03-23 02:55:54 +01:00
ZYSzys
6113ba96cb buffer: harden SlowBuffer creation
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>
2019-03-11 09:46:29 +01:00
Anna Henningsen
6a0f4636d9
buffer: avoid materializing ArrayBuffer for creation
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>
2019-03-01 21:58:06 +01:00
ZYSzys
6fb7baf935
buffer: harden validation of buffer allocation size
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>
2019-02-21 22:08:53 +01:00
Joyee Cheung
842a35fbac
buffer: move Buffer prototype wiring into internal/buffer.js
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>
2019-01-10 16:59:27 +08:00
Joyee Cheung
97f59b9567
buffer: move initialization of buffer prototype into node.js
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>
2019-01-10 16:59:24 +08:00
P. Mike
728505acd5 buffer: refactor checks for SlowBuffer creation
PR-URL: https://github.com/nodejs/node/pull/25266
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-01-05 16:04:22 -08:00
Ruben Bridgewater
5ac30c99a9
lib: expose all type checks from the internal types module
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>
2018-12-27 22:34:47 +01:00
Ruben Bridgewater
d385e2cc5a
buffer: inspect extra properties
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>
2018-12-27 22:32:23 +01:00
Ruben Bridgewater
65d8179b0d
buffer: simplify code
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>
2018-12-24 09:54:43 +01:00
Joyee Cheung
b32e5e08b2 lib: remove internalBinding('config').pendingDeprecation
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>
2018-12-14 21:22:59 -08:00
Ruben Bridgewater
1f85ea979c
tools: capitalize sentences
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>
2018-12-10 17:07:18 +01:00
Masashi Hirano
63b06551f4 src,lib: make process.binding('config') internal
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>
2018-12-05 11:47:05 -08:00
Weijia Wang
ac23e6557f buffer: move process.binding('buffer') to internalBinding
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>
2018-10-15 19:01:20 +08:00
cjihrig
2ec57a7134
buffer: unconditionally use internalBinding
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>
2018-10-08 23:43:00 -04:00
cjihrig
2498c7b18b
icu: make process.binding('icu') internal
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>
2018-10-08 23:42:52 -04:00
Gus Caplan
e7f710c1d4 bootstrapper: move internalBinding to NativeModule
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>
2018-10-04 11:55:34 +02:00
Rich Trott
f8d69911be errors: use ERR_OUT_OF_RANGE for index errors
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>
2018-09-26 19:36:50 -07:00
Ujjwal Sharma
37cd10a116
src: remove calls to deprecated v8 functions (Uint32Value)
Remove all calls to deprecated v8 functions (here:
Value::Uint32Value) inside the code (src directory only).

PR-URL: https://github.com/nodejs/node/pull/22143
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
2018-09-02 16:32:15 +02:00