> No. I am suggesting that Object.freeze() should not have been added to > the language unless an error was thrown when the object is modified, > full stop. Having a feature like Object.freeze() that does not give an > error when you modify the object is unreasonable. I'm completely > baffled that reasonable engineers would disagree with this position. > > The coupling between freeze() and "use strict" comes exactly because > library engineers would not use freeze() if they knew that it gave no > errors. But because the library engineers "use strict" they don't know > that their users may suffer from this language defect. > > Or to say it another way, if the error were thrown in non-strict mode, > then I would not complain to you I would complain to the library > writer. > > Again "should not have been" means "let's not make this mistake again".
Not I get what you mean: You are saying that if, as a library writer, you want to use freeze the “proper” way, you have to force library clients to use strict mode. Don’t forget, though, that strict mode is a paraphrase for “JavaScript how it should be”. So there must be a rationale behind making it fail silently in non-strict mode. I personally don’t mind too much, because the object is frozen either way, things just fail much later in non-strict mode. -- Dr. Axel Rauschmayer [email protected] twitter.com/rauschma Home: rauschma.de Blog: 2ality.com _______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

