Index: src/mirror-delay.js |
=================================================================== |
--- src/mirror-delay.js (revision 1863) |
+++ src/mirror-delay.js (working copy) |
@@ -756,6 +756,15 @@ |
/** |
+ * Returns the inferred name of the function. |
+ * @return {string} Name of the function |
+ */ |
+FunctionMirror.prototype.inferredName = function() { |
+ return %FunctionGetInferredName(this.value_); |
+}; |
+ |
+ |
+/** |
* Returns the source code for the function. |
* @return {string or undefined} The source code for the function. If the |
* function is not resolved undefined will be returned. |
@@ -857,6 +866,11 @@ |
}; |
+UnresolvedFunctionMirror.prototype.inferredName = function() { |
+ return undefined; |
+}; |
+ |
+ |
UnresolvedFunctionMirror.prototype.propertyNames = function(kind, limit) { |
return []; |
} |
@@ -1835,6 +1849,10 @@ |
if (mirror.isFunction()) { |
// Add function specific properties. |
content.push(MakeJSONPair_('name', StringToJSON_(mirror.name()))); |
+ if (!IS_UNDEFINED(mirror.inferredName())) { |
+ content.push(MakeJSONPair_('inferredName', |
+ StringToJSON_(mirror.inferredName()))); |
+ } |
content.push(MakeJSONPair_('resolved', BooleanToJSON_(mirror.resolved()))); |
if (mirror.resolved()) { |
content.push(MakeJSONPair_('source', StringToJSON_(mirror.source()))); |