All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.yahoo.platform.yui.compressor.JavaScriptIdentifier Maven / Gradle / Ivy

Go to download

To compress (Minify + Ofuscate) Javascript files and CSS files (using YUI Compressor from Julien Lecomte) and/or to check Javascript files with jslint.

There is a newer version: 0.7.1
Show newest version
/*
 * YUI Compressor
 * Author: Julien Lecomte 
 * Copyright (c) 2007, Yahoo! Inc. All rights reserved.
 * Code licensed under the BSD License:
 *     http://developer.yahoo.net/yui/license.txt
 */

package com.yahoo.platform.yui.compressor;

import org.mozilla.javascript.Token;

/**
 * JavaScriptIdentifier represents a variable/function identifier.
 */
class JavaScriptIdentifier extends JavaScriptToken {

    private int refcount = 0;
    private String mungedValue;
    private ScriptOrFnScope declaredScope;
    private boolean markedForMunging = true;

    JavaScriptIdentifier(String value, ScriptOrFnScope declaredScope) {
        super(Token.NAME, value);
        this.declaredScope = declaredScope;
    }

    ScriptOrFnScope getDeclaredScope() {
        return declaredScope;
    }

    void setMungedValue(String value) {
        mungedValue = value;
    }

    String getMungedValue() {
        return mungedValue;
    }

    void preventMunging() {
        markedForMunging = false;
    }

    boolean isMarkedForMunging() {
        return markedForMunging;
    }

    void incrementRefcount() {
        refcount++;
    }

    int getRefcount() {
        return refcount;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy