/src/serenity/Userland/Libraries/LibJS/Runtime/KeyedCollections.cpp
Line | Count | Source |
1 | | /* |
2 | | * Copyright (c) 2024, Tim Flynn <trflynn89@serenityos.org> |
3 | | * |
4 | | * SPDX-License-Identifier: BSD-2-Clause |
5 | | */ |
6 | | |
7 | | #include <LibJS/Runtime/KeyedCollections.h> |
8 | | |
9 | | namespace JS { |
10 | | |
11 | | // 24.5.1 CanonicalizeKeyedCollectionKey ( key ), https://tc39.es/ecma262/#sec-canonicalizekeyedcollectionkey |
12 | | Value canonicalize_keyed_collection_key(Value key) |
13 | 0 | { |
14 | | // 1. If key is -0𝔽, return +0𝔽. |
15 | 0 | if (key.is_negative_zero()) |
16 | 0 | return Value { 0.0 }; |
17 | | |
18 | | // 2. Return key. |
19 | 0 | return key; |
20 | 0 | } |
21 | | |
22 | | } |