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

Side by Side Diff: Source/bindings/dart/DartDebugHooks.js

Issue 23710032: Switch the DevTools to support a true Dart REPL (Closed) Base URL: svn://svn.chromium.org/multivm/trunk/webkit
Patch Set: Created 7 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 }, 98 },
99 99
100 nameOrSourceURL: function() 100 nameOrSourceURL: function()
101 { 101 {
102 return this.url; 102 return this.url;
103 } 103 }
104 }; 104 };
105 105
106 DartDebug.FrameMirror = function(callFrame) 106 DartDebug.FrameMirror = function(callFrame)
107 { 107 {
108 this._callFrame = callFrame;
108 this._functionName = callFrame.functionName; 109 this._functionName = callFrame.functionName;
109 this._scriptId = DartDebug.scriptURLToScriptId[callFrame.scriptURL]; 110 this._scriptId = DartDebug.scriptURLToScriptId[callFrame.scriptURL];
110 this._lineNumber = callFrame.lineNumber; 111 this._lineNumber = callFrame.lineNumber;
111 this._localScope = new DartDebug.ScopeMirror(callFrame.localScopeProxy, Scop eType.Local); 112 this._localScope = new DartDebug.ScopeMirror(callFrame.localScopeProxy, Scop eType.Local);
112 this._globalScope = new DartDebug.ScopeMirror(callFrame.libraryProxy, ScopeT ype.Global); 113 this._globalScope = new DartDebug.ScopeMirror(callFrame.libraryProxy, ScopeT ype.Global);
113 114
114 this._scopes = [this._localScope, this._globalScope]; 115 this._scopes = [this._localScope, this._globalScope];
115 }; 116 };
116 117
117 DartDebug.FrameMirror.prototype = { 118 DartDebug.FrameMirror.prototype = {
(...skipping 30 matching lines...) Expand all
148 149
149 // FIXME: dartbug.com/10434 find a less fragile way to determine whether 150 // FIXME: dartbug.com/10434 find a less fragile way to determine whether
150 // we need to strip off console API support added by InjectedScript. 151 // we need to strip off console API support added by InjectedScript.
151 var CONSOLE_API_SUPPORT_HEADER = 152 var CONSOLE_API_SUPPORT_HEADER =
152 'with ((this && this.console && this.console._commandLineAPI) || {}) {\n'; 153 'with ((this && this.console && this.console._commandLineAPI) || {}) {\n';
153 if (expression.indexOf(CONSOLE_API_SUPPORT_HEADER) == 0) { 154 if (expression.indexOf(CONSOLE_API_SUPPORT_HEADER) == 0) {
154 expression = expression.substr(expression.indexOf('\n') + 1); 155 expression = expression.substr(expression.indexOf('\n') + 1);
155 expression = expression.substr(0, expression.lastIndexOf('\n')); 156 expression = expression.substr(0, expression.lastIndexOf('\n'));
156 } 157 }
157 158
158 var result = DartDebug.nativeCallbacks.evaluateInScope(expression, this. _localScope.receiver(), 159 var result = DartDebug.nativeCallbacks.invocationTrampoline(
159 this._globalScope._object, this._localScope._object); 160 DartDebug.nativeCallbacks.evaluateInScope,
161 [expression, this._localScope.receiver(), this._callFrame.functionPr oxy, this._callFrame.localVariables]);
160 return { value: function() { return result; } }; 162 return { value: function() { return result; } };
161 }, 163 },
162 164
163 get details_() 165 get details_()
164 { 166 {
165 var receiver = this._localScope.receiver(); 167 var receiver = this._localScope.receiver();
166 return { receiver: function() { return receiver; } }; 168 return { receiver: function() { return receiver; } };
167 } 169 }
168 }; 170 };
169 171
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 399
398 Debug.clearBreakOnUncaughtException = function() 400 Debug.clearBreakOnUncaughtException = function()
399 { 401 {
400 originals.clearBreakOnUncaughtException.apply(Debug); 402 originals.clearBreakOnUncaughtException.apply(Debug);
401 DartDebug.updateExceptionPauseInfo(); 403 DartDebug.updateExceptionPauseInfo();
402 } 404 }
403 405
404 return DartDebug; 406 return DartDebug;
405 407
406 })() 408 })()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698