Skip to content

Commit ab02430

Browse files
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

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@socketsecurity/lib",
3-
"version": "5.25.0",
3+
"version": "5.26.0",
44
"packageManager": "pnpm@11.0.0-rc.5",
55
"license": "MIT",
66
"description": "Core utilities and infrastructure for Socket.dev security tools",

0 commit comments

Comments
 (0)