001 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
002 // for details. All rights reserved. Use of this source code is governed by a
003 // BSD-style license that can be found in the LICENSE file.
004
005 package org.jetbrains.kotlin.js.backend.ast;
006
007 public final class JsStringLiteral extends JsLiteral.JsValueLiteral {
008 public static JsStringLiteral createCharZero() {
009 return new JsStringLiteral("\0");
010 }
011
012 private final String value;
013
014 // These only get created by JsProgram so that they can be interned.
015 JsStringLiteral(String value) {
016 this.value = value;
017 }
018
019 public String getValue() {
020 return value;
021 }
022
023 @Override
024 public void accept(JsVisitor v) {
025 v.visitString(this);
026 }
027
028 @Override
029 public void traverse(JsVisitorWithContext v, JsContext ctx) {
030 v.visit(this, ctx);
031 v.endVisit(this, ctx);
032 }
033 }