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 1481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1492 PropertyMirror.prototype.canDelete = function() { | 1492 PropertyMirror.prototype.canDelete = function() { |
1493 return (this.attributes() & PropertyAttribute.DontDelete) == 0; | 1493 return (this.attributes() & PropertyAttribute.DontDelete) == 0; |
1494 }; | 1494 }; |
1495 | 1495 |
1496 | 1496 |
1497 PropertyMirror.prototype.name = function() { | 1497 PropertyMirror.prototype.name = function() { |
1498 return this.name_; | 1498 return this.name_; |
1499 }; | 1499 }; |
1500 | 1500 |
1501 | 1501 |
| 1502 PropertyMirror.prototype.toText = function() { |
| 1503 if (IS_SYMBOL(this.name_)) return %Call(SymbolToString, this.name_); |
| 1504 return this.name_; |
| 1505 }; |
| 1506 |
| 1507 |
1502 PropertyMirror.prototype.isIndexed = function() { | 1508 PropertyMirror.prototype.isIndexed = function() { |
1503 for (var i = 0; i < this.name_.length; i++) { | 1509 for (var i = 0; i < this.name_.length; i++) { |
1504 if (this.name_[i] < '0' || '9' < this.name_[i]) { | 1510 if (this.name_[i] < '0' || '9' < this.name_[i]) { |
1505 return false; | 1511 return false; |
1506 } | 1512 } |
1507 } | 1513 } |
1508 return true; | 1514 return true; |
1509 }; | 1515 }; |
1510 | 1516 |
1511 | 1517 |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2027 property = r.lookupProperty(func); | 2033 property = r.lookupProperty(func); |
2028 } | 2034 } |
2029 } | 2035 } |
2030 if (!property.isUndefined()) { | 2036 if (!property.isUndefined()) { |
2031 // The function invoked was found on the receiver. Use the property name | 2037 // The function invoked was found on the receiver. Use the property name |
2032 // for the backtrace. | 2038 // for the backtrace. |
2033 if (!property.isIndexed()) { | 2039 if (!property.isIndexed()) { |
2034 if (display_receiver) { | 2040 if (display_receiver) { |
2035 result += '.'; | 2041 result += '.'; |
2036 } | 2042 } |
2037 result += property.name(); | 2043 result += property.toText(); |
2038 } else { | 2044 } else { |
2039 result += '['; | 2045 result += '['; |
2040 result += property.name(); | 2046 result += property.toText(); |
2041 result += ']'; | 2047 result += ']'; |
2042 } | 2048 } |
2043 // Also known as - if the name in the function doesn't match the name | 2049 // Also known as - if the name in the function doesn't match the name |
2044 // under which it was looked up. | 2050 // under which it was looked up. |
2045 if (func.name() && func.name() != property.name()) { | 2051 if (func.name() && func.name() != property.name()) { |
2046 result += '(aka ' + func.name() + ')'; | 2052 result += '(aka ' + func.name() + ')'; |
2047 } | 2053 } |
2048 } else { | 2054 } else { |
2049 // The function invoked was not found on the receiver. Use the function | 2055 // The function invoked was not found on the receiver. Use the function |
2050 // name if available for the backtrace. | 2056 // name if available for the backtrace. |
(...skipping 994 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3045 // Functions needed by the debugger runtime. | 3051 // Functions needed by the debugger runtime. |
3046 utils.InstallFunctions(utils, DONT_ENUM, [ | 3052 utils.InstallFunctions(utils, DONT_ENUM, [ |
3047 "ClearMirrorCache", ClearMirrorCache | 3053 "ClearMirrorCache", ClearMirrorCache |
3048 ]); | 3054 ]); |
3049 | 3055 |
3050 // Export to debug.js | 3056 // Export to debug.js |
3051 utils.Export(function(to) { | 3057 utils.Export(function(to) { |
3052 to.MirrorType = MirrorType; | 3058 to.MirrorType = MirrorType; |
3053 }); | 3059 }); |
3054 }) | 3060 }) |
OLD | NEW |