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

  • SEARCH
  • Home
  • 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 6959213
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:14:31+00:00 2026-05-27T15:14:31+00:00

I am trying to minify a third-party JavaScript library using Google Closure Compiler, but

  • 0

I am trying to minify a third-party JavaScript library using Google Closure Compiler, but it errors out at below line:

inBlock.package = package = name

The error is

ERROR – Parse error. missing name after . operator**

name above is a local variable inside a function and inBlock is an input argument. Nowhere in the function is package declared other than that error line.

I guess it may be due to package is a reserved keyword in JavaScript?
Any idea what package is in JavaScript and how to fix it?

  • 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-27T15:14:32+00:00Added an answer on May 27, 2026 at 3:14 pm

    You’re right, package is a reserved word in JavaScript (but only in strict mode, which will be why the code works in some places).

    package is future-reserved, which means it’s not used for anything, but you can’t use it to name variables. However (if you really must), you can use it to name keys in objects like this:

    inBlock['package'] = name;  // this is ok
    

    As long as you use a string. You can’t do this:

    inBlock.package = name;  // this is not ok
    

    I would say you’re better off naming it something else.


    For those wondering if this is still true today – package was added to the future-reserved list in ES-3 (1999), and has remained there until today. At the time of writing, we are at ES-11 (2020), where it is still unavailable.

    The relevant parts of the ES-11 2020 spec are:

    11.6.2 Note 2:

    enum is not currently used as a keyword in this specification. It is a future reserved word, set aside for use as a keyword in future language extensions.

    Similarly, implements, interface, package, private, protected, and public are future reserved words in strict mode code.

    and 12.1.1 SS: Early Errors:

    Identifier: IdentifierName but not ReservedWord

    It is a Syntax Error if this phrase is contained in strict mode code and the StringValue of IdentifierName is: "implements", "interface", "let", "package", "private", "protected", "public", "static", or "yield".

    • 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 Reducisaurus Web Service to minify CSS and Javascript but I've
I'm trying to minify multiple CSS files using preg_replace() . Actually, I'm only trying
Trying to do this sort of thing... WHERE username LIKE '%$str%' ...but using bound
I am trying to minify some files in a roll-up script using jsmin. This
Does anybody know how to integrate Google closure compiler with Eclipse IDE? The thing
trying to work out how to install zipArchive extension with MAMP, but not having
While trying to do this: my $obj = new JavaScript::Minifier; $obj->minify(*STDIN, *STDOUT); // modified
Trying to figure out how to do this. I have the style but I'd
I'm using yuicompressor to minify and obfuscate some javscript files. I'm trying to dynamically
Trying to execute a Powershell cmdlet from a MVC 3 Controller using impersonation but

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.