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

org.jetbrains.kotlin.js.backend.ast.JsName Maven / Gradle / Ivy

There is a newer version: 2.1.0-RC
Show newest version
// Copyright (c) 2011, the Dart project authors.  Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

package org.jetbrains.kotlin.js.backend.ast;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.kotlin.js.backend.ast.metadata.HasMetadataImpl;
import org.jetbrains.kotlin.js.common.Symbol;

/**
 * An abstract base class for named JavaScript objects.
 */
public class JsName extends HasMetadataImpl implements Symbol {
  @NotNull
  private final String ident;

  private final boolean temporary;

  /**
   * @param ident the unmangled ident to use for this name
   */
  public JsName(@NotNull String ident, boolean temporary) {
    this.ident = ident;
    this.temporary = temporary;
  }

  public boolean isTemporary() {
    return temporary;
  }

  @NotNull
  public String getIdent() {
    return ident;
  }

  @NotNull
  public JsNameRef makeRef() {
    return new JsNameRef(this);
  }

  @Override
  public String toString() {
    return ident;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy