summaryrefslogtreecommitdiff
path: root/ext/webidl
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2022-04-16 14:09:07 +0200
committerGitHub <noreply@github.com>2022-04-16 14:09:07 +0200
commit0bb96cde726127291dccb62145e76a50b2efcd2f (patch)
treee18e2512369c5c1393c2e45efef594e1e8ca4af5 /ext/webidl
parent8b31fc23cd80de9baa62535e95367da7a21c9cfd (diff)
refactor: update runtime code for primordial check x in y (#13642)
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
Diffstat (limited to 'ext/webidl')
-rw-r--r--ext/webidl/00_webidl.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/ext/webidl/00_webidl.js b/ext/webidl/00_webidl.js
index a7f0597b1..d9c4f87cf 100644
--- a/ext/webidl/00_webidl.js
+++ b/ext/webidl/00_webidl.js
@@ -57,6 +57,7 @@
ReflectApply,
ReflectDefineProperty,
ReflectGetOwnPropertyDescriptor,
+ ReflectHas,
ReflectOwnKeys,
RegExpPrototypeTest,
Set,
@@ -648,7 +649,7 @@
const defaultValues = {};
for (const member of allMembers) {
- if ("defaultValue" in member) {
+ if (ReflectHas(member, "defaultValue")) {
const idlMemberValue = member.defaultValue;
const imvType = typeof idlMemberValue;
// Copy by value types can be directly assigned, copy by reference types
@@ -1013,13 +1014,16 @@
for (const key in descriptors) {
if (key === "constructor") continue;
const descriptor = descriptors[key];
- if ("value" in descriptor && typeof descriptor.value === "function") {
+ if (
+ ReflectHas(descriptor, "value") &&
+ typeof descriptor.value === "function"
+ ) {
ObjectDefineProperty(prototype.prototype, key, {
enumerable: true,
writable: true,
configurable: true,
});
- } else if ("get" in descriptor) {
+ } else if (ReflectHas(descriptor, "get")) {
ObjectDefineProperty(prototype.prototype, key, {
enumerable: true,
configurable: true,