0

他妈的它

Javascript 错误 Steamroller

FuckItJS 使用最先进的技术来确保您的 JavaScript 代码运行,无论您的编译器喜欢与否。

技术

通过称为 Eval-Rinse-Reload-And-Repeat 的过程,FuckItJS 反复编译您的代码,检测错误并将这些行从脚本中删除。为了在如此暴力的过程中生存下来,FuckItJS 在每次迭代后都会重新加载自己,从而允许 onerror 处理程序捕获您编写得非常糟糕的代码中的每一个错误。

我正在确定lib/my_file.rb导致 Rubinius 出现以下错误的代码:

$ 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

目前我正在评论我的部分代码以查看导致错误的原因。是否有可以自动化此过程的库?

4

1 回答 1

1

他妈的.rb

https://github.com/programble/fuckit.rb

于 2012-07-24T07:36:29.970 回答