FuckItJSFuckItJS相當於對Ruby
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.
我決定什麼代碼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
,目前我評論進出我的部分代碼,看看有什麼導致錯誤。有沒有可以使這個過程自動化的庫?
計算的歷史散落着一些試圖修復或從你的代碼,以便刪除錯誤繼續下去,要麼找到下一個語法錯誤或試圖系統繼續。還沒有一個導致了百萬級聯語法錯誤。 – 2012-07-06 01:05:42
@PaulTomblin我的目標不是去除引起錯誤的代碼,而是確定哪些代碼會導致Rubinius拋出異常,並將其作爲Bug報告給Rubinius項目。 – 2012-07-06 01:09:25
內核/ delta/kernel.rb內核(Rubinius :: AST :: SplatValue)#body(method_missing):79' 回溯表示它在該行上調用未定義的方法 – ashgromnies 2012-07-06 01:11:53