fix: 兼容 TinyGo wasm 编译行星星历初始化
- 将 planetViews 从包级初始化改为 sync.Once 懒加载,避免 TinyGo interp 在编译期处理大型 float64 表切片索引时触发 unsupported fcmp - 将行星视图构建失败改为内部返回 error,并由兼容层统一 panic - 补充无效行星数据切片边界测试
This commit is contained in:
+1
-1
@@ -25,7 +25,7 @@ func WherePlanetN(xt, zn int, jd float64, n int) float64 {
|
||||
t := (jd - 2451545) / 36525.0000
|
||||
t /= 10 // 转为儒略千年数
|
||||
|
||||
body := planetViews[xt]
|
||||
body := planetViews()[xt]
|
||||
coord := body.coords[zn]
|
||||
baseOrderTerms := len(coord.orders[0])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user