Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Should !Array.isArray() checks also be contained within the observers and computed properties? #146

Open
notmessenger opened this issue Aug 24, 2016 · 0 comments

Comments

@notmessenger
Copy link
Member

notmessenger commented Aug 24, 2016

In order to ensure that the bound property isn't made into an Array afterwards.

/ember-forge/ember-forge-ui/addon/components/form/ef-error.js:
   67:     if (!isEmpty(property) && !Array.isArray(message)) {
   68        this.message = computed(error, {
   69          get() {

/ember-forge/ember-forge-ui/addon/components/form/input/ef-checkbox.js:
  185:     if (!isEmpty(property) && !Array.isArray(get(this, `data.${property}`)) && !isEmpty(this.getAttr('value'))) {
  186        this.addObserver(`data.${property}`, this, 'initializeState');
  187      }
  ...
  250      } else {
  251        if (get(this, 'isInitializing')) {
  252:         if (!isEmpty(property) && !Array.isArray(get(this, `data.${property}`))) {
  253            Ember.run.scheduleOnce('afterRender', () => {
  254              set(this, 'internalChange', true);

/ember-forge/ember-forge-ui/addon/mixins/form/input/common.js:
  198:     if (!isEmpty(property) && !Array.isArray(get(this, `data.${property}`))) {
  199        this.value = computed(`data.${property}`, {
  200          get() {

Check other instances as well - these were just snapshots of the codebase at the time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant