therubyracer 0.5.2 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of therubyracer might be problematic. Click here for more details.
- data/History.txt +4 -0
- data/Rakefile +1 -1
- data/bin/therubyracer +2 -0
- data/ext/v8/v8_cxt.cpp +13 -4
- data/lib/v8.rb +1 -1
- data/lib/v8/context.rb +10 -0
- data/spec/redjs/jsapi_spec.rb +6 -1
- data/therubyracer.gemspec +2 -2
- metadata +2 -2
data/History.txt
CHANGED
data/Rakefile
CHANGED
@@ -9,7 +9,7 @@ begin
|
|
9
9
|
require 'jeweler'
|
10
10
|
Jeweler::Tasks.new do |gemspec|
|
11
11
|
gemspec.name = gemspec.rubyforge_project = "therubyracer"
|
12
|
-
gemspec.version = "0.5.
|
12
|
+
gemspec.version = "0.5.3"
|
13
13
|
gemspec.summary = "Embed the V8 Javascript interpreter into Ruby"
|
14
14
|
gemspec.description = "Call javascript code and manipulate javascript objects from ruby. Call ruby code and manipulate ruby objects from javascript."
|
15
15
|
gemspec.email = "cowboyd@thefrontside.net"
|
data/bin/therubyracer
CHANGED
data/ext/v8/v8_cxt.cpp
CHANGED
@@ -58,6 +58,15 @@ VALUE v8_cxt_open(VALUE self) {
|
|
58
58
|
}
|
59
59
|
}
|
60
60
|
|
61
|
+
VALUE Racer_Error_Message(TryCatch& exception) {
|
62
|
+
VALUE msg = V8_Ref_Create(V8_C_Message, exception.Message());
|
63
|
+
Local<Value> stack = exception.StackTrace();
|
64
|
+
if (!stack.IsEmpty()) {
|
65
|
+
rb_iv_set(msg,"@stack",V82RB(stack));
|
66
|
+
}
|
67
|
+
return msg;
|
68
|
+
}
|
69
|
+
|
61
70
|
VALUE v8_cxt_eval(VALUE self, VALUE source, VALUE filename) {
|
62
71
|
HandleScope handles;
|
63
72
|
TryCatch exceptions;
|
@@ -66,12 +75,12 @@ VALUE v8_cxt_eval(VALUE self, VALUE source, VALUE filename) {
|
|
66
75
|
Local<Value> source_str = RB2V8(source);
|
67
76
|
Local<Value> source_name = RTEST(filename) ? RB2V8(filename) : *String::New("<eval>");
|
68
77
|
Local<Script> script = Script::Compile(source_str->ToString(), source_name);
|
69
|
-
if (exceptions.HasCaught()) {
|
70
|
-
|
71
|
-
}
|
78
|
+
if (exceptions.HasCaught()) {
|
79
|
+
return Racer_Error_Message(exceptions);
|
80
|
+
}
|
72
81
|
Local<Value> result = script->Run();
|
73
82
|
if (exceptions.HasCaught()) {
|
74
|
-
return
|
83
|
+
return Racer_Error_Message(exceptions);
|
75
84
|
} else {
|
76
85
|
return V82RB(result);
|
77
86
|
}
|
data/lib/v8.rb
CHANGED
data/lib/v8/context.rb
CHANGED
@@ -95,7 +95,17 @@ module V8
|
|
95
95
|
@native.GetLineNumber()
|
96
96
|
end
|
97
97
|
|
98
|
+
def javascript_stacktrace
|
99
|
+
@native.stack
|
100
|
+
end
|
101
|
+
|
98
102
|
end
|
99
103
|
class RunawayScriptError < ContextError
|
100
104
|
end
|
105
|
+
|
106
|
+
module C
|
107
|
+
class Message
|
108
|
+
attr_reader :stack
|
109
|
+
end
|
110
|
+
end
|
101
111
|
end
|
data/spec/redjs/jsapi_spec.rb
CHANGED
@@ -373,7 +373,12 @@ EOJS
|
|
373
373
|
it "is enumenable" do
|
374
374
|
@cxt.open do
|
375
375
|
evaljs("o.foo = 'bar'; o.bang = 'baz'; o[5] = 'flip'")
|
376
|
-
|
376
|
+
{}.tap do |h|
|
377
|
+
@o.each do |k,v|
|
378
|
+
h[k] = v
|
379
|
+
end
|
380
|
+
h.should == {"foo" => 'bar', "bang" => 'baz', 5 => 'flip'}
|
381
|
+
end
|
377
382
|
end
|
378
383
|
end
|
379
384
|
end
|
data/therubyracer.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{therubyracer}
|
8
|
-
s.version = "0.5.
|
8
|
+
s.version = "0.5.3"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Charles Lowell", "Bill Robertson"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-03-01}
|
13
13
|
s.default_executable = %q{therubyracer}
|
14
14
|
s.description = %q{Call javascript code and manipulate javascript objects from ruby. Call ruby code and manipulate ruby objects from javascript.}
|
15
15
|
s.email = %q{cowboyd@thefrontside.net}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: therubyracer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Charles Lowell
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2010-
|
13
|
+
date: 2010-03-01 00:00:00 -06:00
|
14
14
|
default_executable: therubyracer
|
15
15
|
dependencies: []
|
16
16
|
|