From dce8dd027ec376c6608be38a4a5cc33c86999460 Mon Sep 17 00:00:00 2001 From: Charles Lowell Date: Tue, 15 Jun 2010 23:04:50 +0300 Subject: [PATCH] pickup rename JavascriptError -> JSError in shell. --- lib/v8/cli.rb | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/lib/v8/cli.rb b/lib/v8/cli.rb index 5e0e918..828c13f 100644 --- a/lib/v8/cli.rb +++ b/lib/v8/cli.rb @@ -52,8 +52,9 @@ module V8 def self.load(cxt, libfile) begin cxt.load(libfile) - rescue V8::JavascriptError => e - puts e.javascript_stacktrace + rescue V8::JSError => e + puts e.message + puts e.backtrace(:javascript) rescue StandardError => e puts e end @@ -87,10 +88,12 @@ module V8 begin result = cxt.eval(line, '') puts(result) unless result.nil? - rescue V8::JavascriptError => e - puts e.javascript_stacktrace + rescue V8::JSError => e + puts e.message + puts e.backtrace(:javascript) rescue StandardError => e puts e + puts e.backtrace.join("\n") end end end @@ -99,15 +102,11 @@ module V8 def to_s "[object Shell]" end - + def print(string) puts string end - - def evalrb(src) - eval(src) - end - + def exit(status = 0) Kernel.exit(status) end