Skip to content

Commit

Permalink
Use null-prototype instead
Browse files Browse the repository at this point in the history
  • Loading branch information
aduh95 committed Feb 4, 2023
1 parent 34a0879 commit 3878026
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions ext/webidl/00_webidl.js
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,7 @@
}
const esDict = V;

const idlDict = ObjectAssign({}, defaultValues);
const idlDict = { __proto__: null, ...defaultValues };

// NOTE: fast path Null and Undefined.
if ((V === undefined || V === null) && !hasRequiredKey) {
Expand All @@ -729,13 +729,7 @@
}`;
const converter = member.converter;
const idlMemberValue = converter(esMemberValue, { ...opts, context });
ObjectDefineProperty(idlDict, key, {
__proto__: null,
configurable: true,
enumerable: true,
value: idlMemberValue,
writable: true,
});
idlDict[key] = idlMemberValue;
} else if (member.required) {
throw makeException(
TypeError,
Expand Down

0 comments on commit 3878026

Please sign in to comment.