Skip to content

Conversation

@sensei-hacker
Copy link
Member

Summary

Fixes the JavaScript programming decompiler to output whenChanged() instead of delta().

Changes

  • decompiler.js: The whenChanged pattern now renders as whenChanged() to match the API
  • condition_decompiler.js: Import OPERAND_TYPE from constants instead of hardcoding the value

Why

The API defines whenChanged(value, threshold, callback) as the user-facing function, but the decompiler was outputting delta(). This caused round-trip inconsistency - code compiled with whenChanged() would decompile to delta().

@sensei-hacker sensei-hacker force-pushed the fix-decompiler-whenchanged-naming branch 2 times, most recently from e27a8d7 to a4c2280 Compare December 27, 2025 05:35
- Decompiler now outputs whenChanged() to match the API definition
- Use OPERAND_TYPE.LC from constants instead of hardcoded value
- Add test for whenChanged() decompilation
- Add test for OPERAND_TYPE.LC usage in handleNot()
@sensei-hacker sensei-hacker force-pushed the fix-decompiler-whenchanged-naming branch from a4c2280 to 83dd3f4 Compare December 27, 2025 05:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant