Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 241847 Details for
Bug 431946
"Maximum call stack size exceeded" exception opening textView.js
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
proposed fix
patch.txt (text/plain), 4.66 KB, created by
Michael Rennie
on 2014-04-10 12:05:03 EDT
(
hide
)
Description:
proposed fix
Filename:
MIME Type:
Creator:
Michael Rennie
Created:
2014-04-10 12:05:03 EDT
Size:
4.66 KB
patch
obsolete
>diff --git a/bundles/org.eclipse.orion.client.javascript/web/javascript/contentAssist/esprimaVisitor.js b/bundles/org.eclipse.orion.client.javascript/web/javascript/contentAssist/esprimaVisitor.js >index b935cf6..b74253a 100644 >--- a/bundles/org.eclipse.orion.client.javascript/web/javascript/contentAssist/esprimaVisitor.js >+++ b/bundles/org.eclipse.orion.client.javascript/web/javascript/contentAssist/esprimaVisitor.js >@@ -1,6 +1,6 @@ > /******************************************************************************* > * @license >- * Copyright (c) 2012, 2013 VMware, Inc. and others. >+ * Copyright (c) 2012, 2014 VMware, Inc. and others. > * All Rights Reserved. This program and the accompanying materials are made > * available under the terms of the Eclipse Public License v1.0 > * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution >@@ -8,6 +8,7 @@ > * > * Contributors: > * Andrew Eisenberg (VMware) - initial API and implementation >+ * IBM Corporation - bug fixes / improvements > ******************************************************************************/ > > /*global define esprima */ >@@ -16,65 +17,41 @@ > > return { > >+ restricted: {range:true, errors:true, target:true, extras:true, comments:true, parent:true, tokens:true}, >+ > /** >- * Generic AST visitor. Visits all children in source order, if they have a range property. >+ * Generic AST visitor. Visits all typed children in source order > * >- * @param node The AST node to visit >- * @param {rhsVisit:Boolean,...} context any extra data required to pass between operations. Set rhsVisit to true if the rhs of >+ * @param {Object} node The AST node to visit >+ * @param {Object} context Extra data required to pass between operations. Set rhsVisit to true if the rhs of > * assignments and variable declarators should be visited before the lhs >- * @param operation function(node, context, [isInitialOp]) an operation on the AST node and the data. Return falsy if >- * the visit should no longer continue. Return truthy to continue. >- * @param [postoperation] (optional) function(node, context, [isInitialOp]) an operation that is exectuted after visiting the current node's children. >- * will only be invoked if operation returns true for the current node >+ * @param {Function} operation An operation on the AST node and the data. Return false if >+ * the visit should no longer continue. Return true to continue. >+ * @param {Function} postoperation (optional) An operation that is exectuted after visiting the current node's children. >+ * will only be invoked iff the operation returns true for the current node > */ > visit: function(node, context, operation, postoperation) { >- var i, key, child, children; >- > if (operation(node, context, true)) { > // gather children to visit >- children = []; >+ var i, key; >+ var children = []; > for (key in node) { >- if (key !== "range" && key !== "errors" && key !== "target" && key !== "extras" && >- key !== "comments" && key !== 'parent') { >- child = node[key]; >+ if (!this.restricted[key]) { >+ var child = node[key]; > if (child instanceof Array) { > for (i = 0; i < child.length; i++) { >- if (child[i] && child[i].hasOwnProperty("type")) { >+ if (child[i] && child[i].type) { > children.push(child[i]); >- } else if (key === "properties") { >- // might be key-value pair of an object expression >- // in old versions of the parser, the 'properties' property did not have a 'type' or a 'range' >- // so we must explicitly visit the children here. >- // in new versions of the parser, this is fixed, and this branch will never be taken. >- if (child[i].hasOwnProperty("key") && child[i].hasOwnProperty("value")) { >- children.push(child[i].key); >- children.push(child[i].value); >- } > } > } > } else { >- if (child && child.hasOwnProperty("type")) { >+ if (child && child.type) { > children.push(child); > } > } > } > } >- > if (children.length > 0) { >- // sort children by source location >- // children with no source location are visited first >- children.sort(function(left, right) { >- if (left.range && right.range) { >- return left.range[0] - right.range[0]; >- } else if (left.range) { >- return 1; >- } else if (right.range) { >- return -1; >- } else { >- return 0; >- } >- }); >- > // visit children in order > for (i = 0; i < children.length; i++) { > this.visit(children[i], context, operation, postoperation);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 431946
: 241847