scriptsharp
scriptsharp copied to clipboard
IE8 StringBuilder toString bugfix
Before : var t = new ss.StringBuilder; t.appendLine("toString overriden"), var s = t.toString(); // IE8 returns [object Object]
After : var t = new ss.StringBuilder; t.appendLine("IE8 toString override bug"), var s = t.toString(); // IE8 returns "toString overriden"
More informations on this bug : http://stackoverflow.com/questions/6821354/issues-with-object-tostring-in-ie8-backbone-js
Runtime scripts : I have search for every "toString" that was overriden in scriptsharp "Runtime scripts" but only found this one.
Compiled scripts : ScriptSharp compiler prevent overriding "toString" with a "Your C# source code use an unsupported feature" error.
Thanks for your time. Regards Luc
Based on the referenced SO question, wouldn't this work? (likely somewhere at the bottom of the runtime script, after types have been registered, prototype has been set etc.)
StringBuilder.prototype.toString = StringBuilder$.toString;