Skip to content

Quick fix to the Safari undefined string bug#440

Closed
GianlucaGuarini wants to merge 1 commit intohandlebars-lang:masterfrom
GianlucaGuarini:master
Closed

Quick fix to the Safari undefined string bug#440
GianlucaGuarini wants to merge 1 commit intohandlebars-lang:masterfrom
GianlucaGuarini:master

Conversation

@GianlucaGuarini
Copy link
Copy Markdown

If the string to quote is undefined Handlebars throws an error only on Safari, this patch fixes the problem returning empty quotes for the undefined strings

@leonardehrenfried
Copy link
Copy Markdown

I think the issue in question is #373. This is really strange and I just managed to create a minimal test case for it: http://jsbin.com/ezidox/25

Note that the case only fails with Safari 6 and only if the inspector is closed.

Furthermore, it looks to me like Safari starts failing only after calling the function a few times. This suggests to me, that maybe it's due to a Nitro optimisation gone wrong.

@kpdecker
Copy link
Copy Markdown
Collaborator

Assuming that this issue is deterministic then it was resolved by 94e7004 which is available in rc3. I couldn't even begin to tell you WHY that might have resolved it but after bisecting this it seems pretty reliable that this fixed this issue.

Closing this PR as it feels like it actually masks the incorrect behavior where we actually want things to fail as there is something seriously wrong if that method receives undefined values.

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.

3 participants