Re: Jquery 2.0.0 Compilation errors

109 views
Skip to first unread message

Nathan Naze

unread,
Apr 21, 2013, 12:58:01 PM4/21/13
to closure-library, closure-comp...@googlegroups.com
On Sun, Apr 21, 2013 at 11:13 AM, <eder...@gmail.com> wrote:
> JQuery 2.0.0 -> http://code.jquery.com/jquery-2.0.0.js
> Online Compiler -> http://closure-compiler.appspot.com
>
> Number of errors: 29
>
> I'm trying to compile programmatically, with the same problem.
>
> private static String compile(String code, String fileName) {
> Compiler compiler = new Compiler();
> CompilerOptions options = new CompilerOptions();
> CompilationLevel.SIMPLE_OPTIMIZATIONS
> .setOptionsForCompilationLevel(options);
> SourceFile extern = SourceFile.fromCode("externs.js",
> "function alert(x) {}");
> SourceFile input = SourceFile.fromCode(fileName, code);
> compiler.compile(extern, input, options);
> return compiler.toSource();
> }
>
> Any solution?
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "Closure Library Discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to closure-library-d...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Alan Leung

unread,
Apr 23, 2013, 3:02:34 PM4/23/13
to closure-comp...@googlegroups.com, closure-library
I think this might have to do with the fact that 'boolean' is not a valid property name in ES3. You need to enable the compiler's ES5 model.


You received this message because you are subscribed to the Google Groups "Closure Compiler Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to closure-compiler-d...@googlegroups.com.

Nathan Naze

unread,
Apr 24, 2013, 1:09:12 PM4/24/13
to closure-comp...@googlegroups.com, closure-library
Dave,

You might consider pulling the compiler as a .jar or git submodule and
create a unit test that ensures compilation succeeds before release.
I do not know what your unit test setup looks like.

Nathan

On Wed, Apr 24, 2013 at 12:52 PM, <dave.m...@gmail.com> wrote:
> To follow up, we're changing `boolean` to `bool` for jQuery 2.0.1 in case
> someone doesn't enable ES5. We'd greatly appreciate if Closure Compiler fans
> could follow along and test with the latest betas as they're announced so we
> can catch these issues before release. Also, the most recent pre-release
> copy is always at http://code.jquery.com/jquery-git2.js and feedback on that
> build is welcome too!
>
>
> On Tuesday, April 23, 2013 3:02:34 PM UTC-4, Alan wrote:
>>
>> I think this might have to do with the fact that 'boolean' is not a valid
>> property name in ES3. You need to enable the compiler's ES5 model.
>>

Ben Lickly

unread,
Apr 24, 2013, 1:43:50 PM4/24/13
to closure-comp...@googlegroups.com, closure-library
We also have a Closure Compiler service API:

There are many options, but if you just run:
curl http://closure-compiler.appspot.com/compile --data "output_format=text&output_info=errors&code_url=http://code.jquery.com/jquery-git2.js"

You should get a (hopefully empty) text list of compile errors on your prerelease code.

eder...@gmail.com

unread,
Apr 24, 2013, 1:42:03 PM4/24/13
to closure-lib...@googlegroups.com, closure-comp...@googlegroups.com
How to enable the compiler's ES5 programmatically model??

Ben Lickly

unread,
Apr 24, 2013, 2:14:08 PM4/24/13
to closure-comp...@googlegroups.com, closure-library
language=ECMASCRIPT5


On Wed, Apr 24, 2013 at 10:42 AM, <eder...@gmail.com> wrote:
How to enable the compiler's ES5 programmatically model??

eder...@gmail.com

unread,
Apr 24, 2013, 1:51:00 PM4/24/13
to closure-lib...@googlegroups.com, closure-comp...@googlegroups.com
Ok, Already done! Works fine, thanks!

CompilerOptions options = new CompilerOptions();
options.setLanguageIn(LanguageMode.ECMASCRIPT5);
CompilationLevel.SIMPLE_OPTIMIZATIONS
.setOptionsForCompilationLevel(options);
Reply all
Reply to author
Forward
0 new messages