mirror of
https://github.com/RGBCube/serenity
synced 2025-06-30 10:12:07 +00:00
LibJS: Update order of steps in CanonicalNumericIndexString
This is an editorial change in the ECMA-262 spec.
See: be5db32
This commit is contained in:
parent
367e7b4fe5
commit
8b035b80d3
1 changed files with 5 additions and 5 deletions
|
@ -1178,12 +1178,12 @@ CanonicalIndex canonical_numeric_index_string(PropertyKey const& property_key, C
|
||||||
if (endptr != argument.characters() + argument.length())
|
if (endptr != argument.characters() + argument.length())
|
||||||
return CanonicalIndex(CanonicalIndex::Type::Undefined, 0);
|
return CanonicalIndex(CanonicalIndex::Type::Undefined, 0);
|
||||||
|
|
||||||
// 3. If SameValue(! ToString(n), argument) is false, return undefined.
|
// 3. If SameValue(! ToString(n), argument) is true, return n.
|
||||||
if (n.to_string_without_side_effects() != argument)
|
if (n.to_string_without_side_effects() == argument)
|
||||||
return CanonicalIndex(CanonicalIndex::Type::Undefined, 0);
|
|
||||||
|
|
||||||
// 4. Return n.
|
|
||||||
return CanonicalIndex(CanonicalIndex::Type::Numeric, 0);
|
return CanonicalIndex(CanonicalIndex::Type::Numeric, 0);
|
||||||
|
|
||||||
|
// 4. Return undefined.
|
||||||
|
return CanonicalIndex(CanonicalIndex::Type::Undefined, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 22.1.3.17.1 GetSubstitution ( matched, str, position, captures, namedCaptures, replacement ), https://tc39.es/ecma262/#sec-getsubstitution
|
// 22.1.3.17.1 GetSubstitution ( matched, str, position, captures, namedCaptures, replacement ), https://tc39.es/ecma262/#sec-getsubstitution
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue