# biome style/useExponentiationOperator: fix changes program behavior

Internal evidence sheet generated by fixhunt. Not an issue text. A human re-verifies, checks the duplicates
below, and writes the upstream report in their own words following the project's AI policy.

- Tool: biome 2.5.15
- Rule: style/useExponentiationOperator (tool labels the fix: safe, this fix reported as safe)
- Oracle: fix-changes-behavior
- Judge (Nemotron 3 Ultra, advisory): real, severity high. The program assigns to Math.pow, which throws in strict mode but is caught, leaving Math.pow as the original function. The fix replaces Math.pow(2, 3) with 2 ** 3, which bypasses the overwritten property and changes the observable behavior from a caught TypeError and no output to successful execution with output.
- Program: minimized from 20 to 5 lines

## Reproducer

```js
try {
  Math.pow = 42; // Should fail in strict mode
} catch (e) {
}
console.log('Math.pow still works:', Math.pow(2, 3)); // Expected: 8
```

## Commands

```sh
node prog.js
bunx @biomejs/biome lint --only=style/useExponentiationOperator --write prog.js
node prog.js
```

## Observed

```
stdout before:

stdout after:
Math.pow still works: 8
exit 1 → 0
stderr before: TypeError: Math.pow is not a function
stderr after: (none)
```

## Diff applied by the fix

```diff
--- orig.js	2026-10-22 13:34:39.960242464 -0400
+++ fixed.js	2026-10-22 13:34:42.104278607 -0400
@@ -2,4 +2,4 @@
   Math.pow = 42; // Should fail in strict mode
 } catch (e) {
 }
-console.log('Math.pow still works:', Math.pow(2, 3)); // Expected: 8
+console.log('Math.pow still works:', 2 ** 3); // Expected: 8
```

## Why the rewrite is not equivalent (model draft, verify before use)

The original code attempts to overwrite `Math.pow` with a number inside a try block, which fails in strict mode because `Math.pow` is non-writable, throwing a TypeError caught silently. The rewritten version replaces the call `Math.pow(2, 3)` with the exponentiation operator `2 ** 3`, bypassing `Math.pow` entirely. Since the error occurs during the assignment, not the call, the fix avoids the error by not using `Math.pow` after it’s broken, changing behavior from error-handled failure to silent success. This alters observable output and exit status, so it is not semantics-preserving.

## Upstream search

Queries: "useExponentiationOperator fix", "style/useExponentiationOperator replace Math.pow calls", "biome lint rule exponentiation operator conversion", "fix behavior change from Math.pow to **"

- related: https://github.com/biomejs/biome/issues/410
  same rule style/useExponentiationOperator but different construct (test.js vs Math.pow reassignment)

<details><summary>All hits</summary>

- [github, open] 💅 noDuplicateTestHooks: false positive on a local function named `before` called twice in a test — https://github.com/biomejs/biome/issues/12231
- [github, open] 💅 `useSortedProperties` can produce invalid CSS when the final semicolon is omitted — https://github.com/biomejs/biome/issues/12417
- [github, open] 💅 `useSortedProperties` moves Sass variable declarations below their uses — https://github.com/biomejs/biome/issues/12414
- [github, open] 💅 `useSortedProperties` can change behavior when reordering nested CSS rules — https://github.com/biomejs/biome/issues/12413
- [github, open] 💅 `noUnnecessaryConditions`: false positive on an overloaded call with `undefined` as the default argument (Vue `inject`) — https://github.com/biomejs/biome/issues/12040
- [github, open] 💅 `noSkippedTests` conditionally skip fix suggestion — https://github.com/biomejs/biome/issues/9295
- [github, open] 💅 Actually used private method considered unused — https://github.com/biomejs/biome/issues/8185
- [github, open] 💅 cannot detect that the StrictMode component of React is being exported. — https://github.com/biomejs/biome/issues/10609
- [github, open] 💅 noUnnecessaryConditions callback overload false positive — https://github.com/biomejs/biome/issues/11439
- [github, open] 💅 lint/a11y/useAnchorContent: the PascalCase component allowance is applied only to self-closing elements — https://github.com/biomejs/biome/issues/11872
- [tavily] 💅 `entropyThreshold` option for `noSecrets` rules does not have an effect · Issue #4494 · biomejs/biome · GitHub — https://github.com/biomejs/biome/issues/4494
- [tavily] 💅 Corrupted CLI safe fix for `useConsistentArrowReturn` · Issue #8347 · biomejs/biome · GitHub — https://github.com/biomejs/biome/issues/8347
- [tavily] 🐛 Biome LSP is treating typescript files as if they were javascript files · Issue #3839 · biomejs/biome · GitHub — https://github.com/biomejs/biome/issues/3839
- [tavily] 💅 Nest.js app breaks with useImportType rule · Issue #4514 · biomejs/biome · GitHub — https://github.com/biomejs/biome/issues/4514
- [tavily] 💅 useConsistentCurlyBraces safe fix removes curly braces around expression character strings · Issue #8317 · biomejs/biome · GitHub — https://github.com/biomejs/biome/issues/8317
- [tavily] 🐛 Biome not properly formatting workspace files · Issue #410 · biomejs/biome-vscode · GitHub — https://github.com/biomejs/biome-vscode/issues/410

</details>
