# HG changeset patch # User Jaroslav Tulach # Date 1353538509 -3600 # Node ID fb6298cc9ec51c70aedc72822f9dd223aa3123f5 # Parent c705a447ce7154ac79cfdd43bebe47ca4cf7a41c String.toString() can be specified on a prototype diff -r c705a447ce71 -r fb6298cc9ec5 emul/src/main/resources/org/apidesign/vm4brwsr/emul/java_lang_String.js --- a/emul/src/main/resources/org/apidesign/vm4brwsr/emul/java_lang_String.js Wed Nov 21 23:53:00 2012 +0100 +++ b/emul/src/main/resources/org/apidesign/vm4brwsr/emul/java_lang_String.js Wed Nov 21 23:55:09 2012 +0100 @@ -2226,17 +2226,9 @@ function java_lang_String() { /** the real value of this 'string' we delegate to */ this.r = ''; - - var self = this; - /* - this.value = 0; - this.offset = 0; - this.count = 0; - this.hash = 0; - */ - this.toString = function() { return self.r; }; } java_lang_String.prototype = new String; +java_lang_String.prototype.toString = function() { return this.r; };; //java_lang_String_classV(); /* new method for JavaScript String */