OLD | NEW |
1 // Copyright 2006-2012 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 (function(global, utils) { | 5 (function(global, utils) { |
6 "use strict"; | 6 "use strict"; |
7 | 7 |
8 // ---------------------------------------------------------------------------- | 8 // ---------------------------------------------------------------------------- |
9 // Imports | 9 // Imports |
10 | 10 |
(...skipping 1019 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1030 return new ScopeMirror(UNDEFINED, this, index); | 1030 return new ScopeMirror(UNDEFINED, this, index); |
1031 } | 1031 } |
1032 }; | 1032 }; |
1033 | 1033 |
1034 | 1034 |
1035 FunctionMirror.prototype.toText = function() { | 1035 FunctionMirror.prototype.toText = function() { |
1036 return this.source(); | 1036 return this.source(); |
1037 }; | 1037 }; |
1038 | 1038 |
1039 | 1039 |
| 1040 FunctionMirror.prototype.context = function() { |
| 1041 if (this.resolved()) { |
| 1042 if (!this._context) |
| 1043 this._context = new ContextMirror(%FunctionGetContextData(this.value_)); |
| 1044 return this._context; |
| 1045 } |
| 1046 }; |
| 1047 |
| 1048 |
1040 /** | 1049 /** |
1041 * Mirror object for unresolved functions. | 1050 * Mirror object for unresolved functions. |
1042 * @param {string} value The name for the unresolved function reflected by this | 1051 * @param {string} value The name for the unresolved function reflected by this |
1043 * mirror. | 1052 * mirror. |
1044 * @constructor | 1053 * @constructor |
1045 * @extends ObjectMirror | 1054 * @extends ObjectMirror |
1046 */ | 1055 */ |
1047 function UnresolvedFunctionMirror(value) { | 1056 function UnresolvedFunctionMirror(value) { |
1048 // Construct this using the ValueMirror as an unresolved function is not a | 1057 // Construct this using the ValueMirror as an unresolved function is not a |
1049 // real object but just a string. | 1058 // real object but just a string. |
(...skipping 1984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3034 // Functions needed by the debugger runtime. | 3043 // Functions needed by the debugger runtime. |
3035 utils.InstallFunctions(utils, DONT_ENUM, [ | 3044 utils.InstallFunctions(utils, DONT_ENUM, [ |
3036 "ClearMirrorCache", ClearMirrorCache | 3045 "ClearMirrorCache", ClearMirrorCache |
3037 ]); | 3046 ]); |
3038 | 3047 |
3039 // Export to debug.js | 3048 // Export to debug.js |
3040 utils.Export(function(to) { | 3049 utils.Export(function(to) { |
3041 to.MirrorType = MirrorType; | 3050 to.MirrorType = MirrorType; |
3042 }); | 3051 }); |
3043 }) | 3052 }) |
OLD | NEW |