#Include generally has no impact on anything. The demonstration is much clearer if you substitute the file contents for the directives (and omit the directive which is ignored because the file was already included).
Code: Select all
class A extends B{
test()=>1
}
class C extends D{
}
class D{
}
class B extends C{
}
The bug occurs because at the time of each attempt to resolve
extends C (first when
class B is parsed and then again after reaching the end of the file),
C exists but has no base (not even
Class.Prototype) and therefore isn't considered to be a class.
extends D would be resolved after that, if not for the error.
The method of resolving out-of-order class definitions had to be changed to support modules.