Compare commits

..

No commits in common. "739650bb07336dcd31f6246bd2db6eb9929be139" and "ebd14f7c62e1c93e6451655b493598dca636e723" have entirely different histories.

3 changed files with 16 additions and 32 deletions

View File

@ -1,13 +1,5 @@
# CHANGELOG # CHANGELOG
## v1.5.3 (2026-06-21)
- **重构与错误堆栈支持**:
- 重构 `js_export.go`,将匿名包装闭包改为包级具名函数 `jsInt` 等。
- 升级 `jsmod` 依赖至 v1.5.3。
## v1.5.2 (2026-06-11)
- **依赖对齐**: 升级 `jsmod` 依赖至 v1.5.2。
## v1.5.1 (2026-06-08) ## v1.5.1 (2026-06-08)
- **JS 对齐**: 将所有注册到 `jsmod` 的导出方法名统一为 PascalCase`Int`, `FastInt`, `Byte`),以消除 JS 与 Go 调用体感上的摩擦。 - **JS 对齐**: 将所有注册到 `jsmod` 的导出方法名统一为 PascalCase`Int`, `FastInt`, `Byte`),以消除 JS 与 Go 调用体感上的摩擦。

2
go.mod
View File

@ -2,4 +2,4 @@ module apigo.cc/go/rand
go 1.25.0 go 1.25.0
require apigo.cc/go/jsmod v1.5.3 require apigo.cc/go/jsmod v1.5.0

View File

@ -6,28 +6,20 @@ import (
func init() { func init() {
jsmod.Register("rand", map[string]any{ jsmod.Register("rand", map[string]any{
"Int": jsInt, "Int": func(min, max int64) int64 {
"FastInt": jsFastInt, return Int(min, max)
"Float": jsFloat, },
"FastFloat": jsFastFloat, "FastInt": func(min, max int64) int64 {
"Byte": Byte, return FastInt(min, max)
"Bytes": Bytes, },
"Perm": Perm, "Float": func(min, max float64) float64 {
return Float(min, max)
},
"FastFloat": func(min, max float64) float64 {
return FastFloat(min, max)
},
"Byte": Byte,
"Bytes": Bytes,
"Perm": Perm,
}) })
} }
func jsInt(min, max int64) int64 {
return Int(min, max)
}
func jsFastInt(min, max int64) int64 {
return FastInt(min, max)
}
func jsFloat(min, max float64) float64 {
return Float(min, max)
}
func jsFastFloat(min, max float64) float64 {
return FastFloat(min, max)
}