effect icon indicating copy to clipboard operation
effect copied to clipboard

Work with frozen intrinsics

Open arlyon opened this issue 4 weeks ago • 3 comments

Type

  • [x] Refactor
  • [ ] Feature
  • [x] Bug Fix
  • [ ] Optimization
  • [ ] Documentation Update

Description

In some places (frozen-intrinsics, deterministic sandboxes like in temporal), error is readonly to limit the amount of peturbation. This causes issues when effect assumes it can modify, leading to exceptions. This changes that code to a best-effort attempt with a silent failure. I chose to just duplicate the snippet in the ai lib.

Related

Though outside this repo, this pattern is used within node itself. The core snippet comes from their internal checks. I have added a wrapper to DRY the set, unset, and error handling.

https://github.com/nodejs/node/blob/e77694631f1642c302f664703197b5aabc65b482/lib/internal/errors.js#L246

arlyon avatar Dec 04 '25 15:12 arlyon

⚠️ No Changeset found

Latest commit: 1757334718f6b23a80631ab698367ebc25829c14

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

changeset-bot[bot] avatar Dec 04 '25 15:12 changeset-bot[bot]

withStackTraceLimit will introduce a stack frame so it changes the shape of the trace

mikearnaldi avatar Dec 06 '25 17:12 mikearnaldi

Ah, you are correct. I will re-impl without the helper just with the check

arlyon avatar Dec 08 '25 00:12 arlyon