Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(690)

Unified Diff: src/mirror-delay.js

Issue 109026: Add inferred function name to the json protocol (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/runtime.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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())));
« no previous file with comments | « no previous file | src/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698