A szn label called "clear" breaks since integrating collections #1084

Closed
Stuk opened this Issue Dec 18, 2012 · 14 comments

Projects

None yet

3 participants

@Stuk
Member
Stuk commented Dec 18, 2012

5c596c4 made any labels called "clear" in the serialization break. This can be seen on HEAD of mfiddle, when you expand the console to reveal the Clear button.

@kriskowal @aadsm

@aadsm aadsm was assigned Dec 18, 2012
@aadsm aadsm added a commit to aadsm/montage that referenced this issue Dec 18, 2012
@aadsm aadsm [gh-1084] Serializer switch to Object.create(null)
Collections added specific properties to Object.prototype that made the (de)serializer brake, a change to Object.create(null) fixes all those issues.
07d041d
@aadsm
Member
aadsm commented Dec 20, 2012

Can we close this one?

@Stuk
Member
Stuk commented Dec 21, 2012

Afraid not. I'm really sorry, I should have checked this issue was solved by your PR before merging.

The instances object used here: https://github.com/montagejs/montage/blob/master/core/deserializer.js#L1106 and then throughout the deserializer actually comes from here: https://github.com/montagejs/montage/blob/master/ui/component.js#L946 and so clear is still on the prototype.

This case is a pretty simple fix, but I'm now worried there are going to be more gotchas later...

@aadsm
Member
aadsm commented Dec 21, 2012

Well spot, I think I'll just copy the properties over then, shouldn't trust the input.

@Stuk
Member
Stuk commented Dec 21, 2012

You could just set __proto__ to null :) And perhaps this should be done for any public method that accepts instances

@aadsm
Member
aadsm commented Dec 21, 2012

yeah, but that wouldn't work on IE :(

@aadsm
Member
aadsm commented Jan 24, 2013

Can we close this one?

@Stuk
Member
Stuk commented Jan 24, 2013

Still seems to be broken on montage master. See the Clear button on the console in mfiddle

@Stuk
Member
Stuk commented Feb 2, 2013

Will this be solved by mousse?

@aadsm
Member
aadsm commented Feb 3, 2013

I believe this problem won't exist anymore after FRB because we'll migrate from Object.prototype.clear to Object.clear, however, I'll make sure there's a test for that.

@mczepiel
Member

Any updates on this? (Feel free to close, I'm just spending some time trying to clear up old bugs)

@aadsm
Member
aadsm commented Jun 13, 2013

I believe it is because the latest mfiddle shows the clear button styled,
however it's not responding to click, not sure if it's related. I'm
planning to check it out tomorrow as I want to publish it too.

Best regards,
António Afonso

@aadsm
Member
aadsm commented Jun 26, 2013

Same issue but in another part of the code, it is fixed now!

@aadsm aadsm closed this Jun 26, 2013
@Stuk
Member
Stuk commented Jun 26, 2013

🎉

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