diff --git a/ets2panda/lexer/token/number.cpp b/ets2panda/lexer/token/number.cpp index 04270a6328856499d47ce10b0f6c1bad8dddafbb..51de994851c3bfaac99faca05ad01d13a77cc71e 100644 --- a/ets2panda/lexer/token/number.cpp +++ b/ets2panda/lexer/token/number.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Copyright (c) 2021-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -46,5 +46,8 @@ Number::Number(util::StringView str, NumberFlags flags) noexcept : str_(str), fl flags_ |= NumberFlags::ERROR; } } + if (res == Lexer::ConversionResult::OUT_OF_RANGE) { + num_ = 0; + } } } // namespace ark::es2panda::lexer