Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3661664
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T01:19:50+00:00 2026-05-19T01:19:50+00:00

Google Closure Compiler renames all true, false and null occurences in code like; var

  • 0

Google Closure Compiler renames all “true”, “false” and “null” occurences in code like;

var s = true, x = null, V = false;

and uses these shorthands instead; in conditions such as;

if (someVariable == s)

now; Google Analytics code defines it’s own “s” variable; overriding the value “true”; and as you can see this causes a lot of problems.

I don’t want to change GA code; I just want Closure Compiler to quit renaming true etc. Externs do not work.

Do you know any way to accomplish this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T01:19:50+00:00Added an answer on May 19, 2026 at 1:19 am

    It turns out that one can prevent Google Closure Compiler from printing out global definitions (function and/or variable) by a parameter called “output_wrapper” to the command line code such as;

    java -jar compiler.jar --compilation_level ADVANCED_OPTIMIZATIONS --output_wrapper "(function(){%output%})();" --js input.js --js_output_file output.js
    

    This way, it doesn’t collide with global variables and prints all your code in an anonymous function wrapper.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use the Google Closure Compiler to split my application code based
Google Closure Compiler in advanced optimization mode uses a file to define externs that
When use the Google Closure Compiler advanced optimizations on the following code: function add(v1,
I would like to use Google Closure Compiler to build a set of CommonJS
I am trying to compile my Js code in google closure compiler and I
http://code.google.com/closure/compiler/docs/api-ref.html I don't understand how to pass multiple code_url parameters (multiple files to compress)...
Making some Bookmarklet, I tried to use JavaScript minifier like Google Closure Compiler or
I want to create a Google Closure Compiler plugin for Eclipse. I already have
I have a JavaScript file that I ran through the Google Closure compiler, and
EBay's VJET and Google's Closure Compiler both use type annotations in Javascript comments. Why

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.