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

Unified Diff: third_party/WebKit/Source/devtools/front_end/es_tree/ESTreeWalker.js

Issue 1887913002: DevTools: improve identifier extraction in SourceMapNamesResolver (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
Index: third_party/WebKit/Source/devtools/front_end/es_tree/ESTreeWalker.js
diff --git a/third_party/WebKit/Source/devtools/front_end/es_tree/ESTreeWalker.js b/third_party/WebKit/Source/devtools/front_end/es_tree/ESTreeWalker.js
index 6f564dbcac23a0291c47acdaf7eab451d4c36a80..dfa926c0ba32ebabaa210b6b4cbeee93e0c7c806 100644
--- a/third_party/WebKit/Source/devtools/front_end/es_tree/ESTreeWalker.js
+++ b/third_party/WebKit/Source/devtools/front_end/es_tree/ESTreeWalker.js
@@ -5,14 +5,16 @@
/**
* @constructor
* @param {function(!ESTree.Node)} beforeVisit
- * @param {function(!ESTree.Node)} afterVisit
+ * @param {function(!ESTree.Node)=} afterVisit
*/
WebInspector.ESTreeWalker = function(beforeVisit, afterVisit)
{
this._beforeVisit = beforeVisit;
- this._afterVisit = afterVisit;
+ this._afterVisit = afterVisit || new Function();
}
+WebInspector.ESTreeWalker.SkipSubtree = {};
+
WebInspector.ESTreeWalker.prototype = {
/**
* @param {!ESTree.Node} ast
@@ -32,7 +34,10 @@ WebInspector.ESTreeWalker.prototype = {
return;
node.parent = parent;
- this._beforeVisit.call(null, node);
+ if (this._beforeVisit.call(null, node) === WebInspector.ESTreeWalker.SkipSubtree) {
+ this._afterVisit.call(null, node);
+ return;
+ }
var walkOrder = WebInspector.ESTreeWalker._walkOrder[node.type];
if (!walkOrder) {
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/common/Text.js ('k') | third_party/WebKit/Source/devtools/front_end/externs.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698