This repository was archived by the owner on Mar 1, 2022. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,9 +21,6 @@ class ModulemanComponent : ComponentWrapper
2121
2222 protected void load ()
2323 {
24- if (! refInstance)
25- throw new Exception (" moduleman requires to be instanced" );
26-
2724 config.stringBehavior = StringBehavior.source;
2825 }
2926
@@ -33,6 +30,9 @@ class ModulemanComponent : ComponentWrapper
3330 // / Returns: all changes that need to happen to rename the module. If no module statement could be found this will return an empty array.
3431 FileChanges[] rename (string mod, string rename, bool renameSubmodules = true )
3532 {
33+ if (! refInstance)
34+ throw new Exception (" moduleman.rename requires to be instanced" );
35+
3636 FileChanges[] changes;
3737 bool foundModule = false ;
3838 auto from = mod.split(' .' );
@@ -62,6 +62,9 @@ class ModulemanComponent : ComponentWrapper
6262 // / code: Current code inside the text buffer
6363 CodeReplacement[] normalizeModules (string file, string code)
6464 {
65+ if (! refInstance)
66+ throw new Exception (" moduleman.rename requires to be instanced" );
67+
6568 int [string ] modulePrefixes;
6669 modulePrefixes[" " ] = 0 ;
6770 string modName = file.replace(" \\ " , " /" ).stripExtension;
You can’t perform that action at this time.
0 commit comments