OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
3 * Copyright (C) 2009 Joseph Pecoraro | 3 * Copyright (C) 2009 Joseph Pecoraro |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
571 treeElement.appendChild(new WebInspector.CollectionEntriesMainTreeElemen
t(value)); | 571 treeElement.appendChild(new WebInspector.CollectionEntriesMainTreeElemen
t(value)); |
572 if (internalProperties) { | 572 if (internalProperties) { |
573 for (var i = 0; i < internalProperties.length; i++) { | 573 for (var i = 0; i < internalProperties.length; i++) { |
574 internalProperties[i].parentObject = value; | 574 internalProperties[i].parentObject = value; |
575 treeElement.appendChild(new treeElementConstructor(internalPropertie
s[i])); | 575 treeElement.appendChild(new treeElementConstructor(internalPropertie
s[i])); |
576 } | 576 } |
577 } | 577 } |
578 } | 578 } |
579 | 579 |
580 /** | 580 /** |
581 * @param {!WebInspector.RemoteObject} object | 581 * @param {?WebInspector.RemoteObject} object |
582 * @param {!Array.<string>} propertyPath | 582 * @param {!Array.<string>} propertyPath |
583 * @param {function(?WebInspector.RemoteObject, boolean=)} callback | 583 * @param {function(?WebInspector.RemoteObject, boolean=)} callback |
584 * @return {!Element} | 584 * @return {!Element} |
585 */ | 585 */ |
586 WebInspector.ObjectPropertyTreeElement.createRemoteObjectAccessorPropertySpan =
function(object, propertyPath, callback) | 586 WebInspector.ObjectPropertyTreeElement.createRemoteObjectAccessorPropertySpan =
function(object, propertyPath, callback) |
587 { | 587 { |
588 var rootElement = document.createElement("span"); | 588 var rootElement = document.createElement("span"); |
589 var element = rootElement.createChild("span", "properties-calculate-value-bu
tton"); | 589 var element = rootElement.createChild("span"); |
590 element.textContent = WebInspector.UIString("(...)"); | 590 element.textContent = WebInspector.UIString("(...)"); |
| 591 if (!object) |
| 592 return rootElement; |
| 593 element.classList.add("properties-calculate-value-button"); |
591 element.title = WebInspector.UIString("Invoke property getter"); | 594 element.title = WebInspector.UIString("Invoke property getter"); |
592 element.addEventListener("click", onInvokeGetterClick, false); | 595 element.addEventListener("click", onInvokeGetterClick, false); |
593 | 596 |
594 function onInvokeGetterClick(event) | 597 function onInvokeGetterClick(event) |
595 { | 598 { |
596 event.consume(); | 599 event.consume(); |
597 object.getProperty(propertyPath, callback); | 600 object.getProperty(propertyPath, callback); |
598 } | 601 } |
599 | 602 |
600 return rootElement; | 603 return rootElement; |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
714 { | 717 { |
715 if (!entries) | 718 if (!entries) |
716 return; | 719 return; |
717 this.removeChildren(); | 720 this.removeChildren(); |
718 | 721 |
719 var entriesLocalObject = []; | 722 var entriesLocalObject = []; |
720 var runtimeModel = this._remoteObject.target().runtimeModel; | 723 var runtimeModel = this._remoteObject.target().runtimeModel; |
721 for (var i = 0; i < entries.length; ++i) { | 724 for (var i = 0; i < entries.length; ++i) { |
722 var entry = entries[i]; | 725 var entry = entries[i]; |
723 if (entry.key) { | 726 if (entry.key) { |
724 entriesLocalObject.push({ | 727 entriesLocalObject.push(new WebInspector.MapEntryLocalJSONOb
ject({ |
725 key: runtimeModel.createRemoteObject(entry.key), | 728 key: runtimeModel.createRemoteObject(entry.key), |
726 value: runtimeModel.createRemoteObject(entry.value) | 729 value: runtimeModel.createRemoteObject(entry.value) |
727 }); | 730 })); |
728 } else { | 731 } else { |
729 entriesLocalObject.push(runtimeModel.createRemoteObject(entr
y.value)); | 732 entriesLocalObject.push(runtimeModel.createRemoteObject(entr
y.value)); |
730 } | 733 } |
731 } | 734 } |
732 WebInspector.ObjectPropertyTreeElement.populate(this, WebInspector.R
emoteObject.fromLocalObject(entriesLocalObject)); | 735 WebInspector.ObjectPropertyTreeElement.populate(this, WebInspector.R
emoteObject.fromLocalObject(entriesLocalObject)); |
733 this.title = "<entries>[" + entriesLocalObject.length + "]"; | 736 this.title = "<entries>[" + entriesLocalObject.length + "]"; |
734 } | 737 } |
735 | 738 |
736 this._remoteObject.collectionEntries(didGetCollectionEntries.bind(this))
; | 739 this._remoteObject.collectionEntries(didGetCollectionEntries.bind(this))
; |
737 }, | 740 }, |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1059 { | 1062 { |
1060 WebInspector.TextPrompt.call(this, WebInspector.ExecutionContextSelector.com
pletionsForTextPromptInCurrentContext); | 1063 WebInspector.TextPrompt.call(this, WebInspector.ExecutionContextSelector.com
pletionsForTextPromptInCurrentContext); |
1061 this.setSuggestBoxEnabled(true); | 1064 this.setSuggestBoxEnabled(true); |
1062 if (renderAsBlock) | 1065 if (renderAsBlock) |
1063 this.renderAsBlock(); | 1066 this.renderAsBlock(); |
1064 } | 1067 } |
1065 | 1068 |
1066 WebInspector.ObjectPropertyPrompt.prototype = { | 1069 WebInspector.ObjectPropertyPrompt.prototype = { |
1067 __proto__: WebInspector.TextPrompt.prototype | 1070 __proto__: WebInspector.TextPrompt.prototype |
1068 } | 1071 } |
OLD | NEW |