openharmony 鸿蒙 changelogs-arkts

2026-08-25 浏览 (1)

ArkTS Changelog

cl.arkts.1 Change in JSON.parse() Return Value for Number.MIN_VALUE

Access Level

Public API

Reason for Change

The static data property Number.MIN_VALUE represents the smallest positive number that can be represented in JavaScript, which is approximately 5e-324. This change introduces support for parsing this value in JSON.parse().

Impact of the Change

This change requires application adaptation.

Before the change, the return value of Number.MIN_VALUE parsed by JSON.parse() is Infinity.

After the change, the return value of Number.MIN_VALUE parsed by JSON.parse() is 5e-324.

Start API Level

6

Change Since

OpenHarmony SDK 5.1.0.47

Key API/Component Changes

N/A

Adaptation Guide

Currently, the smallest number that JSON.parse() can parse is Number.MIN_VALUE, which is approximately 5e-324. Before this change, the smallest number that could be parsed was approximately 2.22e-308.

Example:

let res = JSON.parse('{"num":5e-324}')
console.info(res.num)

Before the change, the output of this example is:

Infinity

After the change, the output of this example is:

5e-324

你可能感兴趣的鸿蒙文章

openharmony 鸿蒙 changelogs-bundlemanager

  • 所属分类: 后端技术
  • 本文标签: 鸿蒙 软件
  • 版权声明: 本文链接 https://seaxiang.com/blog/dKRIaNFW