Only create scope in LetDeclaration if it is a function
This commit is contained in:
parent
d81e92231f
commit
35bcf38eb3
1 changed files with 6 additions and 3 deletions
|
@ -1995,10 +1995,13 @@ namespace bolt {
|
|||
Body(Body) {}
|
||||
|
||||
inline Scope* getScope() override {
|
||||
if (TheScope == nullptr) {
|
||||
TheScope = new Scope(this);
|
||||
if (isFunction()) {
|
||||
if (TheScope == nullptr) {
|
||||
TheScope = new Scope(this);
|
||||
}
|
||||
return TheScope;
|
||||
}
|
||||
return TheScope;
|
||||
return Parent->getScope();
|
||||
}
|
||||
|
||||
bool isInstance() const noexcept {
|
||||
|
|
Loading…
Reference in a new issue