Question

FuckItJS

Javascript Error Steamroller

FuckItJS uses state-of-the-art technology to make sure your javascript code runs whether your compiler likes it or not.

Technology

Through a process known as Eval-Rinse-Reload-And-Repeat, FuckItJS repeatedly compiles your code, detecting errors and slicing those lines out of the script. To survive such a violent process, FuckItJS reloads itself after each iteration, allowing the onerror handler to catch every single error in your terribly written code.

I'm determining what code in lib/my_file.rb is causing Rubinius to have the following error:

$ ruby lib/my_file.rb 
An exception occurred running lib/my_file.rb
    Error trying to compile /path/to/lib/my_file.rb (Rubinius::CompileError)

Backtrace:
 Rubinius::Compiler.compiler_error at /Users/agrimm/.rbenv/versions/rbx-1.2.4
                                      /lib/compiler/compiler.rbc:11
        Rubinius::Compiler.compile at /Users/agrimm/.rbenv/versions/rbx-1.2.4
                                      /lib/compiler/compiler.rbc:62
  Rubinius::CodeLoader#compile_file at kernel/delta/codeloader.rb:146
     Rubinius::CodeLoader#load_file at kernel/delta/codeloader.rb:118
   Rubinius::CodeLoader#load_script at kernel/delta/codeloader.rb:61
   Rubinius::CodeLoader.load_script at kernel/delta/codeloader.rb:90
            Rubinius::Loader#script at kernel/loader.rb:618
              Rubinius::Loader#main at kernel/loader.rb:762

Caused by: undefined method `body' on an instance of Rubinius::AST::SplatValue. (NoMethodError)

Backtrace:
  Kernel(Rubinius::AST::SplatValue)#body (method_missing) at kernel/delta/kernel.rb:79
  Rubinius::AST::OpAssign1#initialize at /Users/agrimm/.rbenv/versions/rbx-1.2.4
                                         /lib/compiler/ast/operators.rbc:136
 Rubinius::Melbourne#process_op_asgn1 at /Users/agrimm/.rbenv/versions/rbx-1.2.4
                                         /lib/melbourne/processor.rbc:332
      Rubinius::Melbourne#file_to_ast at /private/var/folders/3x
                                         /y_8y8vr53ws_kxj97km79q5h0000gn/T
                                         /ruby-build.20120706090940.39603
                                         /rubinius-1.2.4/lib/ext/melbourne
                                         /melbourne.cpp
       Rubinius::Melbourne#parse_file at /Users/agrimm/.rbenv/versions/rbx-1.2.4
                                         /lib/melbourne.rbc:83
 Rubinius::Compiler::FileParser#parse at /Users/agrimm/.rbenv/versions/rbx-1.2.4
                                         /lib/compiler/stages.rbc:219
  Rubinius::Compiler::Parser(Rubinius::Compiler::FileParser)#run at \
          /Users/agrimm/.rbenv/versions/rbx-1.2.4/lib/compiler/stages.rbc:202
               Rubinius::Compiler#run at /Users/agrimm/.rbenv/versions/rbx-1.2.4
                                         /lib/compiler/compiler.rbc:332
           Rubinius::Compiler.compile at /Users/agrimm/.rbenv/versions/rbx-1.2.4
                                         /lib/compiler/compiler.rbc:58
     Rubinius::CodeLoader#compile_file at kernel/delta/codeloader.rb:146
        Rubinius::CodeLoader#load_file at kernel/delta/codeloader.rb:118
      Rubinius::CodeLoader#load_script at kernel/delta/codeloader.rb:61
      Rubinius::CodeLoader.load_script at kernel/delta/codeloader.rb:90
               Rubinius::Loader#script at kernel/loader.rb:618
                 Rubinius::Loader#main at kernel/loader.rb:762

and currently I'm commenting in and out parts of my code to see what causes the error. Is there a library that can automate this process?

Was it helpful?
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top