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 #376

Closed
wants to merge 1 commit into from

Conversation

karimMourra
Copy link

@karimMourra karimMourra commented Oct 22, 2018

This PR will...

use variables instead of strings when instantiating arrays that can be reversed.

Why is this Pull Request needed?

Safari 12 introduced a bug where calling reverse on an array will cache the reverse value (https://bugs.webkit.org/show_bug.cgi?id=188794), 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

@karimMourra
Copy link
Author

Replaced by #377

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

1 participant