Commit 2974f8e3 authored by prybin@chromium.org's avatar prybin@chromium.org

Support stepin for combination of apply and bound function

R=yangguo@chromium.org

Review URL: https://codereview.chromium.org/23513023

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16777 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 05797e77
......@@ -1793,10 +1793,14 @@ void Debug::HandleStepIn(Handle<JSFunction> function,
// function to be called and not the code for Builtins::FunctionApply or
// Builtins::FunctionCall. The receiver of call/apply is the target
// function.
if (!holder.is_null() && holder->IsJSFunction() &&
!JSFunction::cast(*holder)->IsBuiltin()) {
if (!holder.is_null() && holder->IsJSFunction()) {
Handle<JSFunction> js_function = Handle<JSFunction>::cast(holder);
Debug::FloodWithOneShot(js_function);
if (!js_function->IsBuiltin()) {
Debug::FloodWithOneShot(js_function);
} else if (js_function->shared()->bound()) {
// Handle Function.prototype.bind
Debug::FloodBoundFunctionWithOneShot(js_function);
}
}
} else {
Debug::FloodWithOneShot(function);
......
......@@ -142,8 +142,19 @@ function bind1() {
bound();
}
// Test step into apply of bound function.
function applyAndBind1() {
var bound = g.bind(null, 3);
debugger;
bound.apply(null, [3]);
var aLocalVar = 'test';
var anotherLocalVar = g(aLocalVar) + 's';
var yetAnotherLocal = 10;
}
var testFunctions =
[call1, call2, call3, call4, apply1, apply2, apply3, apply4, bind1];
[call1, call2, call3, call4, apply1, apply2, apply3, apply4, bind1,
applyAndBind1];
for (var i = 0; i < testFunctions.length; i++) {
state = 0;
......@@ -161,4 +172,4 @@ assertNull(exception);
assertEquals(3, state);
// Get rid of the debug event listener.
Debug.setListener(null);
\ No newline at end of file
Debug.setListener(null);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment