bug fixes
[org.ibex.js.git] / src / org / ibex / js / JSString.java
index 5dc2334..a0ca694 100644 (file)
@@ -1,24 +1,29 @@
+// Copyright 2000-2005 the Contributors, as shown in the revision logs.
+// Licensed under the Apache Public Source License 2.0 ("the License").
+// You may not use this file except in compliance with the License.
+
 package org.ibex.js;
 
 import org.ibex.util.*;
+import java.util.*;
 
 class JSString extends JSPrimitive {
     final String s;
     public JSString(String s) { this.s = s; }
     public int hashCode() { return s.hashCode(); }
     
-    public boolean jsequals(JS o) {
+    public boolean equals(Object o) {
         if(o == this) return true;
         if(o instanceof JSString) {
             return ((JSString)o).s.equals(s);
         } else if(o instanceof JSNumber) {
-            return o.jsequals(this);
+            return o.equals(this);
         } else {
             return false;
         }
     }
     
-    private final static Hash internHash = new Hash();
+    private final static Map internHash = new HashMap();
     static synchronized JS intern(String s) {
         synchronized(internHash) {
             JS js = (JS)internHash.get(s);
@@ -31,5 +36,5 @@ class JSString extends JSPrimitive {
         protected void finalize() { synchronized(internHash) { internHash.put(s,null); } }
     }
     
-    String coerceToString() { return s; }
+    public String coerceToString() { return s; }
 }