dequal icon indicating copy to clipboard operation
dequal copied to clipboard

fix cross-realm array handling in dequal

Open faizanu94 opened this issue 1 year ago • 0 comments

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.js and src/lite.js to 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.

faizanu94 avatar Dec 23 '24 10:12 faizanu94