Chromium Code Reviews| Index: Source/bindings/v8/DebuggerScript.js |
| diff --git a/Source/bindings/v8/DebuggerScript.js b/Source/bindings/v8/DebuggerScript.js |
| index f1d5840ade23a71a037d589c5980c369fc008943..cbc51b13c38e17dd0a67d94f69cf37b6af77b478 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) |
|
pfeldman
2013/07/22 18:33:05
no _get prefixes in Blink
|
| +{ |
| + var result = ""; |
| + var fromScript = script.evalFromScript(); |
| + if (script.compilationType() == DebuggerScript.ScriptCompilationType.Eval && fromScript) { |
| + result += 'eval from '; |
|
pfeldman
2013/07/22 18:33:05
Use double quotes
|
| + 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 + ''; |
|
pfeldman
2013/07/22 18:33:05
No abbreviations in Blink
|
| + } |
| +} |
| + |
| DebuggerScript._frameMirrorToJSCallFrame = function(frameMirror, callerFrame) |
| { |
| // Get function name. |