OLD | NEW |
1 // Copyright 2007-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2007-2008 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 4078 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4089 " throw 'No data!'" | 4089 " throw 'No data!'" |
4090 "}"; | 4090 "}"; |
4091 v8::Handle<v8::Function> debugger_call_with_data; | 4091 v8::Handle<v8::Function> debugger_call_with_data; |
4092 | 4092 |
4093 | 4093 |
4094 // Source for a JavaScript function which returns the data parameter of a | 4094 // Source for a JavaScript function which returns the data parameter of a |
4095 // function called in the context of the debugger. If no data parameter is | 4095 // function called in the context of the debugger. If no data parameter is |
4096 // passed it throws an exception. | 4096 // passed it throws an exception. |
4097 static const char* debugger_call_with_closure_source = | 4097 static const char* debugger_call_with_closure_source = |
4098 "var x = 3;" | 4098 "var x = 3;" |
4099 "function (exec_state) {" | 4099 "(function (exec_state) {" |
4100 " if (exec_state.y) return x - 1;" | 4100 " if (exec_state.y) return x - 1;" |
4101 " exec_state.y = x;" | 4101 " exec_state.y = x;" |
4102 " return exec_state.y" | 4102 " return exec_state.y" |
4103 "}"; | 4103 "})"; |
4104 v8::Handle<v8::Function> debugger_call_with_closure; | 4104 v8::Handle<v8::Function> debugger_call_with_closure; |
4105 | 4105 |
4106 // Function to retrieve the number of JavaScript frames by calling a JavaScript | 4106 // Function to retrieve the number of JavaScript frames by calling a JavaScript |
4107 // in the debugger. | 4107 // in the debugger. |
4108 static v8::Handle<v8::Value> CheckFrameCount(const v8::Arguments& args) { | 4108 static v8::Handle<v8::Value> CheckFrameCount(const v8::Arguments& args) { |
4109 CHECK(v8::Debug::Call(frame_count)->IsNumber()); | 4109 CHECK(v8::Debug::Call(frame_count)->IsNumber()); |
4110 CHECK_EQ(args[0]->Int32Value(), | 4110 CHECK_EQ(args[0]->Int32Value(), |
4111 v8::Debug::Call(frame_count)->Int32Value()); | 4111 v8::Debug::Call(frame_count)->Int32Value()); |
4112 return v8::Undefined(); | 4112 return v8::Undefined(); |
4113 } | 4113 } |
(...skipping 1247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5361 v8::Script::New( | 5361 v8::Script::New( |
5362 v8::String::New( | 5362 v8::String::New( |
5363 "function runTest(mirror) {" | 5363 "function runTest(mirror) {" |
5364 " return mirror.isString() && (mirror.length() == 5);" | 5364 " return mirror.isString() && (mirror.length() == 5);" |
5365 "}" | 5365 "}" |
5366 "" | 5366 "" |
5367 "runTest;"))->Run()); | 5367 "runTest;"))->Run()); |
5368 v8::Handle<v8::Value> result = run_test->Call(env->Global(), 1, &obj); | 5368 v8::Handle<v8::Value> result = run_test->Call(env->Global(), 1, &obj); |
5369 CHECK(result->IsTrue()); | 5369 CHECK(result->IsTrue()); |
5370 } | 5370 } |
OLD | NEW |