 # TODO: move to a separate file
 if require.main == module
   fs = require 'fs'
-  ClassFile = require '../src/ClassFile'
+  ClassFile = require './ClassFile'
   fname = if process.argv.length > 2 then process.argv[2] else '/dev/stdin'
   bytes_array = util.bytestr_to_array fs.readFileSync(fname, 'binary')
   class_data = new ClassFile bytes_array

    b.push t
  }

  athrow: { compile: (b) -> b.add_stmt new Expr "throw new util.JavaException($0)", b.pop() }

  checkcast: { compile: (b) ->
    target_class = c2t(@class).toExternalString()
    obj = b.pop()
    b.add_stmt new Expr """
        if (($0 != null) && !types.check_cast(rs, $0, #{JSON.stringify @class})) {
          util.java_throw(rs, 'java/lang/ClassCastException', $0.type.toExternalString()+" cannot be cast to #{target_class}");
        }""", obj
    b.push obj
  }

      next_block = @block_chain.get_block_from_instr handler.handler_pc
      @add_stmt """
        } catch (e) {
          if (!(e instanceof exceptions.JavaException)) throw e
      """
      if handler.catch_type == "<any>"
        @add_stmt "rs.push(e.exception); label = #{handler.handler_pc}; continue\n}"
