44 lines
1.0 KiB
Plaintext
Raw Normal View History

== Why is this an issue?
2021-04-28 16:49:39 +02:00
According to the Backbone.js docs
____
The *changed* property is the internal hash containing all the attributes that have changed since the last set. Please do not update *changed* directly since its state is internally maintained by set. A copy of *changed* can be acquired from changedAttributes.
____
The ``++changed++`` property is involved in decisions about whether or not a collection should be resorted when it is updated. If you modify it manually, you can break the resorting of the collection.
=== Noncompliant code example
2021-04-28 16:49:39 +02:00
2022-02-04 17:28:24 +01:00
[source,javascript]
2021-04-28 16:49:39 +02:00
----
myModel.changed = { myProperty: 1 }; // Non-compliant
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
Remove this update of the "changed" property.
'''
== Comments And Links
(visible only on this page)
=== on 20 May 2015, 12:31:41 Linda Martin wrote:
OK!
=== on 1 Nov 2019, 16:29:43 Elena Vilchik wrote:
See \https://github.com/SonarSource/SonarJS/issues/1698
endif::env-github,rspecator-view[]