dequal
dequal copied to clipboard
fix cross-realm array handling in dequal
This pull request resolves Issue #9, which identifies a problem with dequal failing to handle comparisons of objects created in different realms (e.g., arrays from iframes or VM contexts).
Changes
- Updated
src/index.jsandsrc/lite.jsto use cross-realm-safe methods. - Added a test for cross-realm arrays to the test suite using Node.js’s vm module.
Testing
- Verified that all existing tests pass.
- Confirmed the added cross-realm test fails with the old implementation and passes with the new logic.
Impact This fix ensures dequal handles edge cases involving cross-realm objects, improving reliability in multi-realm environments.