     scope.deferred = []
     scope.deferredBindings = []
     scope.boundTypeVariables = newSet()
+    scope.exportedNames = []
     scope.classes = newMap()
     scope.typeNames = newMap()
     scope.typeAliases = newMap()

    (filter _not, results).length + " failed"
# end of tests


exports.compileModuleTopLevel = compileModuleTopLevel
exports.compileModuleWithDependencies = compileModuleWithDependencies
exports.compileExpression = compileExpression

    else
      {js} = compileCtxIrToJs ctx, ir
  errors = checkTypes ctx
  # (finalizeTypes ctx, ast) # TODO: this doesn't work when the AST includes multiple modules with different contexts than the current one
  replaceOrAddToMap compiledModules, moduleName,
    declared: (subtractContexts ctx, (injectedContext toInject)) # must recompute because ctx is mutated
    js: js
