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 5339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5350 // Set the debug break flag again. | 5350 // Set the debug break flag again. |
5351 v8::Debug::DebugBreak(); | 5351 v8::Debug::DebugBreak(); |
5352 f->Call(env->Global(), 0, NULL); | 5352 f->Call(env->Global(), 0, NULL); |
5353 // There should be one more break event when the script is evaluated in 'f'. | 5353 // There should be one more break event when the script is evaluated in 'f'. |
5354 CHECK_EQ(2, break_point_hit_count); | 5354 CHECK_EQ(2, break_point_hit_count); |
5355 | 5355 |
5356 // Get rid of the debug message handler. | 5356 // Get rid of the debug message handler. |
5357 v8::Debug::SetMessageHandler2(NULL); | 5357 v8::Debug::SetMessageHandler2(NULL); |
5358 CheckDebuggerUnloaded(); | 5358 CheckDebuggerUnloaded(); |
5359 } | 5359 } |
| 5360 |
| 5361 |
| 5362 TEST(GetMirror) { |
| 5363 v8::HandleScope scope; |
| 5364 DebugLocalContext env; |
| 5365 v8::Handle<v8::Value> obj = v8::Debug::GetMirror(v8::String::New("hodja")); |
| 5366 v8::Handle<v8::Function> run_test = v8::Handle<v8::Function>::Cast( |
| 5367 v8::Script::New( |
| 5368 v8::String::New( |
| 5369 "function runTest(mirror) {" |
| 5370 " return mirror.isString() && (mirror.length() == 5);" |
| 5371 "}" |
| 5372 "" |
| 5373 "runTest;"))->Run()); |
| 5374 v8::Handle<v8::Value> result = run_test->Call(env->Global(), 1, &obj); |
| 5375 CHECK(result->IsTrue()); |
| 5376 } |
OLD | NEW |