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
168 // Compile and run the supplied source and return the fequested function.
169 static v8::Local<v8::Function> CompileFunction(DebugLocalContext* env,
173 return v8::Local<v8::Function>::Cast(
178 // Compile and run the supplied source and return the requested function.
179 static v8::Local<v8::Function> CompileFunction(const char* source,
182 return v8::Local<v8::Function>::Cast(
187 // Is there any debug info for the function?
188 static bool HasDebugInfo(v8::Handle<v8::Function> fun) {
195 // Set a break point in a function and return the associated break point
209 // Set a break point in a function and return the associated break point
211 static int SetBreakPoint(v8::Handle<v8::Function> fun, int position) {
216 // Set a break point in a function using the Debug object and return the
377 // This function is in namespace v8::internal to be friend with class
486 // Compile a function, set a break point and check that the call at the break
487 // location in the code is the expected debug_break function.
494 // Create function and set the break point.
499 // Check that the debug break function is as expected.
512 // Clear the break point and check that the debug break function is no longer
532 // Source for the JavaScript function which picks out the function
535 "function frame_function_name(exec_state, frame_number) {"
538 v8::Local<v8::Function> frame_function_name;
541 // Source for the JavaScript function which pick out the name of the
544 "function frame_argument_name(exec_state, frame_number) {"
547 v8::Local<v8::Function> frame_argument_name;
550 // Source for the JavaScript function which pick out the value of the
553 "function frame_argument_value(exec_state, frame_number) {"
556 v8::Local<v8::Function> frame_argument_value;
559 // Source for the JavaScript function which pick out the name of the
562 "function frame_local_name(exec_state, frame_number) {"
565 v8::Local<v8::Function> frame_local_name;
568 // Source for the JavaScript function which pick out the value of the
571 "function frame_local_value(exec_state, frame_number) {"
574 v8::Local<v8::Function> frame_local_value;
577 // Source for the JavaScript function which picks out the source line for the
580 "function frame_source_line(exec_state) {"
583 v8::Local<v8::Function> frame_source_line;
586 // Source for the JavaScript function which picks out the source column for the
589 "function frame_source_column(exec_state) {"
592 v8::Local<v8::Function> frame_source_column;
595 // Source for the JavaScript function which picks out the script name for the
598 "function frame_script_name(exec_state) {"
601 v8::Local<v8::Function> frame_script_name;
604 // Source for the JavaScript function which picks out the script data for the
607 "function frame_script_data(exec_state) {"
610 v8::Local<v8::Function> frame_script_data;
613 // Source for the JavaScript function which picks out the script data from
616 "function compiled_script_data(event_data) {"
619 v8::Local<v8::Function> compiled_script_data;
622 // Source for the JavaScript function which returns the number of frames.
624 "function frame_count(exec_state) {"
627 v8::Handle<v8::Function> frame_count;
630 // Global variable to store the last function hit - used by some tests.
656 // Get the name of the function.
691 // Get the script name of the function script.
706 // Get the script data of the function script.
738 // height if there is a function compiled for that.
766 v8::Local<v8::Function> fun =
767 v8::Function::Cast(*event_data->Get(fun_name));
774 // Collect the JavsScript stack height if the function frame_count is
791 // evaluate_check_function: A JavaScript function (see below)
800 // Source for The JavaScript function which can do the evaluation when a break
803 "function evaluate_check(exec_state, expr, expected) {"
806 v8::Local<v8::Function> evaluate_check_function;
834 // This debug event listener removes a breakpoint in a function
846 v8::Handle<v8::Function> fun = v8::Handle<v8::Function>::Cast(data);
871 // afterwards. For each call the expected function is checked.
874 // expected_step_sequence: An array of the expected function call sequence.
875 // frame_function_name: A JavaScript function (see below).
877 // String containing the expected function call sequence. Note: this only works
891 // Check that the current function is the expected.
1007 // Test that the debug break function is the expected one for different kinds
1016 "function f1(){}", "f1",
1021 "function f2(){x=1;}", "f2",
1027 "function f3(){var a=x;}", "f3",
1040 "function f4(){var index='propertyName'; var a={}; a[index] = 'x';}",
1048 "function f5(){var index='propertyName'; var a={}; return a[index];}",
1063 "function f4_0(){x();}", "f4_0",
1069 "function f4_1(){x(1);}", "f4_1",
1075 "function f4_4(){x(1,2,3,4);}", "f4_4",
1088 v8::Local<v8::Function> foo =
1089 CompileFunction(&env, "function foo(){}", "foo");
1090 v8::Local<v8::Function> bar =
1091 CompileFunction(&env, "function bar(){}", "bar");
1096 // One function (foo) is debugged.
1106 // One function (bar) is debugged.
1127 v8::Script::Compile(v8::String::New("function foo(){bar=0;}"))->Run();
1128 v8::Local<v8::Function> foo =
1129 v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("foo")));
1160 v8::Script::Compile(v8::String::New("function foo(){var x=bar;}"))->Run();
1161 v8::Local<v8::Function> foo =
1162 v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("foo")));
1192 v8::Script::Compile(v8::String::New("function bar(){}"))->Run();
1193 v8::Script::Compile(v8::String::New("function foo(){bar();}"))->Run();
1194 v8::Local<v8::Function> foo =
1195 v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("foo")));
1225 v8::Script::Compile(v8::String::New("function bar(){return 1;}"))->Run();
1226 v8::Script::Compile(v8::String::New("function foo(){return bar();}"))->Run();
1227 v8::Local<v8::Function> foo =
1228 v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("foo")));
1258 v8::Script::Compile(v8::String::New("function bar(){ this.x = 1;}"))->Run();
1260 "function foo(){return new bar(1).x;}"))->Run();
1261 v8::Local<v8::Function> foo =
1262 v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("foo")));
1303 v8::Script::Compile(v8::String::New("function foo(){}"))->Run();
1304 v8::Local<v8::Function> foo =
1305 v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("foo")));
1333 v8::Local<v8::Function> f,
1351 v8::Local<v8::Function> foo;
1354 foo = CompileFunction(&env, "function
1359 foo = CompileFunction(&env, "bar=1;function foo(){var x=bar;}", "foo");
1364 foo = CompileFunction(&env, "function bar(){};function foo(){bar();}", "foo");
1369 foo = CompileFunction(&env, "function foo(){}", "foo");
1374 foo = CompileFunction(&env, "function foo(){var a;}", "foo");
1383 // Call the function three times with different garbage collections in between
1386 v8::Local<v8::Function> f,
1391 // Call function.
1395 // Scavenge and call function.
1400 // Mark sweep (and perhaps compact) and call function.
1415 v8::Local<v8::Function> foo;
1419 v8::Local<v8::Function> bar =
1420 CompileFunction(&env, "function foo(){}", "foo");
1421 foo = CompileFunction(&env, "function foo(){bar=0;}", "foo");
1428 v8::Local<v8::Function> bar =
1429 CompileFunction(&env, "function foo(){}", "foo");
1430 foo = CompileFunction(&env, "bar=1;function foo(){var x=bar;}", "foo");
1437 v8::Local<v8::Function> bar =
1438 CompileFunction(&env, "function foo(){}", "foo");
1440 "function bar(){};function foo(){bar();}",
1448 v8::Local<v8::Function> bar =
1449 CompileFunction(&env, "function foo(){}", "foo");
1450 foo = CompileFunction(&env, "function foo(){}", "foo");
1457 v8::Local<v8::Function> bar =
1458 CompileFunction(&env, "function foo(){}", "foo");
1459 foo = CompileFunction(&env, "function foo(){var bar=0;}", "foo");
1486 v8::Script::Compile(v8::String::New("function bar(){}"))->Run();
1487 v8::Script::Compile(v8::String::New("function foo(){bar();bar();}"))->Run();
1544 "function f() {\n"
1545 " function h() {\n"
1552 "function g() {\n"
1553 " function h() {\n"
1566 v8::Local<v8::Function> f =
1567 v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("f")));
1568 v8::Local<v8::Function> g =
1569 v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("g")));
1648 "function f() {\n"
1649 " function h() {\n"
1656 "function g() {\n"
1657 " function h() {\n"
1671 v8::Local<v8::Function> f =
1672 v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("f")));
1673 v8::Local<v8::Function> g =
1674 v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("g")));
1757 "function f() {\n"
1761 // Compile the script and get function f.
1765 v8::Local<v8::Function> f =
1766 v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("f")));
1768 // Set script break point on line 1 (in function f).
1790 f = v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("f")));
1815 "function f() {\n"
1818 "function g(x) {\n"
1822 // Compile the script and get function f.
1826 v8::Local<v8::Function> f =
1827 v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("f")));
1829 // Set script break point on line 5 (in function g).
1852 f = v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("f")));
1876 "function f() {\n"
1880 // Compile the script and get function f.
1884 v8::Local<v8::Function> f =
1885 v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("f")));
1887 // Set script break point on line 1 (in function f).
1907 f = v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("f")));
1930 v8::Local<v8::Function> f;
1932 "function f() {\n"
1933 " function h() {\n"
1946 // Compile the script and get the function.
1948 f = v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("f")));
1956 // function.
1958 f = v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("f")));
1965 // Compile the script again and get the function.
1967 f = v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("f")));
1989 v8::Local<v8::Function> f;
1991 "function f() {\n"
1995 v8::Local<v8::Function> g;
1997 "function g() {\n"
2009 f = v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("f")));
2011 g = v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("g")));
2055 v8::Local<v8::Function> f;
2057 "function f() {\n"
2070 // Compile the script and get the function.
2072 f = v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("f")));
2107 // Create a function for checking the function when hitting a break point.
2115 v8::Local<v8::Function> f;
2116 v8::Local<v8::Function> g;
2119 "function f() {\n"
2123 " /* xx */ function g() { // line 5\n"
2124 " function h() { // line 6\n"
2137 // Compile the script and get the function.
2141 f = v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("f")));
2142 g = v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("g")));
2184 // Set a break point in the code after the last function decleration.
2217 "function f() {\n"
2221 v8::Local<v8::Function> f;
2226 f = v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("f")));
2244 f = v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("f")));
2253 // function which has no references but has not been collected yet.
2263 "function f() {\n"
2285 // Test that it is possible to remove the last break point for a function
2291 v8::Local<v8::Function> foo =
2292 CompileFunction(&env, "function foo(){a=1;}", "foo");
2295 // Register the debug event listener pasing the function
2318 v8::Script::Compile(v8::String::New("function bar(){debugger}"))->Run();
2320 "function foo(){debugger;debugger;}"))->Run();
2321 v8::Local<v8::Function> foo =
2322 v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("foo")));
2323 v8::Local<v8::Function> bar =
2324 v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("bar")));
2326 // Run function with debugger statement
2330 // Run function with two debugger statement
2346 v8::Script::Compile(v8::String::New("function foo(){debugger;}"))->Run();
2347 v8::Local<v8::Function> foo =
2348 v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("foo")));
2373 // Create a function for checking the evaluation when hitting a break point.
2398 // Simple test function. The "y=0" is in the function foo to provide a break
2399 // location. For "y=0" the "y" is at position 15 in the barbar function
2402 v8::Local<v8::Function> foo = CompileFunction(&env,
2403 "function foo(x) {"
2431 // Test function with an inner function. The "y=0" is in function barbar
2433 // barbar function therefore setting breakpoint at position 8 will break at
2435 v8::Local<v8::Function> bar = CompileFunction(&env,
2438 "function bar(x, b) {"
2440 " function barbar() {"
2591 "var v1 = 'Pinguin';\n function getAnimal() { return 'Capy' + 'bara'; }";
2650 // Create a function for testing stepping.
2651 v8::Local<v8::Function> foo = CompileFunction(&env,
2652 "function foo(){a=1;b=1;c=1;}",
2696 // Create a function for testing stepping of keyed load. The statement 'y=1'
2698 v8::Local<v8::Function> foo = CompileFunction(
2700 "function foo(a) {\n"
2717 // Call function without any break points to ensure inlining is in place.
2722 // Setup break point and step through the function.
2744 // Create a function for testing stepping of keyed store. The statement 'y=1'
2746 v8::Local<v8::Function> foo = CompileFunction(
2748 "function foo(a) {\n"
2764 // Call function without any break points to ensure inlining is in place.
2769 // Setup break point and step through the function.
2791 // Create a function for testing stepping of named load.
2792 v8::Local<v8::Function> foo = CompileFunction(
2794 "function foo() {\n"
2804 "function V(x, y) {\n"
2810 // Call function without any break points to ensure inlining is in place.
2813 // Setup break point and step through the function.
2834 // Create a function for testing stepping of named store.
2835 v8::Local<v8::Function> foo = CompileFunction(
2837 "function foo() {\n"
2845 // Call function without any break points to ensure inlining is in place.
2848 // Setup break point and step through the function.
2876 // Create a function for testing stepping.
2877 v8::Local<v8::Function> foo = CompileFunction(&env,
2878 "function bar() {};"
2879 "function foo() {"
2922 // Create a function for testing stepping. Run it to allow it to get
2924 const char* src = "function foo() { "
2932 Function> foo = CompileFunction(&env, src, "foo");
2955 // Create a function for testing stepping. Run it to allow it to get
2957 const char* src = "function foo() { "
2965 v8::Local<v8::Function> foo = CompileFunction(&env, src, "foo");
2988 // Create a function for testing stepping. Run it to allow it to get
2991 const char* src = "function foo(x) { "
3001 v8::Local<v8::Function> foo = CompileFunction(&env, src, "foo");
3031 // Create a function for testing stepping. Run it to allow it to get
3034 const char* src = "function foo(x) { "
3050 v8::Local<v8::Function> foo = CompileFunction(&env, src, "foo");
3087 // Create a function for testing stepping. Run it to allow it to get
3090 const char* src = "function foo(x) { "
3097 v8::Local<v8::Function> foo = CompileFunction(&env, src, "foo");
3127 // Create a function for testing stepping. Run it to allow it to get
3130 const char* src = "function foo(x) { "
3137 v8::Local<v8::Function> foo = CompileFunction(&env, src, "foo");
3167 // Create a function for testing stepping. Run it to allow it to get
3170 const char* src = "function foo(x) { "
3177 v8::Local<v8::Function> foo = CompileFunction(&env, src, "foo");
3208 // Create a function for testing stepping. Run it to allow it to get
3211 const char* src = "function foo(x) { "
3224 v8::Local<v8::Function> foo = CompileFunction(&env, src, "foo");
3259 // Create a function for testing stepping. Run it to allow it to get
3262 const char* src = "function foo(x) { "
3275 v8::Local<v8::Function> foo = CompileFunction(&env, src, "foo");
3311 // Create a function for testing stepping. Run it to allow it to get
3313 v8::Local<v8::Function> foo;
3314 const char* src_1 = "function foo() { "
3329 // Create a function for testing stepping. Run it to allow it to get
3331 const char* src_2 = "function foo() { "
3359 // Create a function for testing stepping. Run it to allow it to get
3361 const char* src = "function foo(x) { "
3368 v8::Local<v8::Function> foo = CompileFunction(&env, src, "foo");
3390 // Create a function for testing stepping. Run it to allow it to get
3392 const char* src = "function foo(x) { "
3398 v8::Local<v8::Function> foo = CompileFunction(&env, src, "foo");
3423 // Create a function for checking the function when hitting a break point.
3431 // Create a function for testing stepping. Run it to allow it to get
3433 const char* src = "function a() {b();c();}; "
3434 "function b() {c();}; "
3435 "function c() {}; "
3437 v8::Local<v8::Function> a = CompileFunction(&env, src, "a");
3474 // Create a function for checking the function when hitting a break point.
3482 // Create a function for testing stepping. Run it to allow it to get
3484 const char* src = "function a() {b(c(d()),d());c(d());d()}; "
3485 "function b(x,y) {c();}; "
3486 "function c(x) {}; "
3487 "function d() {}; "
3489 v8::Local<v8::Function> a = CompileFunction(&env, src, "a");
3526 // Create a function for checking the function when hitting a break point.
3534 // Create a function for testing stepping. Run it to allow it to get
3536 const char* src = "function a() {b(false);c();}; "
3537 "function b(x) {if(x){c();};}; "
3538 "function c() {}; "
3540 v8::Local<v8::Function> a = CompileFunction(&env, src, "a");
3562 // Create a function for testing stepping.
3563 v8::Local<v8::Function> foo = CompileFunction(
3565 "function foo(){debugger;Math.sin(1);}",
3595 // Test that step in works with function.apply.
3600 // Create a function for testing stepping.
3601 v8::Local<v8::Function> foo = CompileFunction(
3603 "function bar(x, y, z) { if (x == 1) { a = y; b = z; } }"
3604 "function foo(){ debugger; bar.apply(this, [1,2,3]); }",
3634 // Test that step in works with function.call.
3639 // Create a function for testing stepping.
3640 v8::Local<v8::Function> foo = CompileFunction(
3642 "function bar(x, y, z) { if (x == 1) { a = y; b = z; } }"
3643 "function foo(a){ debugger;"
3694 // Create a script that returns a function.
3695 const char* src = "(function (evt) {})";
3730 v8::Local<v8::Function> throws =
3731 CompileFunction(&env, "function throws(){throw 1;}", "throws");
3732 v8::Local<v8::Function> caught =
3734 "function caught(){try {throws();} catch(e) {};}",
3736 v8::Local<v8::Function> notCaught =
3737 CompileFunction(&env, "function notCaught(){throws();}", "notCaught");
3876 // Create a function for checking the function when hitting a break point.
3928 // Create a function for checking the function when hitting a break point.
3937 const char* src = "function a() { n(); }; "
3938 "function b() { c(); }; "
3939 "function c() { n(); }; "
3940 "function d() { x = 1; try { e(); } catch(x) { x = 2; } }; "
3941 "function e() { n(); }; "
3942 "function f() { x = 1; try { g(); } catch(x) { x = 2; } }; "
3943 "function g() { h(); }; "
3944 "function h() { x = 1; throw 1; }; ";
3947 v8::Local<v8::Function> a = CompileFunction(&env, src, "a");
3957 v8::Local<v8::Function
3966 v8::Local<v8::Function> d = CompileFunction(&env, src, "d");
3986 v8::Local<v8::Function> f = CompileFunction(&env, src, "f");
4024 // Create a function for testing stepping.
4025 const char* src = "function f0() {}"
4026 "function f1(x1) {}"
4027 "function f2(x1,x2) {}"
4028 "function f3(x1,x2,x3) {}";
4029 v8::Local<v8::Function> f0 = CompileFunction(&env, src, "f0");
4030 v8::Local<v8::Function> f1 = CompileFunction(&env, src, "f1");
4031 v8::Local<v8::Function> f2 = CompileFunction(&env, src, "f2");
4032 v8::Local<v8::Function> f3 = CompileFunction(&env, src, "f3");
4034 // Call the function to make sure it is compiled.
4058 // One break for each function called.
4076 // Create a function for testing stepping.
4077 const char* src = "function f() {g()};function g(){i=0; while(i<10){i++}}";
4078 v8::Local<v8::Function> f = CompileFunction(&env, src, "f");
4104 "(function Foo() {"
5010 "function bar( new_value ) {\n"
5015 "function foo() {\n"
5074 /* In this test, the debugger evaluates a function with a breakpoint, after
5075 * hitting a breakpoint in another function. We do this with both values
5122 "function cat( new_value ) {\n"
5130 "function dog() {\n"
5159 "\"arguments\":{\"type\":\"function\",\"target\":\"cat\",\"line\":3}}";
5163 "\"arguments\":{\"type\":\"function\",\"target\":\"dog\",\"line\":3}}";
5327 // Source for a JavaScript function which returns the data parameter of a
5328 // function called in the context of the debugger. If no data parameter is
5331 "function debugger_call_with_data(exec_state, data) {"
5335 v8::Handle<v8::Function> debugger_call_with_data;
5338 // Source for a JavaScript function which returns the data parameter of a
5339 // function called in the context of the debugger. If no data parameter is
5343 "(function (exec_state) {"
5348 v8::Handle<v8::Function> debugger_call_with_closure;
5350 // Function to retrieve the number of JavaScript frames by calling a JavaScript
5360 // Function to retrieve the source line of the top JavaScript frame by calling a
5361 // JavaScript function in the debugger.
5370 // Function to test passing an additional parameter to a JavaScript function
5389 // Function to test using a JavaScript with closure in the debugger.
5414 // Compile a function for checking the number of JavaScript frames.
5416 frame_count = v8::Local<v8::Function>::Cast(
5419 // Compile a function for returning the source line for the top frame.
5421 frame_source_line = v8::Local<v8::Function>::Cast(
5424 // Compile a function returning the data parameter.
5426 debugger_call_with_data = v8::Local<v8::Function>::Cast(
5429 // Compile a function capturing closure.
5430 debugger_call_with_closure = v8::Local<v8::Function>::Cast(
5434 // Calling a function through the debugger returns 0 frames if there are
5440 v8::Script::Compile(v8::String::New("function f() {"
5446 v8::Script::Compile(v8::String::New("function f() {\n"
5452 // Test that a parameter can be passed to a function called in the debugger.
5455 // Test that a function with closure can be run in the debugger.
5463 v8::Script::Compile(v8::String::New("function f() {\n"
5499 v8::Local<v8::Function> foo =
5500 CompileFunction(&env, "function foo(){x=1}", "foo");
5501 v8::Local<v8::Function> bar =
5502 CompileFunction(&env, "function bar(){y=2}", "bar");
5530 v8::Local<v8::Function> foo =
5531 v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("foo")));
5532 v8::Local<v8::Function> bar =
5533 v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("foo")));
5680 "function cat( new_value ) {\n"
5711 "\"arguments\":{\"type\":\"function\",\"target\":\"cat\",\"line\":3}}";
6038 // Create functions for retrieving script name and data for the function on
6053 // Test function source.
6055 "function f() {\n"
6063 v8::Local<v8::Function> f;
6064 f = v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("f")));
6074 f = v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("f")));
6083 " toString: function() { return this.a + ' ' + this.b; }\n"
6090 f = v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("f")));
6101 f = v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("f")));
6159 // Simple test function which causes a break.
6160 const char* source = "function f() { debugger; }";
6162 // Enter and run function in the first context.
6167 v8::Local<v8::Function> f = CompileFunction(source, "f");
6172 // Enter and run function in the second context.
6177 v8::Local<v8::Function> f = CompileFunction(source, "f");
6216 const char* script = "function f() { debugger; g(); } function g() { }";
6218 v8::Local<v8::Function> f =
6219 v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("f")));
6220 v8::Local<v8::Function> g =
6221 v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("g")));
6234 // Debug event handler which gets the function on the top frame and schedules a
6245 // Get the name of the top frame function.
6247 // Get the name of the function.
6274 // Create a function for checking the function when hitting a break point.
6283 "function f(s) { return s.match(sourceLineBeginningSkip)[0].length; }";
6285 v8::Local<v8::Function> f = CompileFunction(script, "f");
6320 // Simple test function with eval that causes a break.
6321 const char* source = "function f() { eval('debugger;'); }";
6323 // Enter and run function in the context.
6328 v8::Local<v8::Function
6556 const char* script = "function f() {};";
6564 v8::Local<v8::Function> f =
6565 v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("f")));
6595 const char* script = "function f() {throw new Error()};";
6602 v8::Local<v8::Function> f =
6603 v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("f")));
6620 const char* script = "function f() {};";
6693 // Create a function for testing stepping.
6694 const char* src = "function f() { eval('var x = 10;'); } ";
6695 v8::Local<v8::Function> f = CompileFunction(&env, src, "f");
6813 v8::Handle<v8::Function> run_test = v8::Handle<v8::Function>::Cast(
6816 "function runTest(mirror) {"
6826 // Test that the debug break flag works with function.apply.
6831 // Create a function for testing breaking in apply.
6832 v8::Local<v8::Function> foo = CompileFunction(
6834 "function baz(x) { }"
6835 "function bar(x) { baz(); }"
6836 "function foo(){ bar.apply(this, [1]); }",
6842 // Set the debug break flag before calling the code using function.apply.
6879 // Debug event listener that checks if the first argument of a function is
6890 v8::Handle<v8::Function> func(v8::Function::Cast(*CompileRun(
6891 "(function(exec_state) {\n"
6925 // Create a function that invokes debugger.
6926 v8::Local<v8::Function> foo = CompileFunction(
6928 "function bar(x) { debugger; }"
6929 "function foo(){ bar(obj); }",
6965 v8::Script::Compile(v8::String::New("(function(){debugger;})();"))->Run();
7000 v8::Script::Compile(v8::String::New("(function(x){return x;})(1);"))->Run();
7009 v8::Script::Compile(v8::String::New("(function(x){return x+1;})(1);"))->Run();
7017 v8::Script::Compile(v8::String::New("(function(x){return x+2;})(1);"))->Run();
7027 v8::Script::Compile(v8::String::New("(function(x){return x+3;})(1);"))->Run();
7047 // Get the name of the function.
7076 // Create a function for checking the function when hitting a break point.
7083 // debug break. When inside function bar it will deoptimize all functions.
7085 // time in function bar when using debug break and no break points will be at
7090 // Compile and run function bar which will optimize it for some flag settings.
7091 v8::Script::Compile(v8::String::New("function bar(){}; bar()"))->Run();
7112 // Get the name of the function in frame i.
7136 // Get the value of the first local variable. If the function
7176 v8::Handle<v8::Function> schedule_break =
7181 "function loop(count) {"
7204 "function f() {%s%s%s}",
7207 // Function with infinite loop.
7213 // Call function with infinite loop.
7230 CompileRun("function g() { }");
7231 CompileRun("function h() { }");