diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2022-04-16 14:09:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-16 14:09:07 +0200 |
commit | 0bb96cde726127291dccb62145e76a50b2efcd2f (patch) | |
tree | e18e2512369c5c1393c2e45efef594e1e8ca4af5 /ext/webstorage/01_webstorage.js | |
parent | 8b31fc23cd80de9baa62535e95367da7a21c9cfd (diff) |
refactor: update runtime code for primordial check x in y (#13642)
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
Diffstat (limited to 'ext/webstorage/01_webstorage.js')
-rw-r--r-- | ext/webstorage/01_webstorage.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/webstorage/01_webstorage.js b/ext/webstorage/01_webstorage.js index 6640c04e5..5b9cccd6d 100644 --- a/ext/webstorage/01_webstorage.js +++ b/ext/webstorage/01_webstorage.js @@ -13,6 +13,7 @@ ObjectFromEntries, ObjectEntries, ReflectGet, + ReflectHas, Proxy, } = window.__bootstrap.primordials; @@ -113,7 +114,7 @@ }, get(target, key) { if (typeof key == "symbol") return target[key]; - if (key in target) { + if (ReflectHas(target, key)) { return ReflectGet(...new SafeArrayIterator(arguments)); } else { return target.getItem(key) ?? undefined; @@ -141,7 +142,7 @@ if (arguments.length === 1) { return undefined; } - if (key in target) { + if (ReflectHas(target, key)) { return undefined; } const value = target.getItem(key); |