svnlabs / google-caja

Automatically exported from code.google.com/p/google-caja
0 stars 1 forks source link

JQuery 2.1.1 Version #1945

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
<script 
src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>

I see error (in the chrome console)
"In strict mode code, functions can only be declared at top level or 
immediately within another function."

On the other hand, version
2.1.0/jquery.min.js and 2.1.1/jquery.js are loading just fine.

Please see the attachment.

Original issue reported on code.google.com by pradeep....@gmail.com on 3 Dec 2014 at 3:47

Attachments:

GoogleCodeExporter commented 9 years ago
Caja requires that all scripts be compatible with ES5 strict mode. This is a 
fundamental part of our design and cannot be relaxed. I've confirmed that 
.../2.1.1/jquery.min.js does contain that error in strict mode independent of 
Caja.

Since you say unminified 2.1.1 is OK, I would say that the minifier is at fault 
(it must have moved a function declaration inside a block) and a bug should be 
filed against it. You could also minify JQuery with a different tool that does 
not make this mistake.

Original comment by kpreid@google.com on 3 Dec 2014 at 7:10

GoogleCodeExporter commented 9 years ago

Original comment by erights on 3 Dec 2014 at 7:37