Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

204
Vistas
"ReferenceError: $jscomp is not defined" when changing output language spec by google-closure-compiler jar

I've downloaded the most recent version of compiler and i've tried to optimize js code with these flags:

java -jar closure-compiler-v20211006.jar -W VERBOSE -O WHITESPACE_ONLY --language_out ECMASCRIPT5 $script_path_in --js_output_file $script_path_tmp

closure compiler has optimized this lines of code:

for(var extraProperty of extraProperties){  
    option.setAttribute(extraProperty,initialOption[extraProperty]);    
}

into

for (var $jscomp$iter$0 = $jscomp.makeIterator(extraProperties), $jscomp$key$extraProperty = $jscomp$iter$0.next(); !$jscomp$key$extraProperty.done; $jscomp$key$extraProperty = $jscomp$iter$0.next()) {
        var extraProperty = $jscomp$key$extraProperty.value;
        {
            option.setAttribute(extraProperty, initialOption[extraProperty])
        }
    }

And as a result i receive such error in browser:

all_compressed.js Uncaught ReferenceError: $jscomp is not defined

Is there a way to change language spec with this compiler without adding side dependencies into the project, or maybe it's a bug?

Git bug tracker

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

The best option for white space only mode is to set the language out to the latest ECMASCRIPT version used by the source code (or later) to avoid runtime dependencies.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda