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

Safari 12 workaround for array.reverse caching #377

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

Conversation

karimMourra
Copy link

This PR will...

Reverse a copy of the axis array as a workaround for a bug introduced in Safari 12 (https://bugs.webkit.org/show_bug.cgi?id=188794)

Why is this Pull Request needed?

Safari 12 introduced a bug where calling reverse on an array will cache the reverse value, causing captions to jump up and down.
To reproduce the bug run the following:

for (var i = 0; i <= 10; i ++) {
	var array1 = ['one', 'two'];
	console.log('array1: ', array1);
	var reversed = array1.reverse(); 
}

notice that even though the array is being instantiated, the value is reversed even before reverse is called.

The following screenshot shows the bug in action:
wtf

Safari 12 bug workaround
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.

1 participant