String.toString() can be specified on a prototype
authorJaroslav Tulach <jtulach@netbeans.org>
Wed, 21 Nov 2012 23:55:09 +0100
changeset 194fb6298cc9ec5
parent 193 c705a447ce71
child 195 23047f655bfd
String.toString() can be specified on a prototype
emul/src/main/resources/org/apidesign/vm4brwsr/emul/java_lang_String.js
     1.1 --- a/emul/src/main/resources/org/apidesign/vm4brwsr/emul/java_lang_String.js	Wed Nov 21 23:53:00 2012 +0100
     1.2 +++ b/emul/src/main/resources/org/apidesign/vm4brwsr/emul/java_lang_String.js	Wed Nov 21 23:55:09 2012 +0100
     1.3 @@ -2226,17 +2226,9 @@
     1.4  function java_lang_String() {
     1.5    /** the real value of this 'string' we delegate to */
     1.6    this.r = '';
     1.7 -  
     1.8 -  var self = this;
     1.9 -    /*
    1.10 -  this.value = 0;
    1.11 -  this.offset = 0;
    1.12 -  this.count = 0;
    1.13 -  this.hash = 0;
    1.14 -  */
    1.15 -  this.toString = function() { return self.r; };
    1.16  }
    1.17  java_lang_String.prototype = new String;
    1.18 +java_lang_String.prototype.toString = function() { return this.r; };;
    1.19  //java_lang_String_classV();
    1.20  
    1.21  /* new method for JavaScript String */