2026-06-08 20:47:30 +08:00
# Test Report - go/js
## Performance (Benchmark)
2026-06-21 10:29:27 +08:00
Date: 2026-06-21
2026-06-08 20:47:30 +08:00
OS: darwin
Arch: amd64
CPU: Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
| Benchmark | Iterations | Time/op |
|-----------|------------|---------|
2026-06-21 10:29:27 +08:00
| BenchmarkCall | 661954 | 1566 ns/op |
| BenchmarkSync | 51656 | 50748 ns/op |
2026-06-08 20:47:30 +08:00
2026-06-21 10:29:27 +08:00
*Note: BenchmarkCall covers the hot path of executing a JS function from the pool. BenchmarkSync covers the cost of defining new code (including VM sync).*
2026-06-08 20:47:30 +08:00
## Coverage
```
2026-06-21 10:29:27 +08:00
=== RUN TestGoStackErrorInterface
--- PASS: TestGoStackErrorInterface (0.00s)
=== RUN TestBridgeGoErrorWithFuncName
--- PASS: TestBridgeGoErrorWithFuncName (0.00s)
=== RUN TestBridgeGoPanicWithStack
--- PASS: TestBridgeGoPanicWithStack (0.00s)
=== RUN TestBridgeGoErrorWithMakeError
--- PASS: TestBridgeGoErrorWithMakeError (0.00s)
2026-06-08 20:47:30 +08:00
=== RUN TestBridgeSafeMode
--- PASS: TestBridgeSafeMode (0.00s)
=== RUN TestBridgeLoggerInjection
--- PASS: TestBridgeLoggerInjection (0.00s)
=== RUN TestBridgeMixedInjection
--- PASS: TestBridgeMixedInjection (0.00s)
2026-06-21 10:29:27 +08:00
=== RUN TestBridgeOptionalParams
--- PASS: TestBridgeOptionalParams (0.00s)
2026-06-08 20:47:30 +08:00
=== RUN TestDocGeneration
--- PASS: TestDocGeneration (0.00s)
=== RUN TestPoolVersioning
--- PASS: TestPoolVersioning (0.00s)
=== RUN TestPoolConcurrent
--- PASS: TestPoolConcurrent (0.00s)
=== RUN TestPoolGracefulShutdown
2026-06-21 10:29:27 +08:00
--- PASS: TestPoolGracefulShutdown (0.20s)
=== RUN TestGlobalInjection
--- PASS: TestGlobalInjection (0.00s)
=== RUN TestDefineValidation
--- PASS: TestDefineValidation (0.00s)
=== RUN TestJSErrorStackTrace
--- PASS: TestJSErrorStackTrace (0.00s)
=== RUN TestDefineRedefine
--- PASS: TestDefineRedefine (0.00s)
2026-06-08 20:47:30 +08:00
PASS
2026-06-21 10:29:27 +08:00
ok apigo.cc/go/js 0.572s
2026-06-08 20:47:30 +08:00
```
## Features Verified
- [x] JS calling Go with automatic type conversion.
- [x] Go pointers preservation in JS.
- [x] Context and Logger injection.
- [x] Concurrent execution and script versioning.
- [x] Script version checking (`CheckVersion` ).
- [x] Function discovery (`FuncList` ).
- [x] Context cancellation interruption.
- [x] Graceful shutdown.
- [x] TypeScript definition generation.
2026-06-21 10:29:27 +08:00
- [x] JS VM call stack parsing & Go dynamic call stack restoration with `jsmod.MakeError` .