Skip to content

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.

1 participant