ajvincent / ajvincent/es-membrane

membrane: Consider a Symbol.hasInstance distortion for the instanceof operator

Open
#276 0 comments 0 reactions 1 assignee Claimed by @ajvincent View on GitHub
Dominant language
JavaScript
Stars
118
Forks
13
PR merge metrics
No merged PRs in 30d

Description

I was initially surprised a few days ago [when testing instanceof across object graphs](https://github.com/ajvincent/es-membrane/blob/7891c99e316d642fe0786bc2e67cbe68136d961b/projects/v2-es-membrane/membranes_decorated/spec/concepts.ts#L220).

Very quickly I realized this is probably technically correct: I wrap every value in the "wet" graph before calling methods. But it's quite non-intuitive. Also, a bit unsupported: if you're outside the membrane and can interact with the graphs directly as I did in this test, then occasionally weird behaviors are going to happen.

I don't exactly know what I should do about this, if anything, but I'm filing this as a reminder.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.