perf(webidl): optimize createDictionaryConverter() (#12279)

On a benchmark constructing Responses with headers this shaves off 25%
This commit is contained in:
Aaron O'Mullan 2021-09-30 21:33:12 +02:00 committed by GitHub
parent a2632c86b1
commit 72836478f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -41,6 +41,7 @@
NumberMAX_SAFE_INTEGER,
// deno-lint-ignore camelcase
NumberMIN_SAFE_INTEGER,
ObjectAssign,
ObjectCreate,
ObjectDefineProperties,
ObjectDefineProperty,
@ -726,7 +727,7 @@
}
const esDict = V;
const idlDict = { ...defaultValues };
const idlDict = ObjectAssign({}, defaultValues);
// NOTE: fast path Null and Undefined.
if ((V === undefined || V === null) && !hasRequiredKey) {