OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2010-2011 Google Inc. All rights reserved. | 2 * Copyright (c) 2010-2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
659 | 659 |
660 v8::Handle<v8::String> source = v8String(m_isolate, expression); | 660 v8::Handle<v8::String> source = v8String(m_isolate, expression); |
661 v8::TryCatch tryCatch; | 661 v8::TryCatch tryCatch; |
662 v8::Local<v8::Script> script = V8ScriptRunner::compileScript(source, sourceU
RL, TextPosition(), 0, 0, m_isolate); | 662 v8::Local<v8::Script> script = V8ScriptRunner::compileScript(source, sourceU
RL, TextPosition(), 0, 0, m_isolate); |
663 if (tryCatch.HasCaught()) { | 663 if (tryCatch.HasCaught()) { |
664 v8::Local<v8::Message> message = tryCatch.Message(); | 664 v8::Local<v8::Message> message = tryCatch.Message(); |
665 if (!message.IsEmpty()) { | 665 if (!message.IsEmpty()) { |
666 *exceptionDetailsText = toCoreStringWithUndefinedOrNullCheck(message
->Get()); | 666 *exceptionDetailsText = toCoreStringWithUndefinedOrNullCheck(message
->Get()); |
667 *lineNumber = message->GetLineNumber(); | 667 *lineNumber = message->GetLineNumber(); |
668 *columnNumber = message->GetStartColumn(); | 668 *columnNumber = message->GetStartColumn(); |
669 *stackTrace = createScriptCallStack(message->GetStackTrace(), messag
e->GetStackTrace()->GetFrameCount(), m_isolate); | 669 *stackTrace = createScriptCallStack(m_isolate, message->GetStackTrac
e(), message->GetStackTrace()->GetFrameCount()); |
670 } | 670 } |
671 return; | 671 return; |
672 } | 672 } |
673 if (script.IsEmpty()) | 673 if (script.IsEmpty()) |
674 return; | 674 return; |
675 | 675 |
676 *scriptId = String::number(script->GetUnboundScript()->GetId()); | 676 *scriptId = String::number(script->GetUnboundScript()->GetId()); |
677 m_compiledScripts.set(*scriptId, adoptPtr(new ScopedPersistent<v8::Script>(m
_isolate, script))); | 677 m_compiledScripts.set(*scriptId, adoptPtr(new ScopedPersistent<v8::Script>(m
_isolate, script))); |
678 } | 678 } |
679 | 679 |
(...skipping 20 matching lines...) Expand all Loading... |
700 v8::Local<v8::Value> value = V8ScriptRunner::runCompiledScript(m_isolate, sc
ript, scriptState->executionContext()); | 700 v8::Local<v8::Value> value = V8ScriptRunner::runCompiledScript(m_isolate, sc
ript, scriptState->executionContext()); |
701 *wasThrown = false; | 701 *wasThrown = false; |
702 if (tryCatch.HasCaught()) { | 702 if (tryCatch.HasCaught()) { |
703 *wasThrown = true; | 703 *wasThrown = true; |
704 *result = ScriptValue(scriptState, tryCatch.Exception()); | 704 *result = ScriptValue(scriptState, tryCatch.Exception()); |
705 v8::Local<v8::Message> message = tryCatch.Message(); | 705 v8::Local<v8::Message> message = tryCatch.Message(); |
706 if (!message.IsEmpty()) { | 706 if (!message.IsEmpty()) { |
707 *exceptionDetailsText = toCoreStringWithUndefinedOrNullCheck(message
->Get()); | 707 *exceptionDetailsText = toCoreStringWithUndefinedOrNullCheck(message
->Get()); |
708 *lineNumber = message->GetLineNumber(); | 708 *lineNumber = message->GetLineNumber(); |
709 *columnNumber = message->GetStartColumn(); | 709 *columnNumber = message->GetStartColumn(); |
710 *stackTrace = createScriptCallStack(message->GetStackTrace(), messag
e->GetStackTrace()->GetFrameCount(), m_isolate); | 710 *stackTrace = createScriptCallStack(m_isolate, message->GetStackTrac
e(), message->GetStackTrace()->GetFrameCount()); |
711 } | 711 } |
712 } else { | 712 } else { |
713 *result = ScriptValue(scriptState, value); | 713 *result = ScriptValue(scriptState, value); |
714 } | 714 } |
715 } | 715 } |
716 | 716 |
717 PassOwnPtr<ScriptSourceCode> ScriptDebugServer::preprocess(LocalFrame*, const Sc
riptSourceCode&) | 717 PassOwnPtr<ScriptSourceCode> ScriptDebugServer::preprocess(LocalFrame*, const Sc
riptSourceCode&) |
718 { | 718 { |
719 return PassOwnPtr<ScriptSourceCode>(); | 719 return PassOwnPtr<ScriptSourceCode>(); |
720 } | 720 } |
721 | 721 |
722 String ScriptDebugServer::preprocessEventListener(LocalFrame*, const String& sou
rce, const String& url, const String& functionName) | 722 String ScriptDebugServer::preprocessEventListener(LocalFrame*, const String& sou
rce, const String& url, const String& functionName) |
723 { | 723 { |
724 return source; | 724 return source; |
725 } | 725 } |
726 | 726 |
727 } // namespace blink | 727 } // namespace blink |
OLD | NEW |