Skip to content

Commit

Permalink
use strict typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
TheFireBlast committed Jun 30, 2022
1 parent 06e41f9 commit edd8bab
Show file tree
Hide file tree
Showing 3 changed files with 250 additions and 225 deletions.
6 changes: 5 additions & 1 deletion src/ScopeManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,17 @@ export class ScopeManager {
set(name: string, value: Attribute) {
this.current.set(name, new CompiledAttribute(name, value.type, this.current, value));
}
get(name: string, scope: Scope = this.current) {
get<certain extends boolean>(
name: string,
scope: Scope = this.current
): certain extends true ? CompiledAttribute : CompiledAttribute | undefined {
var s: Scope | undefined = scope;
while (s) {
var x = s.get(name);
if (x !== undefined) return x;
s = s.parent;
}
//@ts-expect-error
return undefined;
}
getPath(scope = this.current) {
Expand Down
Loading

0 comments on commit edd8bab

Please sign in to comment.