Saturday, 7 September 2013

Issue with with 'use strict' and underscore.js

Issue with with 'use strict' and underscore.js

I've written an app using Yeoman and backbone.js. At the top of every js
file I have specified 'use strict'; and when I run my grunt tasks jshint
does not encounter any errors.
I am able to build my app with grunt without issue however when I try to
run the uglified js I get the following error:
Uncaught SyntaxError: Strict mode code may not include a with statement
I've searched the code base and the only things using a with statement is
underscore.
I'm new to strict mode so I'm not sure how I can resolve this issue. Can I
not use strict mode anywhere that I use an underscorejs function?
Thanks.

No comments:

Post a Comment