Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eclipse "Syntax error on token "new", ArrayLiteralHeader expected after this token", l. 19 of v1.0.2 of base2.js #144

Open
GoogleCodeExporter opened this issue Jul 8, 2015 · 3 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Download v1.0.2 of base2.js 
2. Create an Eclipse jsdt Web project which includes this source
3. Try opening the file

What is the expected output? What do you see instead?

I would expect to be able to view the base2.js file in Eclipse without 
validation errors.

What version of the product are you using? On what operating system?

v1.0.2 of base2.js 

Eclipse IDE for JavaScript Web Developers.
Version: Indigo Service Release 2
Build id: 20120208-2150
Version: 1.4.2.20120206-1433


Please provide any additional information below.

Repros on Mac and XP Pc's (as you would expect for an Eclipse Java app).

Original issue reported on code.google.com by [email protected] on 22 Feb 2012 at 11:44

@GoogleCodeExporter
Copy link
Author

This is the line Eclipse's knickers get in a twist about:

new function(_no_shrink_) { ///////////////  BEGIN: CLOSURE  ///////////////

Original comment by [email protected] on 22 Feb 2012 at 11:45

@GoogleCodeExporter
Copy link
Author

Oh, I also get at l. 1675 (last line):

}; ////////////////////  END: CLOSURE  /////////////////////////////////////


the error:

Syntax error, insert "]" to complete  NewExpression



Original comment by [email protected] on 22 Feb 2012 at 11:49

@GoogleCodeExporter
Copy link
Author

The following patch seems to fix it (and my code which calls into base2.js 
still seems to work).  Is this a case of Eclipse's JavaScript parser not being 
up-to-date to the latest evolution of the spec, or is it being too picky?


Index: base2.js
===================================================================
--- base2.js    (revision 32027)
+++ base2.js    (working copy)
@@ -16,7 +16,7 @@
   namespace: ""
 };

-new function(_no_shrink_) { ///////////////  BEGIN: CLOSURE  ///////////////
+(new function(_no_shrink_) { ///////////////  BEGIN: CLOSURE  ///////////////

 // =========================================================================
 // base2/header.js
@@ -1672,4 +1672,4 @@
 lang.base = base;
 lang.extend = extend;

-}; ////////////////////  END: CLOSURE  /////////////////////////////////////
\ No newline at end of file
+}) ////////////////////  END: CLOSURE  /////////////////////////////////////
\ No newline at end of file

Original comment by [email protected] on 22 Feb 2012 at 1:57

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant