Home | History | Annotate | Download | only in cctest

Lines Matching refs:Function

68 // Helper function used by the CHECK_EQ function when given Address
83 // Helper function used by the CHECK_NE function when given Address
97 // Helper function used by the CHECK function when given code
169 // Compile and run the supplied source and return the fequested function.
170 static v8::Local<v8::Function> CompileFunction(DebugLocalContext* env,
174 return v8::Local<v8::Function>::Cast(
179 // Compile and run the supplied source and return the requested function.
180 static v8::Local<v8::Function> CompileFunction(const char* source,
183 return v8::Local<v8::Function>::Cast(
188 // Is there any debug info for the function?
189 static bool HasDebugInfo(v8::Handle<v8::Function> fun) {
196 // Set a break point in a function and return the associated break point
210 // Set a break point in a function and return the associated break point
212 static int SetBreakPoint(v8::Handle<v8::Function> fun, int position) {
217 // Set a break point in a function using the Debug object and return the
378 // This function is in namespace v8::internal to be friend with class
484 // Compile a function, set a break point and check that the call at the break
485 // location in the code is the expected debug_break function.
492 // Create function and set the break point.
497 // Check that the debug break function is as expected.
514 // Clear the break point and check that the debug break function is no longer
538 // Source for the JavaScript function which picks out the function
541 "function frame_function_name(exec_state, frame_number) {"
544 v8::Local<v8::Function> frame_function_name;
547 // Source for the JavaScript function which pick out the name of the
550 "function frame_argument_name(exec_state, frame_number) {"
553 v8::Local<v8::Function> frame_argument_name;
556 // Source for the JavaScript function which pick out the value of the
559 "function frame_argument_value(exec_state, frame_number) {"
562 v8::Local<v8::Function> frame_argument_value;
565 // Source for the JavaScript function which pick out the name of the
568 "function frame_local_name(exec_state, frame_number) {"
571 v8::Local<v8::Function> frame_local_name;
574 // Source for the JavaScript function which pick out the value of the
577 "function frame_local_value(exec_state, frame_number) {"
580 v8::Local<v8::Function> frame_local_value;
583 // Source for the JavaScript function which picks out the source line for the
586 "function frame_source_line(exec_state) {"
589 v8::Local<v8::Function> frame_source_line;
592 // Source for the JavaScript function which picks out the source column for the
595 "function frame_source_column(exec_state) {"
598 v8::Local<v8::Function> frame_source_column;
601 // Source for the JavaScript function which picks out the script name for the
604 "function frame_script_name(exec_state) {"
607 v8::Local<v8::Function> frame_script_name;
610 // Source for the JavaScript function which picks out the script data for the
613 "function frame_script_data(exec_state) {"
616 v8::Local<v8::Function> frame_script_data;
619 // Source for the JavaScript function which picks out the script data from
622 "function compiled_script_data(event_data) {"
625 v8::Local<v8::Function> compiled_script_data;
628 // Source for the JavaScript function which returns the number of frames.
630 "function frame_count(exec_state) {"
633 v8::Handle<v8::Function> frame_count;
636 // Global variable to store the last function hit - used by some tests.
663 // Get the name of the function.
698 // Get the script name of the function script.
713 // Get the script data of the function script.
751 // height if there is a function compiled for that.
779 v8::Local<v8::Function> fun =
780 v8::Function::Cast(*event_data->Get(fun_name));
787 // Collect the JavsScript stack height if the function frame_count is
804 // evaluate_check_function: A JavaScript function (see below)
813 // Source for The JavaScript function which can do the evaluation when a break
816 "function evaluate_check(exec_state, expr, expected) {"
819 v8::Local<v8::Function> evaluate_check_function;
847 // This debug event listener removes a breakpoint in a function
884 // afterwards. For each call the expected function is checked.
887 // expected_step_sequence: An array of the expected function call sequence.
888 // frame_function_name: A JavaScript function (see below).
890 // String containing the expected function call sequence. Note: this only works
904 // Check that the current function is the expected.
991 // Collect the JavsScript stack height if the function frame_count is
1038 // Test that the debug break function is the expected one for different kinds
1047 "function f1(){}", "f1",
1052 "function f2(){x=1;}", "f2",
1058 "function f3(){var a=x;}", "f3",
1071 "function f4(){var index='propertyName'; var a={}; a[index] = 'x';}",
1079 "function f5(){var index='propertyName'; var a={}; return a[index];}",
1094 "function f4_0(){x();}", "f4_0",
1100 "function f4_1(){x(1);}", "f4_1",
1106 "function f4_4(){x(1,2,3,4);}", "f4_4",
1119 v8::Local<v8::Function> foo =
1120 CompileFunction(&env, "function foo(){}", "foo");
1121 v8::Local<v8::Function> bar =
1122 CompileFunction(&env, "function bar(){}", "bar");
1127 // One function (foo) is debugged.
1137 // One function (bar) is debugged.
1158 v8::Script::Compile(v8::String::New("function foo(){bar=0;}"))->Run();
1159 v8::Local<v8::Function> foo =
1160 v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("foo")));
1191 v8::Script::Compile(v8::String::New("function foo(){var x=bar;}"))->Run();
1192 v8::Local<v8::Function> foo =
1193 v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("foo")));
1223 v8::Script::Compile(v8::String::New("function bar(){}"))->Run();
1224 v8::Script::Compile(v8::String::New("function foo(){bar();}"))->Run();
1225 v8::Local<v8::Function> foo =
1226 v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("foo")));
1256 v8::Script::Compile(v8::String::New("function bar(){return 1;}"))->Run();
1257 v8::Script::Compile(v8::String::New("function foo(){return bar();}"))->Run();
1258 v8::Local<v8::Function> foo =
1259 v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("foo")));
1289 v8::Script::Compile(v8::String::New("function bar(){ this.x = 1;}"))->Run();
1291 "function foo(){return new bar(1).x;}"))->Run();
1292 v8::Local<v8::Function> foo =
1293 v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("foo")));
1334 v8::Script::Compile(v8::String::New("function foo(){}"))->Run();
1335 v8::Local<v8::Function> foo =
1336 v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("foo")));
1364 v8::Local<v8::Function> f,
1382 v8::Local<v8::Function> foo;
1385 foo = CompileFunction(&env, "function foo(){bar=0;}", "foo");
1390 foo = CompileFunction(&env, "bar=1;function foo(){var x=bar;}", "foo");
1395 foo = CompileFunction(&env, "function bar(){};function foo(){bar();}", "foo");
1400 foo = CompileFunction(&env, "function foo(){}", "foo");
1405 foo = CompileFunction(&env, "function foo(){var a;}", "foo");
1414 // Call the function three times with different garbage collections in between
1417 v8::Local<v8::Function> f) {
1421 // Call function.
1425 // Scavenge and call function.
1430 // Mark sweep (and perhaps compact) and call function.
1446 v8::Local<v8::Function> foo;
1450 CompileFunction(&env, "function foo(){}", "foo");
1451 foo = CompileFunction(&env, "function foo(){bar=0;}", "foo");
1458 CompileFunction(&env, "function foo(){}", "foo");
1459 foo = CompileFunction(&env, "bar=1;function foo(){var x=bar;}", "foo");
1466 CompileFunction(&env, "function foo(){}", "foo");
1468 "function bar(){};function foo(){bar();}",
1476 CompileFunction(&env, "function foo(){}", "foo");
1477 foo = CompileFunction(&env, "function foo(){}", "foo");
1484 CompileFunction(&env, "function foo(){}", "foo");
1485 foo = CompileFunction(&env, "function foo(){var bar=0;}", "foo");
1505 v8::Script::Compile(v8::String::New("function bar(){}"))->Run();
1506 v8::Script::Compile(v8::String::New("function foo(){bar();bar();}"))->Run();
1563 "function f() {\n"
1564 " function h() {\n"
1571 "function g() {\n"
1572 " function h() {\n"
1585 v8::Local<v8::Function> f =
1586 v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("f")));
1587 v8::Local<v8::Function> g =
1588 v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("g")));
1667 "function f() {\n"
1668 " function h() {\n"
1675 "function g() {\n"
1676 " function h() {\n"
1690 v8::Local<v8::Function> f =
1691 v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("f")));
1692 v8::Local<v8::Function> g =
1693 v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("g")));
1776 "function f() {\n"
1780 // Compile the script and get function f.
1784 v8::Local<v8::Function> f =
1785 v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("f")));
1787 // Set script break point on line 1 (in function f).
1809 f = v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("f")));
1834 "function f() {\n"
1837 "function g(x) {\n"
1841 // Compile the script and get function f.
1845 v8::Local<v8::Function> f =
1846 v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("f")));
1848 // Set script break point on line 5 (in function g).
1871 f = v8::Local<v8::Function
1895 "function f() {\n"
1899 // Compile the script and get function f.
1903 v8::Local<v8::Function> f =
1904 v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("f")));
1906 // Set script break point on line 1 (in function f).
1926 f = v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("f")));
1949 v8::Local<v8::Function> f;
1951 "function f() {\n"
1952 " function h() {\n"
1965 // Compile the script and get the function.
1967 f = v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("f")));
1975 // function.
1977 f = v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("f")));
1984 // Compile the script again and get the function.
1986 f = v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("f")));
2008 v8::Local<v8::Function> f;
2010 "function f() {\n"
2014 v8::Local<v8::Function> g;
2016 "function g() {\n"
2028 f = v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("f")));
2030 g = v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("g")));
2074 v8::Local<v8::Function> f;
2076 "function f() {\n"
2089 // Compile the script and get the function.
2091 f = v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("f")));
2126 // Create a function for checking the function when hitting a break point.
2134 v8::Local<v8::Function> f;
2135 v8::Local<v8::Function> g;
2138 "function f() {\n"
2142 " /* xx */ function g() { // line 5\n"
2143 " function h() { // line 6\n"
2156 // Compile the script and get the function.
2160 f = v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("f")));
2161 g = v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("g")));
2203 // Set a break point in the code after the last function decleration.
2236 "function f() {\n"
2240 v8::Local<v8::Function> f;
2245 f = v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("f")));
2263 f = v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("f")));
2272 // function which has no references but has not been collected yet.
2282 "function f() {\n"
2304 // Test that it is possible to remove the last break point for a function
2310 v8::Local<v8::Function> foo =
2311 CompileFunction(&env, "function foo(){a=1;}", "foo");
2314 // Register the debug event listener pasing the function
2337 v8::Script::Compile(v8::String::New("function bar(){debugger}"))->Run();
2339 "function foo(){debugger;debugger;}"))->Run();
2340 v8::Local<v8::Function> foo =
2341 v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("foo")));
2342 v8::Local<v8::Function> bar =
2343 v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("bar")));
2345 // Run function with debugger statement
2349 // Run function with two debugger statement
2365 v8::Script::Compile(v8::String::New("function foo(){debugger;}"))->Run();
2366 v8::Local<v8::Function> foo =
2367 v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("foo")));
2392 // Create a function for checking the evaluation when hitting a break point.
2417 // Simple test function. The "y=0" is in the function foo to provide a break
2418 // location. For "y=0" the "y" is at position 15 in the barbar function
2421 v8::Local<v8::Function> foo = CompileFunction(&env,
2422 "function foo(x) {"
2450 // Test function with an inner function. The "y=0" is in function barbar
2452 // barbar function therefore setting breakpoint at position 8 will break at
2454 v8::Local<v8::Function> bar = CompileFunction(&env,
2457 "function bar(x, b) {"
2459 " function barbar() {"
2610 "var v1 = 'Pinguin';\n function getAnimal() { return 'Capy' + 'bara'; }";
2669 // Create a function for testing stepping.
2670 v8::Local<v8::Function> foo = CompileFunction(&env,
2671 "function foo(){a=1;b=1;c=1;}",
2715 // Create a function for testing stepping of keyed load. The statement 'y=1'
2717 v8::Local<v8::Function> foo = CompileFunction(
2719 "function foo(a) {\n"
2736 // Call function without any break points to ensure inlining is in place.
2741 // Set up break point and step through the function.
2763 // Create a function for testing stepping of keyed store. The statement 'y=1'
2765 v8::Local<v8::Function> foo = CompileFunction(
2767 "function foo(a) {\n"
2783 // Call function without any break points to ensure inlining is in place.
2788 // Set up break point and step through the function.
2810 // Create a function for testing stepping of named load.
2811 v8::Local<v8::Function> foo = CompileFunction(
2813 "function foo() {\n"
2823 "function V(x, y) {\n"
2829 // Call function without any break points to ensure inlining is in place.
2832 // Set up break point and step through the function.
2853 // Create a function for testing stepping of named store.
2854 v8::Local<v8::Function> foo = CompileFunction(
2856 "function foo() {\n"
2864 // Call function without any break points to ensure inlining is in place.
2867 // Set up break point and step through the function.
2895 // Create a function for testing stepping.
2896 v8::Local<v8::Function> foo = CompileFunction(&env,
2897 "function bar() {};"
2898 "function foo() {"
2941 // Create a function for testing stepping. Run it to allow it to get
2943 const char* src = "function foo() { "
2951 v8::Local<v8::Function> foo = CompileFunction(&env, src, "foo");
2974 // Create a function for testing stepping. Run it to allow it to get
2976 const char* src = "function foo() { "
2984 v8::Local<v8::Function> foo = CompileFunction(&env, src, "foo");
3007 // Create a function for testing stepping. Run it to allow it to get
3010 const char* src = "function foo(x) { "
3020 v8::Local<v8::Function> foo = CompileFunction(&env, src, "foo");
3050 // Create a function for testing stepping. Run it to allow it to get
3053 const char* src = "function foo(x) { "
3069 v8::Local<v8::Function> foo = CompileFunction(&env, src, "foo");
3106 // Create a function for testing stepping. Run it to allow it to get
3109 const char* src = "function foo(x) { "
3116 v8::Local<v8::Function> foo = CompileFunction(&env, src, "foo");
3146 // Create a function for testing stepping. Run it to allow it to get
3149 const char* src = "function foo(x) { "
3156 v8::Local<v8::Function> foo = CompileFunction(&env, src, "foo");
3186 // Create a function for testing stepping. Run it to allow it to get
3189 const char* src = "function foo(x) { "
3196 v8::Local<v8::Function> foo = CompileFunction(&env, src, "foo");
3227 // Create a function for testing stepping. Run it to allow it to get
3230 const char* src = "function foo(x) { "
3243 v8::Local<v8::Function> foo = CompileFunction(&env, src, "foo");
3278 // Create a function for testing stepping. Run it to allow it to get
3281 const char* src = "function foo(x) { "
3294 v8::Local<v8::Function> foo = CompileFunction(&env, src, "foo");
3330 // Create a function for testing stepping. Run it to allow it to get
3332 v8::Local<v8::Function> foo;
3333 const char* src_1 = "function foo() { "
3348 // Create a function for testing stepping. Run it to allow it to get
3350 const char* src_2 = "function foo() { "
3378 // Create a function for testing stepping. Run it to allow it to get
3380 const char* src = "function foo(x) { "
3387 v8::Local<v8::Function> foo = CompileFunction(&env, src, "foo");
3409 // Create a function for testing stepping. Run it to allow it to get
3411 const char* src = "function foo(x) { "
3417 v8::Local<v8::Function> foo = CompileFunction(&env, src, "foo");
3442 // Create a function for checking the function when hitting a break point.
3450 // Create a function for testing stepping. Run it to allow it to get
3452 const char* src = "function a() {b();c();}; "
3453 "function b() {c();}; "
3454 "function c() {}; "
3456 v8::Local<v8::Function> a = CompileFunction(&env, src, "a");
3493 // Create a function for checking the function when hitting a break point.
3501 // Create a function for testing stepping. Run it to allow it to get
3503 const char* src = "function a() {b(c(d()),d());c(d());d()}; "
3504 "function b(x,y) {c();}; "
3505 "function c(x) {}; "
3506 "function d() {}; "
3508 v8::Local<v8::Function> a = CompileFunction(&env, src, "a");
3545 // Create a function for checking the function when hitting a break point.
3553 // Create a function for testing stepping. Run it to allow it to get
3555 const char* src = "function a() {b(false);c();}; "
3556 "function b(x) {if(x){c();};}; "
3557 "function c() {}; "
3559 v8::Local<v8::Function> a = CompileFunction(&env, src, "a");
3581 // Create a function for testing stepping.
3582 v8::Local<v8::Function> foo = CompileFunction(
3584 "function foo(){debugger;Math.sin(1);}",
3614 // Test that step in works with function.apply.
3619 // Create a function for testing stepping.
3620 v8::Local<v8::Function> foo = CompileFunction(
3622 "function bar(x, y, z) { if (x == 1) { a = y; b = z; } }"
3623 "function foo(){ debugger; bar.apply(this, [1,2,3]); }",
3653 // Test that step in works with function.call.
3658 // Create a function for testing stepping.
3659 v8::Local<v8::Function> foo = CompileFunction(
3661 "function bar(x, y, z) { if (x == 1) { a = y; b = z; } }"
3662 "function foo(a){ debugger;"
3713 // Create a script that returns a function.
3714 const char* src = "(function (evt) {})";
3749 CompileFunction(&env, "function throws(){throw 1;}", "throws");
3750 v8::Local<v8::Function> caught =
3752 "function caught(){try {throws();} catch(e) {};}",
3754 v8::Local<v8::Function> notCaught =
3755 CompileFunction(&env, "function notCaught(){throws();}", "notCaught");
3894 // Create a function for checking the function when hitting a break point.
3946 // Create a function for checking the function when hitting a break point.
3955 const char* src = "function a() { n(); }; "
3956 "function b() { c(); }; "
3957 function c() { n(); }; "
3958 "function d() { x = 1; try { e(); } catch(x) { x = 2; } }; "
3959 "function e() { n(); }; "
3960 "function f() { x = 1; try { g(); } catch(x) { x = 2; } }; "
3961 "function g() { h(); }; "
3962 "function h() { x = 1; throw 1; }; ";
3965 v8::Local<v8::Function> a = CompileFunction(&env, src, "a");
3975 v8::Local<v8::Function> b = CompileFunction(&env, src, "b");
3984 v8::Local<v8::Function> d = CompileFunction(&env, src, "d");
4004 v8::Local<v8::Function> f = CompileFunction(&env, src, "f");
4042 // Create a function for testing stepping.
4043 const char* src = "function f0() {}"
4044 "function f1(x1) {}"
4045 "function f2(x1,x2) {}"
4046 "function f3(x1,x2,x3) {}";
4047 v8::Local<v8::Function> f0 = CompileFunction(&env, src, "f0");
4048 v8::Local<v8::Function> f1 = CompileFunction(&env, src, "f1");
4049 v8::Local<v8::Function> f2 = CompileFunction(&env, src, "f2");
4050 v8::Local<v8::Function> f3 = CompileFunction(&env, src, "f3");
4052 // Call the function to make sure it is compiled.
4076 // One break for each function called.
4094 // Create a function for testing stepping.
4095 const char* src = "function f() {g()};function g(){i=0; while(i<10){i++}}";
4096 v8::Local<v8::Function> f = CompileFunction(&env, src, "f");
4122 "(function Foo() {"
5025 "function bar( new_value ) {\n"
5030 "function foo() {\n"
5090 /* In this test, the debugger evaluates a function with a breakpoint, after
5091 * hitting a breakpoint in another function. We do this with both values
5136 "function cat( new_value ) {\n"
5144 "function dog() {\n"
5174 "\"arguments\":{\"type\":\"function\",\"target\":\"cat\",\"line\":3}}";
5178 "\"arguments\":{\"type\":\"function\",\"target\":\"dog\",\"line\":3}}";
5341 // Source for a JavaScript function which returns the data parameter of a
5342 // function called in the context of the debugger. If no data parameter is
5345 "function debugger_call_with_data(exec_state, data) {"
5349 v8::Handle<v8::Function> debugger_call_with_data;
5352 // Source for a JavaScript function which returns the data parameter of a
5353 // function called in the context of the debugger. If no data parameter is
5357 "(function (exec_state) {"
5362 v8::Handle<v8::Function> debugger_call_with_closure;
5364 // Function to retrieve the number of JavaScript frames by calling a JavaScript
5374 // Function to retrieve the source line of the top JavaScript frame by calling a
5375 // JavaScript function in the debugger.
5384 // Function to test passing an additional parameter to a JavaScript function
5403 // Function to test using a JavaScript with closure in the debugger.
5428 // Compile a function for checking the number of JavaScript frames.
5430 frame_count = v8::Local<v8::Function>::Cast(
5433 // Compile a function for returning the source line for the top frame.
5435 frame_source_line = v8::Local<v8::Function>::Cast(
5438 // Compile a function returning the data parameter.
5440 debugger_call_with_data = v8::Local<v8::Function>::Cast(
5443 // Compile a function capturing closure.
5444 debugger_call_with_closure = v8::Local<v8::Function>::Cast(
5448 // Calling a function through the debugger returns 0 frames if there are
5454 v8::Script::Compile(v8::String::New("function f() {"
5460 v8::Script::Compile(v8::String::New("function f() {\n"
5466 // Test that a parameter can be passed to a function called in the debugger.
5469 // Test that a function with closure can be run in the debugger.
5477 v8::Script::Compile(v8::String::New("function f() {\n"
5513 v8::Local<v8::Function> foo =
5514 CompileFunction(&env, "function foo(){x=1}", "foo");
5515 v8::Local<v8::Function> bar =
5516 CompileFunction(&env, "function bar(){y=2}", "bar");
5544 v8::Local<v8::Function> foo(v8::Local<v8::Function>::Cast(
5690 "function cat( new_value ) {\n"
5722 "\"arguments\":{\"type\":\"function\",\"target\":\"cat\",\"line\":3}}";
6053 // Create functions for retrieving script name and data for the function on
6068 // Test function source.
6070 "function f() {\n"
6078 v8::Local<v8::Function> f;
6079 f = v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("f")));
6089 f = v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("f")));
6098 " toString: function() { return this.a + ' ' + this.b; }\n"
6105 f = v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("f")));
6116 f = v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("f")));
6174 // Simple test function which causes a break.
6175 const char* source = "function f() { debugger; }";
6177 // Enter and run function in the first context.
6182 v8::Local<v8::Function> f = CompileFunction(source, "f");
6187 // Enter and run function in the second context.
6192 v8::Local<v8::Function> f = CompileFunction(source, "f");
6231 const char* script = "function f() { debugger; g(); } function g() { }";
6233 v8::Local<v8::Function> f =
6234 v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("f")));
6235 v8::Local<v8::Function> g =
6236 v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("g")));
6249 // Debug event handler which gets the function on the top frame and schedules a
6260 // Get the name of the top frame function.
6262 // Get the name of the function.
6289 // Create a function for checking the function when hitting a break point.
6298 "function f(s) { return s.match(sourceLineBeginningSkip)[0].length; }";
6300 v8::Local<v8::Function> f = CompileFunction(script, "f");
6334 // Simple test function with eval that causes a break.
6335 function f() { eval('debugger;'); }";
6337 // Enter and run function in the context.
6342 v8::Local<v8::Function> f = CompileFunction(source, "f");
6570 const char* script = "function f() {};";
6578 v8::Local<v8::Function> f =
6579 v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("f")));
6609 const char* script = "function f() {throw new Error()};";
6616 v8::Local<v8::Function> f =
6617 v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("f")));
6634 const char* script = "function f() {};";
6707 // Create a function for testing stepping.
6708 const char* src = "function f() { eval('var x = 10;'); } ";
6709 v8::Local<v8::Function> f = CompileFunction(&env, src, "f");
6827 v8::Handle<v8::Function> run_test = v8::Handle<v8::Function>::Cast(
6830 "function runTest(mirror) {"
6840 // Test that the debug break flag works with function.apply.
6845 // Create a function for testing breaking in apply.
6846 v8::Local<v8::Function> foo = CompileFunction(
6848 "function baz(x) { }"
6849 "function bar(x) { baz(); }"
6850 "function foo(){ bar.apply(this, [1]); }",
6856 // Set the debug break flag before calling the code using function.apply.
6893 // Debug event listener that checks if the first argument of a function is
6904 v8::Handle<v8::Function> func(v8::Function::Cast(*CompileRun(
6905 "(function(exec_state) {\n"
6939 // Create a function that invokes debugger.
6940 v8::Local<v8::Function> foo = CompileFunction(
6942 "function bar(x) { debugger; }"
6943 "function foo(){ bar(obj); }",
6979 v8::Script::Compile(v8::String::New("(function(){debugger;})();"))->Run();
7014 v8::Script::Compile(v8::String::New("(function(x){return x;})(1);"))->Run();
7023 v8::Script::Compile(v8::String::New("(function(x){return x+1;})(1);"))->Run();
7031 v8::Script::Compile(v8::String::New("(function(x){return x+2;})(1);"))->Run();
7041 v8::Script::Compile(v8::String::New("(function(x){return x+3;})(1);"))->Run();
7061 // Get the name of the function.
7090 // Create a function for checking the function when hitting a break point.
7097 // debug break. When inside function bar it will deoptimize all functions.
7099 // time in function bar when using debug break and no break points will be at
7104 // Compile and run function bar which will optimize it for some flag settings.
7105 v8::Script::Compile(v8::String::New("function bar(){}; bar()"))->Run();
7126 // Get the name of the function in frame i.
7150 // Get the value of the first local variable. If the function
7190 v8::Handle<v8::Function> schedule_break =
7195 "function loop(count) {"
7226 "function f() {%s%s%s}",
7229 // Function with infinite loop.
7235 // Call function with infinite loop.
7252 // Create a function for getting the frame count when hitting the break.
7256 CompileRun("function g() { }");
7257 CompileRun("function h() { }");
7331 "function debug(b) { \n"
7334 "function f(b) { \n"
7337 "function g(b) { \n"