mirror of
https://github.com/Leaflet/Leaflet.git
synced 2025-08-15 22:36:58 +00:00
Break the reference to the options of the Class prototype (#7459)
* Break the reference to the options of the Class prototype * Refactor test and .setOptions * Revert: Merge https://github.com/Leaflet/Leaflet into class_options
This commit is contained in:
@ -154,6 +154,12 @@ describe("Class", function () {
|
||||
expect(props.options).to.be(opts);
|
||||
});
|
||||
|
||||
it("prevents change of prototype options", function () {
|
||||
var Klass = L.Class.extend({options: {}});
|
||||
var instance = new Klass();
|
||||
expect(Klass.prototype.options).to.not.be(instance.options);
|
||||
});
|
||||
|
||||
it("adds constructor hooks correctly", function () {
|
||||
var spy1 = sinon.spy();
|
||||
|
||||
|
Reference in New Issue
Block a user