Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(368)

Unified Diff: Source/bindings/v8/DebuggerScript.js

Issue 13575004: Apply script preprocessor to Web page scripts only. (Closed) Base URL: https://chromium.googlesource.com/external/WebKit_trimmed.git@master
Patch Set: move clearScriptPreprocessor() to ScriptController::clearWindowShell Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/bindings/v8/DebuggerScript.js
diff --git a/Source/bindings/v8/DebuggerScript.js b/Source/bindings/v8/DebuggerScript.js
index 5760f7d5f51f5aac582890e9e02b2422aa8deacb..af28de4e611fcf0a39b889d30da9cbea6037e263 100644
--- a/Source/bindings/v8/DebuggerScript.js
+++ b/Source/bindings/v8/DebuggerScript.js
@@ -302,6 +302,49 @@ DebuggerScript.getBreakpointNumbers = function(eventData)
return numbers;
}
+// Matched enum in V8 objects.h
+DebuggerScript.ScriptCompilationType = {
+ Host: 0,
+ Eval: 1,
+ JSON: 2
+};
+
+DebuggerScript._getScriptCompilationTypeInfo = function(script)
+{
+ var result = "";
+ var fromScript = script.evalFromScript();
+ if (script.compilationType() == DebuggerScript.ScriptCompilationType.Eval && fromScript) {
+ result += 'eval from ';
+ if (fromScript.compilationType() == DebuggerScript.ScriptCompilationType.Eval) {
+ result += DebuggerScript._getScriptCompilationTypeInfo(fromScript);
+ } else {
+ var name = fromScript.name();
+ if (name) {
+ var location = script.evalFromLocation();
+ result += name + (location ? ':' + (location.line + 1) + ':' + (location.column + 1) : '');
+ } else {
+ result += '(unknown source)';
+ }
+ }
+ return result;
+ } else if (script.compilationType() == Debug.ScriptCompilationType.JSON) {
+ result += 'JSON ';
+ } else { // script.compilation == Debug.ScriptCompilationType.Host
+ result += '[unnamed] ';
+ }
+ return result || 'Failed to extract info';
+}
+
+DebuggerScript.getScriptCompilationTypeInfo = function(eventData)
+{
+ try {
+ var script = eventData.script();
+ return DebuggerScript._getScriptCompilationTypeInfo(script);
+ } catch (exc) {
+ return exc + '';
+ }
+}
+
DebuggerScript._frameMirrorToJSCallFrame = function(frameMirror, callerFrame)
{
// Get function name.

Powered by Google App Engine
This is Rietveld 408576698