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

v18.2.0 proposal #43036

Merged
merged 81 commits into from
May 17, 2022
Merged
Changes from 1 commit
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
72b90fd
test: reduce impact of flaky HTTP server tests
tniessen May 2, 2022
924670f
doc: clarify some default values in `fs.md`
LiviaMedeiros May 2, 2022
183bcc0
crypto: clean up parameter validation in HKDF
tniessen May 2, 2022
88692d8
doc: add section regarding property definition in `primordials.md`
aduh95 May 2, 2022
e74a8da
assert: make `assert.fail` less affected by prototype tampering
aduh95 May 2, 2022
9ee7d9e
bootstrap: fix wasm_web_api external reference registration
joyeecheung May 2, 2022
bfbf965
http2: compat support for array headers
y1d7ng May 2, 2022
68ed3c8
test: add test for position validation in fs.read() and fs.readSync()
LiviaMedeiros May 2, 2022
784d84c
fs: add `read(buffer[, options])` versions
LiviaMedeiros May 2, 2022
1237c74
doc: add additional step to security release process
mhdawson Apr 29, 2022
cacff07
src: fix memory leak for v8.serialize
liuxingbaoyu May 2, 2022
1fbfee2
doc: fix examples in cluster.md
y1d7ng May 2, 2022
3ab3086
doc: fix errors in Web Streams doc
y1d7ng May 3, 2022
2f192c4
http: added connection closing methods
ShogunPanda Apr 28, 2022
56c47b5
test: use consistent timeouts
ShogunPanda Apr 28, 2022
d746207
test: fix test-crypto-fips.js under shared OpenSSL
May 2, 2022
19c060f
crypto: adjust minimum length in generateKey('hmac', ...)
LiviaMedeiros May 4, 2022
8cfc18e
src,crypto: remove uses of AllocatedBuffer from crypto_rsa.cc
RaisinTen May 4, 2022
2df1624
deps: upgrade npm to 8.9.0
npm-robot May 5, 2022
a20310d
bootstrap: use a context snapshotted with primordials in workers
joyeecheung May 5, 2022
2dc7956
test: improve `lib/internal/webstreams/readablestream.js` coverage
fossamagna May 5, 2022
b1c18ed
test: use`mustSucceed` instead of `mustCall` with `assert.ifError`
fossamagna May 5, 2022
d23debb
test: validate webstream encoder/decoder inspector
kuriyosh May 5, 2022
e058f47
test: improve observable ICU behaviour coverage
LiviaMedeiros May 5, 2022
1146806
bootstrap: stop delaying instantiation of maps in per-context scripts
RaisinTen May 5, 2022
41d2f6e
test: rename handlewrap.hasref tests
daeyeon May 5, 2022
c64b8d3
lib,test: enable wasm/webapi/empty-body WPT
tniessen May 5, 2022
0ec32d0
meta: move one or more collaborators to emeritus
nodejs-github-bot May 2, 2022
48f4a71
build: fix indeterminacy of icu_locales value
3ap May 6, 2022
ba3ad7c
doc: use serial comma in cluster docs
tniessen May 6, 2022
840e61e
doc: improve commit message example for releases
juanarbol May 6, 2022
0eb32ed
build: fix various shared library build issues
lux01 Feb 4, 2022
7cac7bb
assert: fix CallTracker wraps the function causes the length to be lost
y1d7ng May 6, 2022
5470578
worker: fix stream racing with terminate
airtable-keyhanvakil May 6, 2022
38e4c15
src: always signal V8 for intercepted properties
targos May 6, 2022
5dc7929
src: remove unnecessary comment
cola119 May 6, 2022
65d6455
doc: use serial comma in tls docs
tniessen May 8, 2022
16df8ad
meta: update AUTHORS
nodejs-github-bot May 8, 2022
265ecdf
tools: update lint-md-dependencies
nodejs-github-bot May 8, 2022
7987238
tools: refactor lint-sh.js to esm module
F3n67u May 8, 2022
64daaca
tools: update eslint to 8.15.0
nodejs-github-bot May 8, 2022
946f57c
debugger: fix inconsistent inspector output of exec new Map()
cola119 May 8, 2022
46a44b3
lib: move WebAssembly Web API into separate file
tniessen May 8, 2022
13c333e
Revert "deps: add template for generated headers"
danbev May 5, 2022
e8121ae
deps: regenerate OpenSSL archs files
danbev May 5, 2022
64e0aa1
doc: rename N-API to Node-API in test/README.md
daeyeon May 9, 2022
686c4c1
doc: add release key for Juan Arboleda
juanarbol May 9, 2022
4de918b
doc: add the preferred name for @himself65
himself65 May 9, 2022
c988a0e
doc: use serial comma in http docs
tniessen May 9, 2022
55ef6e8
wasm: add missing init reported by coverity
mhdawson Apr 28, 2022
4a3f678
doc: add LiviaMedeiros to collaborators
LiviaMedeiros May 10, 2022
ef177da
doc: mark some node-api functions as experimental
NickNaso May 6, 2022
e2462a2
node-api: fix napi_get_all_property_names
vmoroz Apr 13, 2022
22cb710
doc: add Rafael to the security steward for NearForm
mcollina May 4, 2022
174ff97
meta: update .mailmap for recent README name change
Trott May 9, 2022
e9e1f1e
typings: fix `os.cpus` invalid return type
himself65 May 10, 2022
0957212
doc: use consistent method symbol
ShogunPanda May 10, 2022
330e267
doc: use serial comma in buffer docs
tniessen May 11, 2022
6365bf8
deps: upgrade openssl sources to quictls/openssl-3.0.3
RafaelGSS May 9, 2022
8e54c19
deps: update archs files for quictls/openssl-3.0.3+quic
RafaelGSS May 9, 2022
3816a97
doc: add detail for how to update llhttp
mhdawson May 9, 2022
a4a4f71
deps: fix llhttp version number
mhdawson May 9, 2022
eb630d7
doc: add maintaining info for shared libary option
mhdawson Mar 29, 2022
1e9de0d
doc: remove git:// protocol, adjust nits in onboarding.md
LiviaMedeiros May 10, 2022
76096c2
doc: use serial comma in util docs
tniessen May 12, 2022
c92e291
perf_hooks: add PerformanceResourceTiming
RafaelGSS Apr 10, 2022
c535db1
src: delete AllocatedBuffer
RaisinTen May 13, 2022
037ff3d
node-api: explicitly set __cdecl for API functions
vmoroz Apr 18, 2022
a9703a5
deps: remove opensslconf template headers
danbev May 10, 2022
7c4df42
build: disable windows-2022 temporarily
gengjiawen May 14, 2022
9629c74
doc: use serial comma in modules docs
tniessen May 14, 2022
ddd271e
meta: add mailmap entry for ShogunPanda
ShogunPanda May 15, 2022
becca06
fs: remove unnecessary ?? operator
mroderick May 15, 2022
cec678a
build: set ASAN workaround
richardlau May 13, 2022
d128356
deps: update undici to 5.2.0
nodejs-github-bot May 15, 2022
531a0a9
tools: update lint-md-dependencies to [email protected]
nodejs-github-bot May 15, 2022
9eb8bf1
test: reduce flakiness of `test-fs-read-position-validation.mjs`
LiviaMedeiros May 15, 2022
839824a
doc: use serial comma in events docs
tniessen May 15, 2022
f53ed9d
doc: use serial comma in fs docs
tniessen May 15, 2022
0670843
test: fix dangerous .map in `test/parallel/test-http-set-trailers.js`
LiviaMedeiros May 13, 2022
1531ef1
2022-05-17, Version 18.2.0 (Current)
RafaelGSS May 10, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
bootstrap: stop delaying instantiation of maps in per-context scripts
The linked issue, https://bugs.chromium.org/p/v8/issues/detail?id=6593,
is marked as "Fixed", so I think we can revert this now.

This reverts commit 08a9c4a.

Signed-off-by: Darshan Sen <[email protected]>

PR-URL: #42934
Refs: https://bugs.chromium.org/p/v8/issues/detail?id=9187
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
  • Loading branch information
RaisinTen authored and RafaelGSS committed May 10, 2022
commit 1146806673b6fffff2e43372673683c50ab696ac
97 changes: 37 additions & 60 deletions lib/internal/per_context/domexception.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,37 +36,18 @@ function throwInvalidThisError(Base, type) {
throw err;
}

let disusedNamesSet;
let internalsMap;
let nameToCodeMap;
let isInitialized = false;
const internalsMap = new SafeWeakMap();
const nameToCodeMap = new SafeMap();

// We need to instantiate the maps lazily because they render
// the snapshot non-rehashable.
// https://bugs.chromium.org/p/v8/issues/detail?id=6593
function ensureInitialized() {
if (isInitialized) {
return;
}
internalsMap = new SafeWeakMap();
nameToCodeMap = new SafeMap();
forEachCode((name, codeName, value) => {
nameToCodeMap.set(name, value);
});

// These were removed from the error names table.
// See https://github.com/heycam/webidl/pull/946.
disusedNamesSet = new SafeSet()
.add('DOMStringSizeError')
.add('NoDataAllowedError')
.add('ValidationError');

isInitialized = true;
}
// These were removed from the error names table.
// See https://github.com/heycam/webidl/pull/946.
const disusedNamesSet = new SafeSet()
.add('DOMStringSizeError')
.add('NoDataAllowedError')
.add('ValidationError');

class DOMException {
constructor(message = '', name = 'Error') {
ensureInitialized();
ErrorCaptureStackTrace(this);
internalsMap.set(this, {
message: `${message}`,
Expand All @@ -75,7 +56,6 @@ class DOMException {
}

get name() {
ensureInitialized();
const internals = internalsMap.get(this);
if (internals === undefined) {
throwInvalidThisError(TypeError, 'DOMException');
Expand All @@ -84,7 +64,6 @@ class DOMException {
}

get message() {
ensureInitialized();
const internals = internalsMap.get(this);
if (internals === undefined) {
throwInvalidThisError(TypeError, 'DOMException');
Expand All @@ -93,7 +72,6 @@ class DOMException {
}

get code() {
ensureInitialized();
const internals = internalsMap.get(this);
if (internals === undefined) {
throwInvalidThisError(TypeError, 'DOMException');
Expand All @@ -116,40 +94,39 @@ ObjectDefineProperties(DOMException.prototype, {
code: { enumerable: true, configurable: true }
});

function forEachCode(fn) {
fn('IndexSizeError', 'INDEX_SIZE_ERR', 1);
fn('DOMStringSizeError', 'DOMSTRING_SIZE_ERR', 2);
fn('HierarchyRequestError', 'HIERARCHY_REQUEST_ERR', 3);
fn('WrongDocumentError', 'WRONG_DOCUMENT_ERR', 4);
fn('InvalidCharacterError', 'INVALID_CHARACTER_ERR', 5);
fn('NoDataAllowedError', 'NO_DATA_ALLOWED_ERR', 6);
fn('NoModificationAllowedError', 'NO_MODIFICATION_ALLOWED_ERR', 7);
fn('NotFoundError', 'NOT_FOUND_ERR', 8);
fn('NotSupportedError', 'NOT_SUPPORTED_ERR', 9);
fn('InUseAttributeError', 'INUSE_ATTRIBUTE_ERR', 10);
fn('InvalidStateError', 'INVALID_STATE_ERR', 11);
fn('SyntaxError', 'SYNTAX_ERR', 12);
fn('InvalidModificationError', 'INVALID_MODIFICATION_ERR', 13);
fn('NamespaceError', 'NAMESPACE_ERR', 14);
fn('InvalidAccessError', 'INVALID_ACCESS_ERR', 15);
fn('ValidationError', 'VALIDATION_ERR', 16);
fn('TypeMismatchError', 'TYPE_MISMATCH_ERR', 17);
fn('SecurityError', 'SECURITY_ERR', 18);
fn('NetworkError', 'NETWORK_ERR', 19);
fn('AbortError', 'ABORT_ERR', 20);
fn('URLMismatchError', 'URL_MISMATCH_ERR', 21);
fn('QuotaExceededError', 'QUOTA_EXCEEDED_ERR', 22);
fn('TimeoutError', 'TIMEOUT_ERR', 23);
fn('InvalidNodeTypeError', 'INVALID_NODE_TYPE_ERR', 24);
fn('DataCloneError', 'DATA_CLONE_ERR', 25);
for (const { 0: name, 1: codeName, 2: value } of [
['IndexSizeError', 'INDEX_SIZE_ERR', 1],
['DOMStringSizeError', 'DOMSTRING_SIZE_ERR', 2],
['HierarchyRequestError', 'HIERARCHY_REQUEST_ERR', 3],
['WrongDocumentError', 'WRONG_DOCUMENT_ERR', 4],
['InvalidCharacterError', 'INVALID_CHARACTER_ERR', 5],
['NoDataAllowedError', 'NO_DATA_ALLOWED_ERR', 6],
['NoModificationAllowedError', 'NO_MODIFICATION_ALLOWED_ERR', 7],
['NotFoundError', 'NOT_FOUND_ERR', 8],
['NotSupportedError', 'NOT_SUPPORTED_ERR', 9],
['InUseAttributeError', 'INUSE_ATTRIBUTE_ERR', 10],
['InvalidStateError', 'INVALID_STATE_ERR', 11],
['SyntaxError', 'SYNTAX_ERR', 12],
['InvalidModificationError', 'INVALID_MODIFICATION_ERR', 13],
['NamespaceError', 'NAMESPACE_ERR', 14],
['InvalidAccessError', 'INVALID_ACCESS_ERR', 15],
['ValidationError', 'VALIDATION_ERR', 16],
['TypeMismatchError', 'TYPE_MISMATCH_ERR', 17],
['SecurityError', 'SECURITY_ERR', 18],
['NetworkError', 'NETWORK_ERR', 19],
['AbortError', 'ABORT_ERR', 20],
['URLMismatchError', 'URL_MISMATCH_ERR', 21],
['QuotaExceededError', 'QUOTA_EXCEEDED_ERR', 22],
['TimeoutError', 'TIMEOUT_ERR', 23],
['InvalidNodeTypeError', 'INVALID_NODE_TYPE_ERR', 24],
['DataCloneError', 'DATA_CLONE_ERR', 25],
// There are some more error names, but since they don't have codes assigned,
// we don't need to care about them.
}

forEachCode((name, codeName, value) => {
]) {
const desc = { enumerable: true, value };
ObjectDefineProperty(DOMException, codeName, desc);
ObjectDefineProperty(DOMException.prototype, codeName, desc);
});
nameToCodeMap.set(name, value);
}

exports.DOMException = DOMException;