1
0
mirror of https://github.com/1C-Company/v8-code-style.git synced 2025-12-06 02:15:13 +02:00
Files
v8-code-style/bundles/com.e1c.v8codestyle.bsl/markdown/common-module-named-self-reference.md

48 lines
713 B
Markdown
Raw Normal View History

# Excessive named self reference in common module
Excessive usage of named self reference in common module (when referencing method, property or attribute).
For cached modules self reference is allowed.
## Noncompliant Code Example
Inside common module named "MyModule":
```bsl
Var myParam;
Function test() Export
// code here
EndFunction
MyModule.myParam = MyModule.test();
```
## Compliant Solution
Inside common module named "MyModule":
```bsl
Var myParam;
Function test() Export
// code here
EndFunction
myParam = test();
```
Inside common module named "MyModuleCached":
```bsl
Var myParam;
Function test() Export
// code here
EndFunction
myParam = MyModuleCached.test();
```
## See