Bug 354160 - [validation] Anonymous functions not executed immediately show syntax error
Summary: [validation] Anonymous functions not executed immediately show syntax error
Status: NEW
Alias: None
Product: JSDT
Classification: WebTools
Component: General (show other bugs)
Version: unspecified   Edit
Hardware: Macintosh Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Chris Jaun CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-08 12:09 EDT by Christian Hammer CLA
Modified: 2013-06-19 11:10 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Hammer CLA 2011-08-08 12:09:47 EDT
Build Identifier: I20110613-1736

An anonymous function that is not called immediately gets tagged with an error message:

Syntax error on token "function", Identifier expected after this token

When calling this function directly this error goes away. However, the file containing the function might be loaded and fed to an eval construct, which assigns the function to a variable. So while this is a rather peculiar case, it is not a JS error but should rather raise a warning that this is potentially a no-op.


Reproducible: Always

Steps to Reproduce:
function(x) {
    return x+42;
};