adopted-ember-addons / ember-cp-validations

Ember computed property based validations

Home Page:https://adopted-ember-addons.github.io/ember-cp-validations/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[ember-source 3.13] using a computed property in the `before` key for a validator throws error

efx opened this issue · comments

Environment

  • Ember Version: 3.13
  • Ember CLI Version: ~3.12.0
  • Ember CP Validations Version: 4.0.0-beta.9

Steps to Reproduce

  1. clone the following repository and run yarn test: https://github.com/efx/cp-validations-test

Specifically using the alias computed within a validation object breaks with ember-source. The ember-source assertion is in core_object.js.

The failing logic occurs in
https://github.com/offirgolan/ember-cp-validations/blob/2e901724390172d3b9584aec69696e2f8e28fc29/addon/-private/options.js#L26

If you pause execution it seems to happen since options.before is a COMPUTED_DECORATOR?
Screen Shot 2019-09-20 at 14 07 39

@efx I believe this currently open PR will fix the issue #653

@patocallaghan thank you for pointing that out and fixing the issue! I'll test that PR in our application today.

Looks like @GavinJoyce has also started to fix for 3.13 in #662

commented

Just ran into this and it seems it also occurs when the validation rule includes the disabled option. At least, when I remove that, the error no longer occurs.