Class dependency order issue in 0.8 #311

Open
theoutlander opened this Issue Dec 24, 2012 · 1 comment

Projects

None yet

2 participants

@theoutlander

I'm not sure if this is a similar issue to #62, but there are times when the generated Javascript doesn't define the classes in the order of execution (or something on those lines) resulting in the objects utilizing those classes being null.

In the past, I avoided this issue by renaming the namespaces. However, this time I have classes that are part of an object heirarchy and cannot be moved into a different namespace.

@nikhilk
Owner
nikhilk commented Dec 26, 2012

At this point the best suggestion I have is to write a module class (internal static class annotated with [Module] with a static ctor) and do your assembly level static initialization there where you control the order explicitly if you have scenarios where there are inter-dependencies between classes and their static members.

Some level of ordering can be achieved by ordering sources, but obviously this is brittle, and painful to maintain.

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