Google Closure Compiler parse error: invalid property id for `css({float:'left'})`

I’m using Google Closure Compiler application (command line interface). When I run it I get the below error.

deploy/js/Home.js:40: ERROR - Parse error. invalid property id
    this.$images.wrapAll('<div id="slideInner"></div>').css({float:'left'});
                                                                   ^

1 error(s), 0 warning(s)

  • How Google Closure EventTarget works?
  • How do I use Google Closure compiler to remove unused JavaScript code?
  • How can I prevent the warning 'Property MyProp1 never defined on MyObject'?
  • Preventing closure compiler from renaming certain variables
  • Jquery vs Google Closure va GWT Pros & cons for large web application development
  • How can I mark methods created with `reify` with ^:export, so that the Closure compiler doesn't rename them?
  • Closure event delegation - event listener on DOM parent that covers children/descendants of a given class
  • What grid is behind spreadsheet in google doc?
  • How to use Google's Closure to compile JavaScript
  • how do I break up a regular expression in JavaScript
  • Suppressing or resolving compiler errors in goog.base
  • Using @typedef to define a specific function type
  • 2 Solutions collect form web for “Google Closure Compiler parse error: invalid property id for `css({float:'left'})`”

    I believe that you need to do:

    {'float':'left'}
    

    This is because float is on the list of Java keywords reserved by JavaScript, so it cannot be used as a property name. This may no longer be an issue in newer JS engines, but it can be a problem in older ones, which is why the Compiler yields an error.

    If you already have tons of soy files, and don’t want to change everthing in every soy file, you can pass a flag to the compiler:

    --compiler_flags="--language_in=ECMASCRIPT5"
    

    It worked out well for me.