Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

instanceof test #636

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

luxzeitlos
Copy link

@luxzeitlos luxzeitlos commented Feb 11, 2022

This is for now just a failing test, and I'm not even sure this is an error of this repo.
The thing is, I'm not even sure this is a real problem and where this must be fixed.

However I'm very confident this is the error described in #629. I encountered the same Problem with a Temporal, which basically completely breaks. Utilizing .content works, however this is not nice.

The current behaviour is:

    class Foo {}
    let model = EmberObject.create({ foo: new Foo() });
    let dummyChangeset = Changeset(model);

    // this *does* work!
    assert.ok(dummyChangeset.foo.content instanceof Foo, 'content property is an instance');
    
    // this *does not* work!
    assert.ok(dummyChangeset.foo instanceof Foo, 'proxy itself is an instance');

@snewcomer
Copy link
Collaborator

@luxferresum @bgolla so the problem here is the intermediate value is the proxy. The assumption was that a user only ever wants the leaf key to display in the UI. So in your example,

class Foo { name = 'Scott'; } 

changeset.foo will be the proxy and changeset.foo.name === 'Scott'.

What concrete problem are you running up against?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants