OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 6989 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7000 CheckDebuggerUnloaded(); | 7000 CheckDebuggerUnloaded(); |
7001 } | 7001 } |
7002 | 7002 |
7003 | 7003 |
7004 TEST(GetMirror) { | 7004 TEST(GetMirror) { |
7005 DebugLocalContext env; | 7005 DebugLocalContext env; |
7006 v8::Isolate* isolate = env->GetIsolate(); | 7006 v8::Isolate* isolate = env->GetIsolate(); |
7007 v8::HandleScope scope(isolate); | 7007 v8::HandleScope scope(isolate); |
7008 v8::Handle<v8::Value> obj = | 7008 v8::Handle<v8::Value> obj = |
7009 v8::Debug::GetMirror(v8::String::NewFromUtf8(isolate, "hodja")); | 7009 v8::Debug::GetMirror(v8::String::NewFromUtf8(isolate, "hodja")); |
7010 v8::Handle<v8::Function> run_test = | 7010 v8::ScriptCompiler::Source source(v8_str( |
7011 v8::Handle<v8::Function>::Cast( | 7011 "function runTest(mirror) {" |
7012 v8::ScriptCompiler::CompileUnbound( | 7012 " return mirror.isString() && (mirror.length() == 5);" |
7013 isolate, | 7013 "}" |
7014 v8::ScriptCompiler::Source(v8_str( | 7014 "" |
7015 "function runTest(mirror) {" | 7015 "runTest;")); |
7016 " return mirror.isString() && (mirror.length() == 5);" | 7016 v8::Handle<v8::Function> run_test = v8::Handle<v8::Function>::Cast( |
7017 "}" | 7017 v8::ScriptCompiler::CompileUnbound(isolate, &source) |
7018 "" | 7018 ->BindToCurrentContext() |
7019 "runTest;")))->BindToCurrentContext()->Run()); | 7019 ->Run()); |
7020 v8::Handle<v8::Value> result = run_test->Call(env->Global(), 1, &obj); | 7020 v8::Handle<v8::Value> result = run_test->Call(env->Global(), 1, &obj); |
7021 CHECK(result->IsTrue()); | 7021 CHECK(result->IsTrue()); |
7022 } | 7022 } |
7023 | 7023 |
7024 | 7024 |
7025 // Test that the debug break flag works with function.apply. | 7025 // Test that the debug break flag works with function.apply. |
7026 TEST(DebugBreakFunctionApply) { | 7026 TEST(DebugBreakFunctionApply) { |
7027 DebugLocalContext env; | 7027 DebugLocalContext env; |
7028 v8::HandleScope scope(env->GetIsolate()); | 7028 v8::HandleScope scope(env->GetIsolate()); |
7029 | 7029 |
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7662 CHECK(result->IsString()); | 7662 CHECK(result->IsString()); |
7663 v8::String::Utf8Value utf8(result); | 7663 v8::String::Utf8Value utf8(result); |
7664 CHECK_EQ("bar", *utf8); | 7664 CHECK_EQ("bar", *utf8); |
7665 | 7665 |
7666 v8::Debug::SetDebugEventListener2(NULL); | 7666 v8::Debug::SetDebugEventListener2(NULL); |
7667 CheckDebuggerUnloaded(); | 7667 CheckDebuggerUnloaded(); |
7668 } | 7668 } |
7669 | 7669 |
7670 | 7670 |
7671 #endif // ENABLE_DEBUGGER_SUPPORT | 7671 #endif // ENABLE_DEBUGGER_SUPPORT |
OLD | NEW |