mirror of
https://github.com/rubyjs/therubyracer
synced 2023-03-27 23:21:42 -04:00
fix back reference to the highlevel context from the low-level context.
This commit is contained in:
parent
2c4d294bf1
commit
e09bfe5e84
2 changed files with 4 additions and 4 deletions
|
@ -73,7 +73,7 @@ module V8
|
|||
|
||||
def self.stack(limit = 99)
|
||||
if native = C::Context::GetEntered()
|
||||
global = native.Global().instance_eval {@native}
|
||||
global = native.Global()
|
||||
cxt = global.GetHiddenValue(C::String::NewSymbol("TheRubyRacer::RubyContext")).Value()
|
||||
cxt.instance_eval {@to.rb(C::StackTrace::CurrentStackTrace(limit))}
|
||||
else
|
||||
|
|
|
@ -11,10 +11,11 @@ describe C::Context do
|
|||
|
||||
it "can get the current javascript execution stack" do
|
||||
V8::Context.new do |cxt|
|
||||
trace = nil
|
||||
cxt['getTrace'] = lambda do
|
||||
V8::Context.stack
|
||||
trace = V8::Context.stack
|
||||
end
|
||||
trace = cxt.eval(<<-JS, 'trace.js')
|
||||
cxt.eval(<<-JS, 'trace.js')
|
||||
function one() {
|
||||
return two();
|
||||
}
|
||||
|
@ -28,7 +29,6 @@ describe C::Context do
|
|||
}
|
||||
one();
|
||||
JS
|
||||
|
||||
trace.length.should be(4)
|
||||
trace.first.tap do |frame|
|
||||
frame.line_number.should == 10
|
||||
|
|
Loading…
Add table
Reference in a new issue