Commit ab02430
committed
feat(primordials): expand surface (Function, Math) and adopt inline export const style
- Add FunctionPrototypeApply / FunctionPrototypeBind / FunctionPrototypeCall
for callers that need to invoke user code with a controlled thisArg
without going through globalThis (these are the common capture targets
in socket-btm's safe-references.js).
- Add Math primordials: Abs, Ceil, Floor, Max, Min, Pow, Random, Round,
Sign, Sqrt, Trunc. MathCeil specifically is used by socket-btm for
block-size math that must not be monkey-patched during Node bootstrap.
- Convert the module from the `const X = …; export { X, Y, … }` two-step
to inline `export const X = …`. Matches the style used elsewhere in
socket-lib (src/errors.ts, src/objects.ts) and removes the large export
block that was ~60 lines of boilerplate.
- Expand the unit-test suite from 17 tests to 64:
- every exported primordial gets a functional test, not just a sample;
- additional prototype-pollution resilience cases covering
String.prototype.slice and JSON.parse alongside the existing
Array.prototype.map / Array.isArray / Object.keys clobbering tests.
Bump to 5.26.0 (additive, no breaking changes).1 parent 9582333 commit ab02430
3 files changed
Lines changed: 848 additions & 357 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
0 commit comments