1
1
mirror of https://github.com/github/semantic.git synced 2024-12-30 02:14:20 +03:00

Move reference into case maybeConstructor

This commit is contained in:
joshvera 2018-12-20 20:01:41 -05:00
parent d830cd1f2a
commit 64d847833c

View File

@ -660,11 +660,11 @@ instance Evaluatable New where
-- TODO: This is a typescript specific name and we should allow languages to customize it.
let constructorName = Name.name "constructor"
span <- ask @Span
reference (Reference constructorName) span ScopeGraph.New (Declaration constructorName)
maybeConstructor <- maybeLookupDeclaration (Declaration constructorName)
case maybeConstructor of
Just slot -> do
span <- ask @Span
reference (Reference constructorName) span ScopeGraph.New (Declaration constructorName)
constructor <- deref slot
args <- traverse eval arguments
boundConstructor <- bindThis objectVal constructor