Closed JarrettBillingsley closed 9 years ago
I dunno, like.. classes separate member creation from member update because those operations differ for frozen classes, but for namespaces there's not really a compelling reason to force you to "add" namespace members when manipulating them directly. The global declaration thing is there to catch bugs. So I'll pass.
Namespace field behavior no longer matches up with classes. Whereas classes need to have a member added before getting or setting it, namespaces only error on getting invalid fields but are fine with setting them.
Even stranger, namespace field access doesn't match global access behavior, even though both are accessing the same type of object. Global access behavior works the same as classes (have to define the global first, error to redefine a global, getting OR setting an undefined global is an error).