Created
January 23, 2020 03:19
-
-
Save Eyas/5617e6461963f2420265a2edab923fa6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+import {ok} from 'assert'; | |
+ | |
+const assert: <T>(item: T|undefined) => asserts | |
+ | |
function BuildClasses(topics: ReadonlyArray<TypedTopic>, classes: ClassMap) { | |
for (const topic of topics) { | |
if (!IsClass(topic)) continue; | |
const cls = classes.get(topic.Subject.toString()); | |
+ assert(cls); | |
- if (!cls) { | |
- throw new Error(/**... class should have been forward declared */); | |
- } | |
toClass(cls, topic, classes); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment