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

v15.7.0 proposal #37020

Merged
merged 81 commits into from Jan 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
02a8f52
doc: fix indentation on http2 doc entry
Trott Jan 10, 2021
c4cdf1d
fs: allow `position` parameter to be a `BigInt` in read and readSync
RaisinTen Nov 20, 2020
0398167
crypto: fix WebCrypto import of RSA-PSS keys
tniessen Jan 11, 2021
bf695eb
worker: refactor to avoid unsafe array iteration
aduh95 Dec 31, 2020
0d71947
vm: refactor to avoid unsafe array iteration
aduh95 Dec 31, 2020
1ef92f6
lib: refactor source_map to avoid unsafe array iteration
aduh95 Dec 31, 2020
403b595
zlib: refactor to avoid unsafe array iteration
aduh95 Dec 31, 2020
b86c48c
lib: refactor source_map to use more primordials
aduh95 Dec 31, 2020
70cd43c
doc: change "it's" to "its" where necessary
tniessen Jan 13, 2021
82eccdd
doc: update fs.l/statSync API history for throwIfNoEntry
amcasey Jan 12, 2021
1149af6
crypto: add keyObject.asymmetricKeyDetails for asymmetric keys
panva Nov 20, 2020
f99b38f
doc: wrap TOC in a <details> tag
Jan 12, 2021
5cbf638
doc: remove unnecessary contributing.md section
Trott Jan 12, 2021
b7d8e61
crypto: fix randomInt bias
tniessen Jan 12, 2021
e73b107
doc: update tls test to use better terminology
mhdawson Jan 8, 2021
864b97b
tls: use recently added matching SecureContext in default SNICallback
mkrawczuk Aug 5, 2020
80c84a1
doc: add miladfarca to collaborators
miladfarca Jan 14, 2021
22e29cc
doc: add alternative version links to the packages page
panva Jan 13, 2021
30b2aac
test: fix variable name for non-RSA keys
tniessen Jan 13, 2021
c2ec15a
test: check mustCall errors in test-fs-read-type
tniessen Jan 13, 2021
f5b8e7b
http2: refactor to avoid unsafe array iteration
aduh95 Dec 29, 2020
aa3bc74
doc: fixup typo in metadata entry
jasnell Jan 15, 2021
5a9a07e
doc: add iansu to collaborators
iansu Jan 15, 2021
8dc8adc
tools: add support for top-level await syntax in linter
aduh95 Jan 8, 2021
707b973
doc: use ESM syntax for WASI example
aduh95 Jan 8, 2021
7a79441
doc: remove resolving-a-bug-report from contributing docs
Trott Jan 13, 2021
eaf378a
doc: remove issue template duplication from contributing docs
Trott Jan 13, 2021
80051ab
http: cleanup ClientRequest oncreate
ronag Jan 10, 2021
aa7243e
http: refactor ClientRequest destroy
ronag Jan 10, 2021
99c1590
test: fixup flaky test-crypto-x509 on windows
jasnell Jan 16, 2021
3ea37c2
doc: fix invalid HTML in doc template
Trott Jan 14, 2021
64fed31
url: expose urlToHttpOptions utility
ZYSzys Jan 6, 2021
850d357
lib: refactor `primordials.makeSafe` to use more primordials
ExE-Boss Jan 10, 2021
f2ac4bb
lib: expose primordials object
aduh95 Jan 15, 2021
8a82415
Revert "test: mark test-cluster-bind-privileged-port flaky on arm"
rvagg Jan 12, 2021
f589bb2
test: improve coverage at `lib/internal/vm/module.js`
juanarbol Jan 12, 2021
889654d
url: align url format behavior with browsers
Lxxyx Jan 13, 2021
8cf280d
doc: improve perf_hooks docs
juanarbol Jan 13, 2021
3bbe9a5
test: improve coverage on worker threads
juanarbol Jan 13, 2021
c7dd9c8
test: skip internet for test-npm-install
ruyadorno Jan 14, 2021
af0f0a0
doc: fix percentile range in perf_hooks.md
RaisinTen Jan 15, 2021
ba87be0
test: improve coverage for `Module` getters
juanarbol Jan 15, 2021
832cd01
buffer: add base64url encoding option
panva Jan 15, 2021
6f773fb
deps: upgrade npm to 7.4.2
ruyadorno Jan 15, 2021
8e02b53
tools: update ESLint to 7.18.0
cjihrig Jan 15, 2021
120db2c
doc: fix grammar and link to QUIC in changelog
dandv Jan 16, 2021
48b6781
doc: fix crypto.generateKeySync aes allowed length list
panva Jan 14, 2021
ca479b9
deps: V8: cherry-pick fe191e8d05cc
bcoe Jan 16, 2021
d2d9ad7
doc: fix module.isPreloading documentation
aduh95 Jan 15, 2021
dc596d0
events: remove error listener on signal abort
Lxxyx Jan 16, 2021
f3637d5
doc: remove pull-requests.md preamble
Trott Jan 16, 2021
7ea374b
doc: clarify maxSockets option of http.Agent
PoojaDurgad Jan 15, 2021
5290d63
module: simplify tryStatSync with throwIfNoEntry option
aduh95 Jan 16, 2021
93fc295
doc: add performance notes for fs.readFile
jasnell Jan 11, 2021
9951dae
repl: refactor to avoid unsafe array iteration
RaisinTen Dec 28, 2020
3f75a60
perf_hooks: throw ERR_INVALID_ARG_VALUE if histogram.percentile param…
Lxxyx Jan 15, 2021
98369aa
test: remove unused ecdhPeerKey
danbev Jan 15, 2021
8d49ce9
test: fix warning in test_environment.cc
RaisinTen Jan 8, 2021
89a7941
os: performance improvement in vector allocation
yashLadha Jan 3, 2021
2f1f1da
test: increase buffer list coverage
emilsivervik Dec 30, 2020
fada6b0
test,benchmark: stop requiring URL and URLSearchParams
RaisinTen Jan 14, 2021
775b34b
buffer: introduce Blob
jasnell Jan 5, 2021
e69c4a9
test: add wpt tests for Blob
targos Jan 6, 2021
f07e1c9
http: abortIncoming only on socket close
ronag Jan 6, 2021
d549985
src: use BaseObject::kInternalFieldCount in X509Certificate constructor
joyeecheung Jan 12, 2021
4d5273b
doc: fix typo in http.server.requestTimout docs
alexbs Jan 18, 2021
a5ffdae
src: replace push_back with emplace_back in debug_utils
RaisinTen Jan 12, 2021
70ee7dc
http: attach request as res.req
ianstormtaylor Dec 14, 2020
7ce7404
build: fix compiling against openssl with no-psk
Jan 11, 2021
743dd8f
lib: remove non used getter in `lib/perf_hooks.js`
juanarbol Jan 13, 2021
7acea78
test: mark flaky tests on IBM i
richardlau Jan 18, 2021
a2559b9
doc: add @RaisinTen to collaborators
RaisinTen Jan 19, 2021
17bdcd9
tools,doc: list the stability status of each API
Lxxyx Nov 22, 2020
f270417
util: prefer `Reflect.ownKeys(…)`
ExE-Boss Jan 2, 2021
868d3b2
src: use BaseObject::kInteralFieldCount in Blob
joyeecheung Jan 19, 2021
ef3a5f6
deps: update ICU to 68.2
targos Jan 18, 2021
4b952d8
doc: fix maintaining ICU guide
targos Jan 18, 2021
6ef54bb
tools: cleanup old ICU version-specific fixes
targos Jan 18, 2021
8aeba3c
lib: refactor to use validateArray
Lxxyx Jan 18, 2021
e52e860
deps: upgrade npm to 7.4.3
ruyadorno Jan 21, 2021
2c0edbc
2021-01-26, Version 15.7.0 (Current)
ruyadorno Jan 22, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
7 changes: 6 additions & 1 deletion .eslintrc.js
Expand Up @@ -18,6 +18,7 @@ const hacks = [
'eslint-plugin-markdown',
'@babel/eslint-parser',
'@babel/plugin-syntax-class-properties',
'@babel/plugin-syntax-top-level-await',
];
Module._findPath = (request, paths, isMain) => {
const r = ModuleFindPath(request, paths, isMain);
Expand All @@ -41,7 +42,10 @@ module.exports = {
parser: '@babel/eslint-parser',
parserOptions: {
babelOptions: {
plugins: [Module._findPath('@babel/plugin-syntax-class-properties')],
plugins: [
Module._findPath('@babel/plugin-syntax-class-properties'),
Module._findPath('@babel/plugin-syntax-top-level-await'),
],
},
requireConfigFile: false,
sourceType: 'script',
Expand All @@ -53,6 +57,7 @@ module.exports = {
'doc/api/module.md',
'doc/api/modules.md',
'doc/api/packages.md',
'doc/api/wasi.md',
'test/es-module/test-esm-type-flag.js',
'test/es-module/test-esm-type-flag-alias.js',
'*.mjs',
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Expand Up @@ -32,7 +32,8 @@ release.
</tr>
<tr>
<td valign="top">
<b><a href="doc/changelogs/CHANGELOG_V15.md#15.6.0">15.6.0</a></b><br/>
<b><a href="doc/changelogs/CHANGELOG_V15.md#15.7.0">15.7.0</a></b><br/>
<a href="doc/changelogs/CHANGELOG_V15.md#15.6.0">15.6.0</a><br/>
<a href="doc/changelogs/CHANGELOG_V15.md#15.5.1">15.5.1</a><br/>
<a href="doc/changelogs/CHANGELOG_V15.md#15.5.0">15.5.0</a><br/>
<a href="doc/changelogs/CHANGELOG_V15.md#15.4.0">15.4.0</a><br/>
Expand Down
2 changes: 0 additions & 2 deletions CONTRIBUTING.md
Expand Up @@ -15,12 +15,10 @@ See [details on our policy on Code of Conduct](./doc/guides/contributing/code-of

## [Issues](./doc/guides/contributing/issues.md)

* [How to Contribute in Issues](./doc/guides/contributing/issues.md#how-to-contribute-in-issues)
* [Asking for General Help](./doc/guides/contributing/issues.md#asking-for-general-help)
* [Discussing non-technical topics](./doc/guides/contributing/issues.md#discussing-non-technical-topics)
* [Submitting a Bug Report](./doc/guides/contributing/issues.md#submitting-a-bug-report)
* [Triaging a Bug Report](./doc/guides/contributing/issues.md#triaging-a-bug-report)
* [Resolving a Bug Report](./doc/guides/contributing/issues.md#resolving-a-bug-report)

## [Pull Requests](./doc/guides/contributing/pull-requests.md)

Expand Down
6 changes: 5 additions & 1 deletion Makefile
Expand Up @@ -696,7 +696,7 @@ doc-only: tools/doc/node_modules \
@if [ "$(shell $(node_use_openssl))" != "true" ]; then \
echo "Skipping doc-only (no crypto)"; \
else \
$(MAKE) out/doc/api/all.html out/doc/api/all.json; \
$(MAKE) out/doc/api/all.html out/doc/api/all.json out/doc/api/stability; \
fi

.PHONY: doc
Expand Down Expand Up @@ -749,6 +749,10 @@ out/doc/api/all.html: $(apidocs_html) tools/doc/allhtml.js \
out/doc/api/all.json: $(apidocs_json) tools/doc/alljson.js | out/doc/api
$(call available-node, tools/doc/alljson.js)

.PHONY: out/doc/api/stability
out/doc/api/stability: out/doc/api/all.json tools/doc/stability.js | out/doc/api
$(call available-node, tools/doc/stability.js)

.PHONY: docopen
docopen: out/doc/api/all.html
@$(PYTHON) -mwebbrowser file://$(abspath $<)
Expand Down
6 changes: 6 additions & 0 deletions README.md
Expand Up @@ -325,6 +325,8 @@ For information about the governance of the Node.js project, see
**Zeyu Yang** &lt;himself65@outlook.com&gt; (he/him)
* [hiroppy](https://github.com/hiroppy) -
**Yuta Hiroto** &lt;hello@hiroppy.me&gt; (he/him)
* [iansu](https://github.com/iansu) -
**Ian Sutherland** &lt;ian@iansutherland.ca&gt;
* [indutny](https://github.com/indutny) -
**Fedor Indutny** &lt;fedor.indutny@gmail.com&gt;
* [JacksonTian](https://github.com/JacksonTian) -
Expand Down Expand Up @@ -359,6 +361,8 @@ For information about the governance of the Node.js project, see
**Matteo Collina** &lt;matteo.collina@gmail.com&gt; (he/him)
* [mhdawson](https://github.com/mhdawson) -
**Michael Dawson** &lt;midawson@redhat.com&gt; (he/him)
* [miladfarca](https://github.com/miladfarca) -
**Milad Fa** &lt;mfarazma@redhat.com&gt; (he/him)
* [mildsunrise](https://github.com/mildsunrise) -
**Alba Mendez** &lt;me@alba.sh&gt; (she/her)
* [misterdjules](https://github.com/misterdjules) -
Expand All @@ -383,6 +387,8 @@ For information about the governance of the Node.js project, see
**Andrey Pechkurov** &lt;apechkurov@gmail.com&gt; (he/him)
* [Qard](https://github.com/Qard) -
**Stephen Belanger** &lt;admin@stephenbelanger.com&gt; (he/him)
* [RaisinTen](https://github.com/RaisinTen) -
**Darshan Sen** &lt;raisinten@gmail.com&gt; (he/him)
* [refack](https://github.com/refack) -
**Refael Ackermann (רפאל פלחי)** &lt;refack@gmail.com&gt; (he/him/הוא/אתה)
* [rexagod](https://github.com/rexagod) -
Expand Down
1 change: 0 additions & 1 deletion benchmark/url/legacy-vs-whatwg-url-searchparams-parse.js
@@ -1,6 +1,5 @@
'use strict';
const common = require('../common.js');
const { URLSearchParams } = require('url');
const querystring = require('querystring');
const searchParams = common.searchParams;

Expand Down
@@ -1,6 +1,5 @@
'use strict';
const common = require('../common.js');
const { URLSearchParams } = require('url');
const querystring = require('querystring');
const searchParams = common.searchParams;

Expand Down
1 change: 0 additions & 1 deletion benchmark/url/url-searchparams-iteration.js
@@ -1,7 +1,6 @@
'use strict';
const common = require('../common.js');
const assert = require('assert');
const { URLSearchParams } = require('url');

const bench = common.createBenchmark(main, {
loopMethod: ['forEach', 'iterator'],
Expand Down
1 change: 0 additions & 1 deletion benchmark/url/url-searchparams-read.js
@@ -1,6 +1,5 @@
'use strict';
const common = require('../common.js');
const { URLSearchParams } = require('url');

const bench = common.createBenchmark(main, {
accessMethod: ['get', 'getAll', 'has'],
Expand Down
1 change: 0 additions & 1 deletion benchmark/url/url-searchparams-sort.js
@@ -1,6 +1,5 @@
'use strict';
const common = require('../common.js');
const URLSearchParams = require('url').URLSearchParams;

const inputs = {
wpt: 'wpt', // To work around tests
Expand Down
14 changes: 8 additions & 6 deletions deps/icu-small/source/common/cmemory.h
Expand Up @@ -725,9 +725,14 @@ class MemoryPool : public UMemory {
}

MemoryPool& operator=(MemoryPool&& other) U_NOEXCEPT {
fCount = other.fCount;
fPool = std::move(other.fPool);
other.fCount = 0;
// Since `this` may contain instances that need to be deleted, we can't
// just throw them away and replace them with `other`. The normal way of
// dealing with this in C++ is to swap `this` and `other`, rather than
// simply overwrite: the destruction of `other` can then take care of
// running MemoryPool::~MemoryPool() over the still-to-be-deallocated
// instances.
std::swap(fCount, other.fCount);
std::swap(fPool, other.fPool);
return *this;
}

Expand Down Expand Up @@ -796,9 +801,6 @@ class MemoryPool : public UMemory {
template<typename T, int32_t stackCapacity = 8>
class MaybeStackVector : protected MemoryPool<T, stackCapacity> {
public:
using MemoryPool<T, stackCapacity>::MemoryPool;
using MemoryPool<T, stackCapacity>::operator=;

template<typename... Args>
T* emplaceBack(Args&&... args) {
return this->create(args...);
Expand Down
33 changes: 22 additions & 11 deletions deps/icu-small/source/common/locid.cpp
Expand Up @@ -35,6 +35,7 @@

#include "unicode/bytestream.h"
#include "unicode/locid.h"
#include "unicode/localebuilder.h"
#include "unicode/strenum.h"
#include "unicode/stringpiece.h"
#include "unicode/uloc.h"
Expand Down Expand Up @@ -1028,7 +1029,7 @@ class AliasReplacer {
// place the the replaced locale ID in out and return true.
// Otherwise return false for no replacement or error.
bool replace(
const Locale& locale, CharString& out, UErrorCode status);
const Locale& locale, CharString& out, UErrorCode& status);

private:
const char* language;
Expand Down Expand Up @@ -1336,10 +1337,13 @@ AliasReplacer::replaceTerritory(UVector& toBeFreed, UErrorCode& status)
// Cannot use nullptr for language because that will construct
// the default locale, in that case, use "und" to get the correct
// locale.
Locale l(language == nullptr ? "und" : language, nullptr, script);
Locale l = LocaleBuilder()
.setLanguage(language == nullptr ? "und" : language)
.setScript(script)
.build(status);
l.addLikelySubtags(status);
const char* likelyRegion = l.getCountry();
CharString* item = nullptr;
LocalPointer<CharString> item;
if (likelyRegion != nullptr && uprv_strlen(likelyRegion) > 0) {
size_t len = uprv_strlen(likelyRegion);
const char* foundInReplacement = uprv_strstr(replacement,
Expand All @@ -1351,20 +1355,22 @@ AliasReplacer::replaceTerritory(UVector& toBeFreed, UErrorCode& status)
*(foundInReplacement-1) == ' ');
U_ASSERT(foundInReplacement[len] == ' ' ||
foundInReplacement[len] == '\0');
item = new CharString(foundInReplacement, (int32_t)len, status);
item.adoptInsteadAndCheckErrorCode(
new CharString(foundInReplacement, (int32_t)len, status), status);
}
}
if (item == nullptr) {
item = new CharString(replacement,
(int32_t)(firstSpace - replacement), status);
if (item.isNull() && U_SUCCESS(status)) {
item.adoptInsteadAndCheckErrorCode(
new CharString(replacement,
(int32_t)(firstSpace - replacement), status), status);
}
if (U_FAILURE(status)) { return false; }
if (item == nullptr) {
if (item.isNull()) {
status = U_MEMORY_ALLOCATION_ERROR;
return false;
}
replacedRegion = item->data();
toBeFreed.addElement(item, status);
toBeFreed.addElement(item.orphan(), status);
}
U_ASSERT(!same(region, replacedRegion));
region = replacedRegion;
Expand Down Expand Up @@ -1453,7 +1459,7 @@ AliasReplacer::outputToString(
int32_t variantsStart = out.length();
for (int32_t i = 0; i < variants.size(); i++) {
out.append(SEP_CHAR, status)
.append((const char*)((UVector*)variants.elementAt(i)),
.append((const char*)(variants.elementAt(i)),
status);
}
T_CString_toUpperCase(out.data() + variantsStart);
Expand All @@ -1470,7 +1476,7 @@ AliasReplacer::outputToString(
}

bool
AliasReplacer::replace(const Locale& locale, CharString& out, UErrorCode status)
AliasReplacer::replace(const Locale& locale, CharString& out, UErrorCode& status)
{
data = AliasData::singleton(status);
if (U_FAILURE(status)) {
Expand Down Expand Up @@ -2453,9 +2459,13 @@ Locale::setKeywordValue(const char* keywordName, const char* keywordValue, UErro
if (U_FAILURE(status)) {
return;
}
if (status == U_STRING_NOT_TERMINATED_WARNING) {
status = U_ZERO_ERROR;
}
int32_t bufferLength = uprv_max((int32_t)(uprv_strlen(fullName) + 1), ULOC_FULLNAME_CAPACITY);
int32_t newLength = uloc_setKeywordValue(keywordName, keywordValue, fullName,
bufferLength, &status) + 1;
U_ASSERT(status != U_STRING_NOT_TERMINATED_WARNING);
/* Handle the case the current buffer is not enough to hold the new id */
if (status == U_BUFFER_OVERFLOW_ERROR) {
U_ASSERT(newLength > bufferLength);
Expand All @@ -2472,6 +2482,7 @@ Locale::setKeywordValue(const char* keywordName, const char* keywordValue, UErro
fullName = newFullName;
status = U_ZERO_ERROR;
uloc_setKeywordValue(keywordName, keywordValue, fullName, newLength, &status);
U_ASSERT(status != U_STRING_NOT_TERMINATED_WARNING);
} else {
U_ASSERT(newLength <= bufferLength);
}
Expand Down
18 changes: 10 additions & 8 deletions deps/icu-small/source/common/rbbitblb.cpp
Expand Up @@ -1402,12 +1402,13 @@ void RBBITableBuilder::exportTable(void *where) {
U_ASSERT (sd->fAccepting <= 255);
U_ASSERT (sd->fLookAhead <= 255);
U_ASSERT (0 <= sd->fTagsIdx && sd->fTagsIdx <= 255);
row->r8.fAccepting = sd->fAccepting;
row->r8.fLookAhead = sd->fLookAhead;
row->r8.fTagsIdx = sd->fTagsIdx;
RBBIStateTableRow8 *r8 = (RBBIStateTableRow8*)row;
r8->fAccepting = sd->fAccepting;
r8->fLookAhead = sd->fLookAhead;
r8->fTagsIdx = sd->fTagsIdx;
for (col=0; col<catCount; col++) {
U_ASSERT (sd->fDtran->elementAti(col) <= kMaxStateFor8BitsTable);
row->r8.fNextState[col] = sd->fDtran->elementAti(col);
r8->fNextState[col] = sd->fDtran->elementAti(col);
}
} else {
U_ASSERT (sd->fAccepting <= 0xffff);
Expand Down Expand Up @@ -1603,12 +1604,13 @@ void RBBITableBuilder::exportSafeTable(void *where) {
UnicodeString *rowString = (UnicodeString *)fSafeTable->elementAt(state);
RBBIStateTableRow *row = (RBBIStateTableRow *)(table->fTableData + state*table->fRowLen);
if (use8BitsForSafeTable()) {
row->r8.fAccepting = 0;
row->r8.fLookAhead = 0;
row->r8.fTagsIdx = 0;
RBBIStateTableRow8 *r8 = (RBBIStateTableRow8*)row;
r8->fAccepting = 0;
r8->fLookAhead = 0;
r8->fTagsIdx = 0;
for (col=0; col<catCount; col++) {
U_ASSERT(rowString->charAt(col) <= kMaxStateFor8BitsTable);
row->r8.fNextState[col] = static_cast<uint8_t>(rowString->charAt(col));
r8->fNextState[col] = static_cast<uint8_t>(rowString->charAt(col));
}
} else {
row->r16.fAccepting = 0;
Expand Down
21 changes: 20 additions & 1 deletion deps/icu-small/source/common/uloc.cpp
Expand Up @@ -877,6 +877,9 @@ uloc_setKeywordValue(const char* keywordName,
if(U_FAILURE(*status)) {
return -1;
}
if (*status == U_STRING_NOT_TERMINATED_WARNING) {
*status = U_ZERO_ERROR;
}
if (keywordName == NULL || keywordName[0] == 0 || bufferCapacity <= 1) {
*status = U_ILLEGAL_ARGUMENT_ERROR;
return 0;
Expand Down Expand Up @@ -914,6 +917,7 @@ uloc_setKeywordValue(const char* keywordName,
startSearchHere = (char*)locale_getKeywordsStart(buffer);
if(startSearchHere == NULL || (startSearchHere[1]==0)) {
if(keywordValueLen == 0) { /* no keywords = nothing to remove */
U_ASSERT(*status != U_STRING_NOT_TERMINATED_WARNING);
return bufLen;
}

Expand All @@ -933,6 +937,7 @@ uloc_setKeywordValue(const char* keywordName,
startSearchHere += keywordNameLen;
*startSearchHere++ = '=';
uprv_strcpy(startSearchHere, keywordValueBuffer);
U_ASSERT(*status != U_STRING_NOT_TERMINATED_WARNING);
return needLen;
} /* end shortcut - no @ */

Expand Down Expand Up @@ -1047,13 +1052,27 @@ uloc_setKeywordValue(const char* keywordName,
if (!handledInputKeyAndValue || U_FAILURE(*status)) {
/* if input key/value specified removal of a keyword not present in locale, or
* there was an error in CharString.append, leave original locale alone. */
U_ASSERT(*status != U_STRING_NOT_TERMINATED_WARNING);
return bufLen;
}

// needLen = length of the part before '@'
needLen = (int32_t)(startSearchHere - buffer);
return needLen + updatedKeysAndValues.extract(
// Check to see can we fit the startSearchHere, if not, return
// U_BUFFER_OVERFLOW_ERROR without copy updatedKeysAndValues into it.
// We do this because this API function does not behave like most others:
// It promises never to set a U_STRING_NOT_TERMINATED_WARNING.
// When the contents fits but without the terminating NUL, in this case we need to not change
// the buffer contents and return with a buffer overflow error.
int32_t appendLength = updatedKeysAndValues.length();
if (appendLength >= bufferCapacity - needLen) {
*status = U_BUFFER_OVERFLOW_ERROR;
return needLen + appendLength;
}
needLen += updatedKeysAndValues.extract(
startSearchHere, bufferCapacity - needLen, *status);
U_ASSERT(*status != U_STRING_NOT_TERMINATED_WARNING);
return needLen;
}

/* ### ID parsing implementation **************************************************/
Expand Down
5 changes: 5 additions & 0 deletions deps/icu-small/source/common/unicode/docmain.h
Expand Up @@ -143,6 +143,11 @@
* <td>icu::MessageFormat</td>
* </tr>
* <tr>
* <td>List Formatting</td>
* <td>ulistformatter.h</td>
* <td>icu::ListFormatter</td>
* </tr>
* <tr>
* <td>Number Formatting<br/>(includes currency and unit formatting)</td>
* <td>unumberformatter.h, unum.h</td>
* <td>icu::number::NumberFormatter (ICU 60+) or icu::NumberFormat (older versions)</td>
Expand Down
1 change: 1 addition & 0 deletions deps/icu-small/source/common/unicode/urename.h
Expand Up @@ -1137,6 +1137,7 @@
#define ulocimp_toLanguageTag U_ICU_ENTRY_POINT_RENAME(ulocimp_toLanguageTag)
#define ulocimp_toLegacyKey U_ICU_ENTRY_POINT_RENAME(ulocimp_toLegacyKey)
#define ulocimp_toLegacyType U_ICU_ENTRY_POINT_RENAME(ulocimp_toLegacyType)
#define ultag_getTKeyStart U_ICU_ENTRY_POINT_RENAME(ultag_getTKeyStart)
#define ultag_isExtensionSubtags U_ICU_ENTRY_POINT_RENAME(ultag_isExtensionSubtags)
#define ultag_isLanguageSubtag U_ICU_ENTRY_POINT_RENAME(ultag_isLanguageSubtag)
#define ultag_isPrivateuseValueSubtags U_ICU_ENTRY_POINT_RENAME(ultag_isPrivateuseValueSubtags)
Expand Down