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

<property>Changed arguments for arrays differ based on type of change #1342

Closed
alltom opened this issue Mar 27, 2015 · 1 comment
Closed
Labels

Comments

@alltom
Copy link

alltom commented Mar 27, 2015

http://jsbin.com/ronarodiyu/1/edit

Polymer('tag-name', {
  created: function() {
    this.array = [];

    setTimeout(function () {
      console.log('push');
      this.array.push('asdf');
    }.bind(this), 1000);

    setTimeout(function () {
      console.log('replace');
      this.array = [];
    }.bind(this), 2000)
  },
  arrayChanged: function () {
    console.log(arguments);
  },
});

When a value is pushed, arrayChanged is called with the splice. When the array's value is replaced, arrayChanged is called with the old value, the new value, and some other object.

Is this a bug? If I want to use the arguments, how should I tell which way the function was called? arguments.length?

@tjsavage tjsavage added 0.5 and removed 0.5 labels May 21, 2015
@tjsavage
Copy link
Contributor

Closing this issue due to age and the release of version 1 of Polymer - please feel free to re-open if this is incorrect.

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

No branches or pull requests

2 participants