Browse files

added localVars for javascript-analysis

  • Loading branch information...
1 parent 1e6e526 commit ece7f0cac9e059b5fece90e6c8933beec6732e07 Arjun Guha committed Apr 3, 2009
Showing with 6 additions and 0 deletions.
  1. +6 −0 src/BrownPLT/JavaScript/Environment.hs
View
6 src/BrownPLT/JavaScript/Environment.hs
@@ -1,5 +1,6 @@
module BrownPLT.JavaScript.Environment
( env
+ , localVars
, EnvTree (..)
) where
@@ -137,3 +138,8 @@ env :: Map String SourcePos -- ^browser/testing environment
-> [Statement SourcePos]
-> (EnvTree,Map String SourcePos)
env globals program = makeEnvTree globals (unions $ map stmt program)
+
+localVars :: [Statement SourcePos]
+ -> Set String
+localVars body = S.fromList (M.keys locals) where
+ Partial locals _ _ = unions $ map stmt body

0 comments on commit ece7f0c

Please sign in to comment.