stampit-org / stamp

Stamps - better OOP model
https://stampit.js.org
MIT License
25 stars 3 forks source link

Collision add-on unaware of get/set methods? #79

Open canadaduane opened 4 years ago

canadaduane commented 4 years ago

I have a stamp with a method that uses get style function:

  methods: {
    /**
     * @returns {string}
     */
    get label() {
      return this.state.label.target
    },
    ...

I also have a few methods that I am trying to set up for defer style collision so that they are all called (instead of the last one).

It appears that when I use these two features together, I get an error that this.state is undefined. Using console.trace I am lead believe that this line of code is "calling" my getter:

https://github.com/stampit-org/stamp/blob/master/packages/collision/index.js#L146

koresar commented 4 years ago

Hm. Could you please provide a (stripped?) code to reproduce it locally? That would significantly help.

On Tue., 7 Apr. 2020, 06:43 Duane Johnson, notifications@github.com wrote:

I have a stamp with a method that uses get style function:

methods: { /**

  • @returns {string} */ get label() { return this.state.label.target }, ...

I also have a few methods that I am trying to set up for defer style collision so that they are all called (instead of the last one).

It appears that when I use these two features together, I get an error that this.state is undefined. Using console.trace I believe that this line of code is "calling" my getter:

https://github.com/stampit-org/stamp/blob/master/packages/collision/index.js#L146

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/stampit-org/stamp/issues/79, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMMEL43MATKDY7Y33HAQJLRLI5IJANCNFSM4MCSWOAA .

koresar commented 4 years ago

Oh! I see now. It calls the getter. Shite! 😀 That's definitely a big. Thank you for reporting. It's clear how to reproduce.

canadaduane commented 4 years ago

Ha! Yes, that's the one. Thanks for taking a look.

canadaduane commented 4 years ago

Is this something that you have time to fix? I just ran into this issue again.

koresar commented 4 years ago

Sorry. I hadn't had a chance. It's a difficult one. Also, I have a baby now. Taking my whole time atm.

On Sun., 14 Jun. 2020, 04:09 Duane Johnson, notifications@github.com wrote:

Is this something that you have time to fix? I just ran into this issue again.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/stampit-org/stamp/issues/79#issuecomment-643658217, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMMEL6NG5VKD3I7NKMKJWLRWO6G7ANCNFSM4MCSWOAA .