OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
683 } | 683 } |
684 } | 684 } |
685 | 685 |
686 // Nothing found. | 686 // Nothing found. |
687 return GetUndefinedMirror(); | 687 return GetUndefinedMirror(); |
688 }; | 688 }; |
689 | 689 |
690 | 690 |
691 /** | 691 /** |
692 * Returns objects which has direct references to this object | 692 * Returns objects which has direct references to this object |
693 * @param {number} opt_max_instances Optional parameter specifying the maximum | 693 * @param {number} opt_max_objects Optional parameter specifying the maximum |
694 * number of instances to return. | 694 * number of referencing objects to return. |
695 * @return {Array} The objects which has direct references to this object. | 695 * @return {Array} The objects which has direct references to this object. |
696 */ | 696 */ |
697 ObjectMirror.prototype.referencedBy = function(opt_max_instances) { | 697 ObjectMirror.prototype.referencedBy = function(opt_max_objects) { |
698 // Find all objects constructed from this function. | 698 // Find all objects with direct references to this object. |
699 var result = %DebugReferencedBy(this.value_, Mirror.prototype, opt_max_instanc
es || 0); | 699 var result = %DebugReferencedBy(this.value_, |
| 700 Mirror.prototype, opt_max_objects || 0); |
700 | 701 |
701 // Make mirrors for all the instances found. | 702 // Make mirrors for all the references found. |
702 for (var i = 0; i < result.length; i++) { | 703 for (var i = 0; i < result.length; i++) { |
703 result[i] = MakeMirror(result[i]); | 704 result[i] = MakeMirror(result[i]); |
704 } | 705 } |
705 | 706 |
706 return result; | 707 return result; |
707 }; | 708 }; |
708 | 709 |
709 | 710 |
710 ObjectMirror.prototype.toText = function() { | 711 ObjectMirror.prototype.toText = function() { |
711 var name; | 712 var name; |
(...skipping 1354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2066 /** | 2067 /** |
2067 * Convert a Date to ISO 8601 format. To avoid depending on the Date object | 2068 * Convert a Date to ISO 8601 format. To avoid depending on the Date object |
2068 * this method calls the functions in date.js directly and not through the | 2069 * this method calls the functions in date.js directly and not through the |
2069 * value. | 2070 * value. |
2070 * @param {Date} value The Date value to format as JSON | 2071 * @param {Date} value The Date value to format as JSON |
2071 * @return {string} JSON formatted Date value | 2072 * @return {string} JSON formatted Date value |
2072 */ | 2073 */ |
2073 function DateToJSON_(value) { | 2074 function DateToJSON_(value) { |
2074 return '"' + DateToISO8601_(value) + '"'; | 2075 return '"' + DateToISO8601_(value) + '"'; |
2075 } | 2076 } |
OLD | NEW |