Community
Participate
Working Groups
Created attachment 119470 [details] demo java source file Build ID: M20080911-1700 Steps To Reproduce: "java.lang.IllegalArgumentException" happens when there is an anonymouse function in the javasrcript file, and the exceptions will come out while using the plugin org.eclipse.wst.jsdt.core.dom. 1. Please use the source of attachment file, and run it. 2. The exception message of Output is: ============================================================ java.lang.IllegalArgumentException at org.eclipse.wst.jsdt.core.dom.SimpleName.setIdentifier(SimpleName.java:196) at org.eclipse.wst.jsdt.core.dom.AST.newSimpleName(AST.java:898) atcom.fujitsu.interstage.rcf.pageeditor.javascript.core.TestJsdtFunction.main(TestJsdtFunction.java:63) ============================================================ More information: The problematic reasons of the current behavior : 1.SimpleName.java maybe add a Static variable :public static final int NO_FUNCTION_NAME = 8; 2.TerminalTokens.java maybe add a variable :int TokenNoNameIdentifier = 56; 3.SimpleName#setIdentifier(String identifier) may be fixed. *Line 188 : if (tokenType != TerminalTokens.TokenNameIdentifier) { may be changed as following: if (tokenType != TerminalTokens.TokenNameIdentifier&&tokenType!=TerminalTokens.TokenNoNameIdentifier) { *Line 192: if (scanner.currentPosition != length) { may be changed as following: if (scanner.currentPosition != length&&scanner.currentPosition!=NO_FUNCTION_NAME) { Thank you so much for your patience and best regards! Wang Wei
*** Bug 257456 has been marked as a duplicate of this bug. ***
Created attachment 133668 [details] project set file for JSDT Core Wang, I greatly appreciate the suggested changes in comment 0, but they really should be attached as a patch if we're going to accept them. You can do so by importing the attached team project set file (File menu, Import..., choose "Team Project Set", making the changes there, and creating the patch from the "Team" context menu on the changed source file/package/project.
Categorizing JSDT bugzillas for planning purposes.
I don't understand the expression you are trying to create. Your example is setting the name of the object literal field to a function expression? That does not appear to be valid JavaScript to me. If I am missing something please re-open.