Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V14.9.0 proposal #34852

Merged
merged 104 commits into from
Aug 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
cca0372
timers: allow timers to be used as primitives
lundibundi Jun 19, 2020
aaa6e43
Forces Powershell to use tls1.2
bzoz Jul 21, 2020
093a4b0
test: add tests for validateNumber/validateString
lundibundi Aug 7, 2020
9a7c87d
module: use cjsCache over esm injection
guybedford Aug 3, 2020
7cde699
doc: harden policy around objections
mmarchini Aug 5, 2020
b93ba07
doc: add writable and readable options to Duplex docs
preyunk Jul 15, 2020
2abc98e
build: add flag to build V8 with OBJECT_PRINT
mmarchini Apr 14, 2020
8766b5b
tools: add debug entitlements for macOS 10.15+
ggreco Jul 15, 2020
9527a2a
deps: V8: cherry-pick e06ace6b5cdb
addaleax Aug 7, 2020
27c0653
test: add vm crash regression test
addaleax Aug 7, 2020
77bbd73
util: add debug and debuglog.enabled
bmeck Jun 12, 2020
124a01d
lib: use full URL to GitHub issues in comments
Trott Aug 8, 2020
b261895
test: remove test-child-process-fork-args flaky designation
Trott Aug 8, 2020
d29b805
doc: update http server response 'close' event
renatomariscal Jul 21, 2020
9f0917e
test: use block-scoping in test/pummel/test-timers.js
Trott Aug 5, 2020
fd5153c
test: split test-crypto-dh-hash
Trott Aug 5, 2020
230bcaf
doc: add HPE_UNEXPECTED_CONTENT_LENGTH error description
nikolaykrashnikov Aug 1, 2020
8e91f3e
test: fix test_worker_terminate_finalization
addaleax Aug 11, 2020
91f5324
doc: use semantically appropriate tag for lines
aduh95 Aug 7, 2020
b00f71b
doc: add padding in the sidebar column
aduh95 Aug 7, 2020
3022e0d
src: prefer C++ empty() in boolean expressions
tniessen Jul 19, 2020
ea98122
doc: n-api environment life cycle APIs are stable
jschlight Aug 6, 2020
e4450a1
benchmark: update function_args addon code
addaleax Aug 11, 2020
201d3d7
build: cover all benchmark addons with C++ linter
addaleax Aug 11, 2020
6929649
module: custom --conditions flag option
guybedford Aug 5, 2020
f7563f8
doc: remove typo in crypto.md
Trott Aug 9, 2020
0472d16
test: skip node-api/test_worker_terminate_finalization
addaleax Aug 11, 2020
b933eef
doc: reduce repetitiveness on Consensus Seeking
mmarchini Aug 10, 2020
6ee2578
http2: add maxHeaderSize option to http2
preyunk May 29, 2020
15c9208
build: set --v8-enable-object-print by default
mmarchini Aug 10, 2020
8b56902
doc: edit (general) collaborator guide
Trott Aug 10, 2020
cb09606
doc: use sentence-casing for headers in collaborator guide
Trott Aug 10, 2020
8de6b72
benchmark: add benchmark script for resourceUsage
yashLadha Aug 9, 2020
698cae7
module: share CJS/ESM resolver fns, refactoring
guybedford Aug 9, 2020
8403118
policy: support conditions for redirects
bmeck Jul 17, 2020
aed8237
build: implement a Commit Queue in Actions
mmarchini Jun 29, 2020
9a79020
test: remove error message checking in test-worker-init-failure
Trott Aug 11, 2020
1a9496a
lib: add UNC support to url.pathToFileURL()
mceachen Aug 12, 2020
332e384
buffer: alias UInt ➡️ Uint in buffer methods
addaleax Aug 11, 2020
7ef5591
fs: guard against undefined behavior
ronag Aug 12, 2020
a78c638
test: use process.env.PYTHON to spawn python
addaleax Aug 9, 2020
69bcca1
crypto: avoid unitializing ECDH objects on error
tniessen Jul 10, 2020
3925fd6
doc: avoid _may_ in collaborator guide
Trott Aug 12, 2020
5009d82
test,doc: add missing uv_setup_args() calls
cjihrig Aug 12, 2020
d89a83c
build: move compiling for Windows ARM64 to Tier 2
joaocgreis Aug 11, 2020
2781f64
meta: add TSC as owner of governance-related docs
mmarchini Aug 11, 2020
e4a0e5b
module: fix check for package.json at volume root
DerekNonGeneric Aug 2, 2020
dbcb36d
errors: improve ERR_INVALID_OPT_VALUE error
lundibundi Aug 7, 2020
952f233
http: add RFC references for each status code
Voltra May 31, 2020
bdf26ae
build: add build flag for OSS-Fuzz integration
DavidKorczynski Aug 13, 2020
88919e5
test: allow ENFILE in test-worker-init-failure
Trott Aug 14, 2020
1c324d5
test: allow ENOENT in test-worker-init-failure
Trott Aug 14, 2020
c458e84
test: remove common.rootDir
Trott Aug 14, 2020
e54a684
doc: fix broken links in commit-queue.md
lpinca Aug 15, 2020
9ca4b2a
build: add CODEOWNERS linter action
mmarchini Aug 11, 2020
756c058
meta: fix codeowners docs path
mmarchini Aug 17, 2020
258f64f
doc: edit filehandle.close() entry in fs.md
Trott Aug 14, 2020
04defba
lib: allow to validate enums with validateOneOf
lundibundi Jun 26, 2020
03d6013
worker: do not crash when JSTransferable lists untransferable value
addaleax Aug 13, 2020
513ab0e
worker: fix --abort-on-uncaught-exception handling
addaleax Aug 11, 2020
7d0970c
doc,lib: remove unused error code
Trott Aug 15, 2020
e8eed5c
test: convert assertion that always fails to assert.fail()
Trott Aug 16, 2020
3bfe199
doc: remove "is recommended from crypto legacy API text
Trott Aug 9, 2020
47f2f45
doc: deprecate (doc-only) crypto.Certificate()
Trott Aug 16, 2020
7ed7ef7
test: move execution of WPT to worker threads
targos Aug 15, 2020
c080fc5
test: move test-inspector-already-activated-cli to parallel
Trott Aug 13, 2020
3360dcb
doc: fix some typos and grammar mistakes
HillaShx Aug 16, 2020
969fb1c
doc: improve async_hooks snippets
puzpuzpuz Aug 18, 2020
8f38c19
esm: improve error message of ERR_UNSUPPORTED_ESM_URL_SCHEME
lundibundi Aug 16, 2020
5c987ff
doc: fix file name to main.mjs and not main.js in esm.md
frank-dspeed Aug 15, 2020
b356b79
doc: reorder deprecated tls docs
jeromecovington Aug 9, 2020
7f0869f
build: run link checker in linter workflow
richardlau Aug 17, 2020
cdd4540
doc,tools: annotate broken links in actions workflow
richardlau Aug 17, 2020
34430ab
doc: move module core module doc to separate page
aduh95 Aug 7, 2020
6b45bf3
test: modernize test-cluster-master-error
addaleax Aug 8, 2020
90abdd3
net: validate custom lookup() output
cjihrig Aug 17, 2020
b73943e
workers: add support for data: URLs
aduh95 Jul 31, 2020
5214de7
doc: remove space above version picker
Vap0r1ze Aug 14, 2020
3133b75
doc: move addaleax to TSC emeritus
addaleax Aug 17, 2020
6048421
build,win: use x64 Node when building for ARM64
dennisameling Jun 22, 2020
a16f0f4
process: correctly parse Unicode in NODE_OPTIONS
bzoz Jul 22, 2020
9e0d18f
http2: use and support non-empty DATA frame with END_STREAM flag
clshortfuse Jun 14, 2020
2a78c33
test: run REPL preview test regardless of terminal type
Trott Aug 16, 2020
ef41ddf
doc: sort references lexically
Trott Aug 20, 2020
b1c3fb7
doc: fix bulleted list punctuation in BUILDING.md
Trott Aug 20, 2020
e16b3e7
test: fix test-cluster-net-listen-relative-path.js to run in /
Trott Aug 18, 2020
68b7a8d
deps: upgrade npm to 6.14.8
ruyadorno Aug 17, 2020
98f7d8e
n-api: handle weak no-finalizer refs correctly
Aug 19, 2020
e4679bd
doc: use 'console' info string for console output
Trott Aug 20, 2020
d6bb2ad
doc: adopt Microsoft Style Guide officially
Trott Aug 18, 2020
4b3b0e3
doc: fix ESM/CJS wrapper example
fox1t Aug 20, 2020
cc72584
http2: fix Http2Response.sendDate
joaolucasl Aug 20, 2020
e90cb49
tls: enable renegotiation when using BoringSSL
nornagon Aug 18, 2020
f2c2f42
doc: improve wording in deprecations.md
Trott Aug 21, 2020
bf7f492
doc: rename module pages
aduh95 Aug 7, 2020
7666d95
src: usage of modernize-use-equals-default
yashLadha Aug 17, 2020
fff1e7f
src: fix abort on uv_loop_init() failure
bnoordhuis Aug 22, 2020
dae93ca
doc: indicate the format of process.version
dguo Aug 22, 2020
9ebae0a
doc,n-api: add link to n-api tutorial website
jschlight Aug 21, 2020
ff15c92
doc: improve fs doc intro
jasnell Aug 19, 2020
cf34854
deps: upgrade to libuv 1.39.0
cjihrig Aug 25, 2020
a69d30e
module: drop `-u` alias for `--conditions`
richardlau Aug 26, 2020
cd32522
doc: add missing DEP ID for 'new crypto.Certificate()'
BethGriggs Aug 26, 2020
3153c2d
2020-08-27, Version 14.9.0 (Current)
Aug 20, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ module.exports = {
{
files: [
'doc/api/esm.md',
'doc/api/module.md',
'doc/api/modules.md',
'test/es-module/test-esm-type-flag.js',
'test/es-module/test-esm-type-flag-alias.js',
Expand Down
22 changes: 19 additions & 3 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,24 @@
# 3. PRs touching any code with a codeowner must be signed off by at least one
# person on the code owner team.

# tsc & commcomm

/.github/CODEOWNERS @nodejs/tsc
/GOVERNANCE.md @nodejs/tsc
/onboarding.md @nodejs/tsc
/CODE_OF_CONDUCT.md @nodejs/tsc @nodejs/community-committee
/CONTRIBUTING.md @nodejs/tsc @nodejs/community-committee
/LICENSE @nodejs/tsc @nodejs/community-committee
/doc/guides/contributing/code-of-conduct.md @nodejs/tsc @nodejs/community-committee
# TODO(mmarchini): the bot doens't have a notion of precedence, that might
# change when move the codeowners code to an Action, at which point we can
# uncomment the line below
# /doc/guides/contributing/*.md @nodejs/tsc
/doc/guides/contributing/issues.md @nodejs/tsc
/doc/guides/contributing/pull-requests.md @nodejs/tsc
/doc/guides/collaborator-guide.md @nodejs/tsc
/doc/guides/offboarding.md @nodejs/tsc
/doc/guides/onboarding-extras.md @nodejs/tsc

# net

Expand All @@ -21,7 +38,7 @@
/lib/internal/net.js @nodejs/net
/lib/internal/socket_list.js @nodejs/net
/lib/internal/js_stream_socket.js @nodejs/net
/src/cares_wrap.h @nodejs/net
/src/cares_wrap.cc @nodejs/net
/src/connect_wrap.* @nodejs/net
/src/connection_wrap.* @nodejs/net
/src/node_sockaddr* @nodejs/net
Expand All @@ -41,7 +58,6 @@

/deps/llhttp/* @nodejs/http @nodejs/net
/doc/api/http.md @nodejs/http @nodejs/net
/doc/api/http2.md @nodejs/http @nodejs/net
/lib/_http_* @nodejs/http @nodejs/net
/lib/http.js @nodejs/http @nodejs/net
/lib/https.js @nodejs/crypto @nodejs/net @nodejs/http
Expand All @@ -51,7 +67,7 @@
# http2

/deps/nghttp2/* @nodejs/http2 @nodejs/net
/doc/api/http2.md @nodejs/http2 @nodejs/net
/doc/api/http2.md @nodejs/http2 @nodejs/http @nodejs/net
/lib/http2.js @nodejs/http2 @nodejs/net
/lib/internal/http2/* @nodejs/http2 @nodejs/net
/src/node_http2* @nodejs/http2 @nodejs/net
Expand Down
10 changes: 4 additions & 6 deletions .github/workflows/auto-start-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ name: Auto Start CI

on:
schedule:
# `schedule` event is used instead of `pull_request` because when a
# `pull_requesst` event is triggered on a PR from a fork, GITHUB_TOKEN will
# be read-only, and the Action won't have access to any other repository
# secrets, which it needs to access Jenkins API. Runs every five minutes
# (fastest the scheduler can run). Five minutes is optimistic, it can take
# longer to run.
# Runs every five minutes (fastest the scheduler can run). Five minutes is
# optimistic, it can take longer to run.
# To understand why `schedule` is used instead of other events, refer to
# ./doc/guides/commit-queue.md
- cron: "*/5 * * * *"

jobs:
Expand Down
81 changes: 81 additions & 0 deletions .github/workflows/commit-queue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
---
# This action requires the following secrets to be set on the repository:
# GH_USER_NAME: GitHub user whose Jenkins and GitHub token are defined below
# GH_USER_TOKEN: GitHub user token, to be used by ncu and to push changes
# JENKINS_TOKEN: Jenkins token, to be used to check CI status

name: Commit Queue

on:
# `schedule` event is used instead of `pull_request` because when a
# `pull_request` event is triggered on a PR from a fork, GITHUB_TOKEN will
# be read-only, and the Action won't have access to any other repository
# secrets, which it needs to access Jenkins API.
schedule:
- cron: "*/5 * * * *"

jobs:
commitQueue:
if: github.repository == 'nodejs/node'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
# A personal token is required because pushing with GITHUB_TOKEN will
# prevent commits from running CI after they land on master. It needs
# to be set here because `checkout` configures GitHub authentication
# for push as well.
token: ${{ secrets.GH_USER_TOKEN }}

# Install dependencies
- name: Install Node.js
uses: actions/setup-node@v2-beta
with:
node-version: '12'
- name: Install dependencies
run: |
sudo apt-get install jq -y
# TODO(mmarchini): install from npm after next ncu release is out
npm install -g 'https://github.com/mmarchini/node-core-utils#commit-queue-branch'
# npm install -g node-core-utils

- name: Set variables
run: |
echo "::set-env name=REPOSITORY::$(echo ${{ github.repository }} | cut -d/ -f2)"
echo "::set-env name=OWNER::${{ github.repository_owner }}"

- name: Get Pull Requests
uses: octokit/[email protected]
id: get_mergable_pull_requests
with:
query: |
query release($owner:String!,$repo:String!, $base_ref:String!) {
repository(owner:$owner, name:$repo) {
pullRequests(baseRefName: $base_ref, labels: ["commit-queue"], states: OPEN, last: 100) {
nodes {
number
}
}
}
}
owner: ${{ env.OWNER }}
repo: ${{ env.REPOSITORY }}
# Commit queue is only enabled for the default branch on the repository
# TODO(mmarchini): get the default branch programmatically instead of
# assuming `master`
base_ref: "master"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Configure node-core-utils
run: |
ncu-config set branch master
ncu-config set upstream origin
ncu-config set username "${{ secrets.GH_USER_NAME }}"
ncu-config set token "${{ secrets.GH_USER_TOKEN }}"
ncu-config set jenkins_token "${{ secrets.JENKINS_TOKEN }}"
ncu-config set repo "${{ env.REPOSITORY }}"
ncu-config set owner "${{ env.OWNER }}"

- name: Start the commit queue
run: ./tools/actions/commit-queue.sh ${{ env.OWNER }} ${{ env.REPOSITORY }} ${{ secrets.GITHUB_TOKEN }} $(echo '${{ steps.get_mergable_pull_requests.outputs.data }}' | jq '.repository.pullRequests.nodes | map(.number) | .[]')
8 changes: 8 additions & 0 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,11 @@ jobs:
run: |
make lint-py-build || true
NODE=$(which node) make lint-py

lint-codeowners:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: mszostok/[email protected]
with:
checks: "files,duppatterns"
2 changes: 2 additions & 0 deletions .github/workflows/misc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,5 @@ jobs:
with:
name: docs
path: out/doc
- name: Check links
run: node tools/doc/checkLinks.js .
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ _UpgradeReport_Files/
# Ignore dependencies fetched by deps/v8/tools/node/fetch_deps.py
/deps/.cipd

# === Rules for Windows vcbuild.bat ===
/temp-vcbuild

# === Global Rules ===
# Keep last to avoid being excluded
*.pyc
Expand Down
15 changes: 7 additions & 8 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ platforms. This is true regardless of entries in the table below.
| Windows | x64, x86 (WoW64) | >= Windows 8.1/2012 R2 | Tier 1 | <sup>[4](#fn4),[5](#fn5)</sup> |
| Windows | x86 (native) | >= Windows 8.1/2012 R2 | Tier 1 (running) / Experimental (compiling) <sup>[6](#fn6)</sup> | |
| Windows | x64, x86 | Windows Server 2012 (not R2) | Experimental | |
| Windows | arm64 | >= Windows 10 | Experimental | |
| Windows | arm64 | >= Windows 10 | Tier 2 (compiling) / Experimental (running) | |
| macOS | x64 | >= 10.11 | Tier 1 | |
| SmartOS | x64 | >= 18 | Tier 2 | |
| AIX | ppc64be >=power7 | >= 7.2 TL02 | Tier 2 | |
Expand Down Expand Up @@ -237,7 +237,7 @@ test with Python 3.
* GNU Make 3.81 or newer
* Python (see note above)
* Python 2.7
* Python 3.5, 3.6, 3.7, and 3.8.
* Python 3.5, 3.6, 3.7, and 3.8

Installation via Linux package manager can be achieved with:

Expand All @@ -256,7 +256,7 @@ Python 3 users may also need to install `python3-distutils`.
* Xcode Command Line Tools >= 10 for macOS
* Python (see note above)
* Python 2.7
* Python 3.5, 3.6, 3.7, and 3.8.
* Python 3.5, 3.6, 3.7, and 3.8

macOS users can install the `Xcode Command Line Tools` by running
`xcode-select --install`. Alternatively, if you already have the full Xcode
Expand Down Expand Up @@ -531,7 +531,7 @@ to run it again before invoking `make -j4`.
[Visual Studio 2017 or 2019](https://visualstudio.microsoft.com/downloads/) or
the "Visual C++ build tools" workload from the
[Build Tools](https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2019),
with the default optional components.
with the default optional components
* Basic Unix tools required for some tests,
[Git for Windows](https://git-scm.com/download/win) includes Git Bash
and tools which can be included in the global `PATH`.
Expand All @@ -545,12 +545,11 @@ Optional requirements to build the MSI installer package:
* The [WiX Toolset v3.11](https://wixtoolset.org/releases/) and the
[Wix Toolset Visual Studio 2017 Extension](https://marketplace.visualstudio.com/items?itemName=RobMensching.WixToolsetVisualStudio2017Extension)
or the [Wix Toolset Visual Studio 2019 Extension](https://marketplace.visualstudio.com/items?itemName=WixToolset.WixToolsetVisualStudio2019Extension).
* The [WiX Toolset v3.14](https://wixtoolset.org/releases/) if
building for Windows 10 on ARM (ARM64)

Optional requirements for compiling for Windows 10 on ARM (ARM64):

* ARM64 Windows build machine
* Due to a GYP limitation, this is required to run compiled code
generation tools (like V8's builtins and mksnapshot tools)
* Visual Studio 15.9.0 or newer
* Visual Studio optional components
* Visual C++ compilers and libraries for ARM64
Expand All @@ -565,7 +564,7 @@ This script will install the following [Chocolatey](https://chocolatey.org/)
packages:

* [Git for Windows](https://chocolatey.org/packages/git) with the `git` and
Unix tools added to the `PATH`.
Unix tools added to the `PATH`
* [Python 3.x](https://chocolatey.org/packages/python) and
[legacy Python](https://chocolatey.org/packages/python2)
* [Visual Studio 2019 Build Tools](https://chocolatey.org/packages/visualstudio2019buildtools)
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ release.
</tr>
<tr>
<td valign="top">
<b><a href="doc/changelogs/CHANGELOG_V14.md#14.8.0">14.8.0</a></b><br/>
<b><a href="doc/changelogs/CHANGELOG_V14.md#14.9.0">14.9.0</a></b><br/>
<a href="doc/changelogs/CHANGELOG_V14.md#14.8.0">14.8.0</a><br/>
<a href="doc/changelogs/CHANGELOG_V14.md#14.7.0">14.7.0</a><br/>
<a href="doc/changelogs/CHANGELOG_V14.md#14.6.0">14.6.0</a><br/>
<a href="doc/changelogs/CHANGELOG_V14.md#14.5.0">14.5.0</a><br/>
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1268,7 +1268,7 @@ LINT_CPP_EXCLUDE += $(wildcard test/js-native-api/??_*/*.cc test/js-native-api/?
LINT_CPP_EXCLUDE += src/tracing/trace_event.h src/tracing/trace_event_common.h

LINT_CPP_FILES = $(filter-out $(LINT_CPP_EXCLUDE), $(wildcard \
benchmark/napi/function_call/binding.cc \
benchmark/napi/*/*.cc \
src/*.c \
src/*.cc \
src/*.h \
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,6 @@ For information about the governance of the Node.js project, see
### TSC (Technical Steering Committee)

<!--lint disable prohibited-strings-->
* [addaleax](https://github.com/addaleax) -
**Anna Henningsen** &lt;[email protected]&gt; (she/her)
* [apapirovski](https://github.com/apapirovski) -
**Anatoli Papirovski** &lt;[email protected]&gt; (he/him)
* [BethGriggs](https://github.com/BethGriggs) -
Expand Down Expand Up @@ -196,6 +194,8 @@ For information about the governance of the Node.js project, see

### TSC Emeriti

* [addaleax](https://github.com/addaleax) -
**Anna Henningsen** &lt;[email protected]&gt; (she/her)
* [bnoordhuis](https://github.com/bnoordhuis) -
**Ben Noordhuis** &lt;[email protected]&gt;
* [chrisdickinson](https://github.com/chrisdickinson) -
Expand Down
32 changes: 16 additions & 16 deletions benchmark/napi/function_args/binding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@
#include <node.h>
#include <assert.h>

using v8::Isolate;
using v8::Array;
using v8::ArrayBuffer;
using v8::ArrayBufferView;
using v8::BackingStore;
using v8::Context;
using v8::FunctionCallbackInfo;
using v8::Isolate;
using v8::Local;
using v8::MaybeLocal;
using v8::Value;
using v8::Number;
using v8::String;
using v8::Object;
using v8::Array;
using v8::ArrayBufferView;
using v8::ArrayBuffer;
using v8::FunctionCallbackInfo;
using v8::String;
using v8::Uint32;
using v8::Value;

void CallWithString(const FunctionCallbackInfo<Value>& args) {
assert(args.Length() == 1 && args[0]->IsString());
Expand All @@ -22,7 +24,7 @@ void CallWithString(const FunctionCallbackInfo<Value>& args) {
const int32_t length = str->Utf8Length(args.GetIsolate()) + 1;
char* buf = new char[length];
str->WriteUtf8(args.GetIsolate(), buf, length);
delete [] buf;
delete[] buf;
}
}

Expand All @@ -31,7 +33,7 @@ void CallWithArray(const FunctionCallbackInfo<Value>& args) {
if (args.Length() == 1 && args[0]->IsArray()) {
const Local<Array> array = args[0].As<Array>();
uint32_t length = array->Length();
for (uint32_t i = 0; i < length; ++ i) {
for (uint32_t i = 0; i < length; i++) {
Local<Value> v;
v = array->Get(args.GetIsolate()->GetCurrentContext(),
i).ToLocalChecked();
Expand Down Expand Up @@ -101,24 +103,22 @@ void CallWithTypedarray(const FunctionCallbackInfo<Value>& args) {
const size_t byte_length = view->ByteLength();
assert(byte_length > 0);
assert(view->HasBuffer());
Local<ArrayBuffer> buffer;
buffer = view->Buffer();
ArrayBuffer::Contents contents;
contents = buffer->GetContents();
Local<ArrayBuffer> buffer = view->Buffer();
std::shared_ptr<BackingStore> bs = buffer->GetBackingStore();
const uint32_t* data = reinterpret_cast<uint32_t*>(
static_cast<uint8_t*>(contents.Data()) + byte_offset);
static_cast<uint8_t*>(bs->Data()) + byte_offset);
assert(data);
}
}

void CallWithArguments(const FunctionCallbackInfo<Value>& args) {
assert(args.Length() > 1 && args[0]->IsNumber());
if (args.Length() > 1 && args[0]->IsNumber()) {
int32_t loop = args[0].As<v8::Uint32>()->Value();
int32_t loop = args[0].As<Uint32>()->Value();
for (int32_t i = 1; i < loop; ++i) {
assert(i < args.Length());
assert(args[i]->IsUint32());
args[i].As<v8::Uint32>()->Value();
args[i].As<Uint32>()->Value();
}
}
}
Expand Down
14 changes: 14 additions & 0 deletions benchmark/process/resourceUsage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
'use strict';

const common = require('../common.js');
const bench = common.createBenchmark(main, {
n: [1e5]
});

function main({ n }) {
bench.start();
for (let i = 0; i < n; i++) {
process.resourceUsage();
}
bench.end(n);
}
5 changes: 4 additions & 1 deletion common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

# Reset this number to 0 on major V8 upgrades.
# Increment by one for each non-official patch applied to deps/v8.
'v8_embedder_string': '-node.12',
'v8_embedder_string': '-node.13',

##### V8 defaults for Node.js #####

Expand All @@ -54,6 +54,9 @@
# Enable disassembler for `--print-code` v8 options
'v8_enable_disassembler': 1,

# Sets -dOBJECT_PRINT.
'v8_enable_object_print%': 1,

# https://github.com/nodejs/node/pull/22920/files#r222779926
'v8_enable_handle_zapping': 0,

Expand Down
Loading