                         ir.setInsertPoint saved_insert_point
                         rv = @createLoad arguments_alloca, "load_arguments"
                         return rv
-                        
-                throw new Error "identifier not found: #{exp.arguments[0].name}"
+
+                reportError(ReferenceError, "identifier not found: #{exp.arguments[0].name}", @filename, exp.arguments[0].loc)
 
         handleSetLocal: (exp, opencode) ->
                 dest = @findIdentifierInScope exp.arguments[0].name


{ ExitableScope, TryExitableScope, SwitchExitableScope, LoopExitableScope } = require 'exitable-scope'

types = require 'types'
consts = require 'consts'
runtime = require 'runtime'

                        #key = if property.key.type is Identifier then @getAtom property.key.name else @visit property.key

                        if propkey.type is ComputedPropertyKey
                                propkey = @visit propkey.expression
                        else if propkey.type is Literal
                                propkey = @getAtom String(propkey.value)
                        else if propkey.type is Identifier
                                propkey = @getAtom propkey.name

                        if prop_map.has("init")
                                val = @visit(prop_map.get("init").value)
