Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IE8 StringBuilder toString bugfix #400

Open
wants to merge 1 commit into
base: cc
Choose a base branch
from

Conversation

lduchosal
Copy link

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

var t = new ss.StringBuilder;
t.appendLine("IE8 toString override bug"),
var s = t.toString(''); // IE8 returns [object Object]
@nikhilk
Copy link
Owner

nikhilk commented Nov 1, 2013

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;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants