summaryrefslogtreecommitdiffstats
path: root/WebCore/bindings/v8/ScriptCallStack.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/bindings/v8/ScriptCallStack.cpp')
-rw-r--r--WebCore/bindings/v8/ScriptCallStack.cpp26
1 files changed, 15 insertions, 11 deletions
diff --git a/WebCore/bindings/v8/ScriptCallStack.cpp b/WebCore/bindings/v8/ScriptCallStack.cpp
index 21063ed..45e7205 100644
--- a/WebCore/bindings/v8/ScriptCallStack.cpp
+++ b/WebCore/bindings/v8/ScriptCallStack.cpp
@@ -32,29 +32,33 @@
#include "ScriptCallStack.h"
#include "ScriptController.h"
+#include "ScriptDebugServer.h"
#include <v8.h>
#include "V8Binding.h"
-#include "V8Proxy.h"
namespace WebCore {
ScriptCallStack* ScriptCallStack::create(const v8::Arguments& arguments, unsigned skipArgumentCount) {
String sourceName;
int sourceLineNumber;
- if (!V8Proxy::sourceName(sourceName)) {
- return 0;
- }
- if (!V8Proxy::sourceLineNumber(sourceLineNumber)) {
- return 0;
- }
- sourceLineNumber += 1;
- return new ScriptCallStack(arguments, skipArgumentCount, sourceName, sourceLineNumber);
+ String funcName;
+ if (!callLocation(&sourceName, &sourceLineNumber, &funcName))
+ return 0;
+ return new ScriptCallStack(arguments, skipArgumentCount, sourceName, sourceLineNumber, funcName);
}
-ScriptCallStack::ScriptCallStack(const v8::Arguments& arguments, unsigned skipArgumentCount, String sourceName, int sourceLineNumber)
- : m_lastCaller(String(), sourceName, sourceLineNumber, arguments, skipArgumentCount)
+bool ScriptCallStack::callLocation(String* sourceName, int* sourceLineNumber, String* functionName)
+{
+ if (!ScriptDebugServer::topStackFrame(*sourceName, *sourceLineNumber, *functionName))
+ return false;
+ *sourceLineNumber += 1;
+ return true;
+}
+
+ScriptCallStack::ScriptCallStack(const v8::Arguments& arguments, unsigned skipArgumentCount, String sourceName, int sourceLineNumber, String functionName)
+ : m_lastCaller(functionName, sourceName, sourceLineNumber, arguments, skipArgumentCount)
, m_scriptState(ScriptState::current())
{
}