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

Re-merge maze loop trap #22970

Merged
merged 7 commits into from Jul 9, 2018
Merged

Re-merge maze loop trap #22970

merged 7 commits into from Jul 9, 2018

Conversation

joshlory
Copy link
Contributor

@joshlory joshlory commented Jun 7, 2018

Revert PR #22860, to re-merge PR #22752 (with fixes).

@joshlory joshlory requested a review from Hamms June 7, 2018 20:45
@joshlory
Copy link
Contributor Author

joshlory commented Jun 7, 2018

@@ -764,3 +764,7 @@ export function calculateOffsetCoordinates(element, clientX, clientY) {
y: Math.round((clientY - rect.top) * element.offsetHeight / rect.height),
};
}

export function escapeRegExp(str) {
return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, do special characters not need to be escaped when in a character set?

@joshlory joshlory merged commit 6c5746a into staging Jul 9, 2018
@joshlory joshlory deleted the remerge-maze-loop-trap branch July 9, 2018 16:38
@@ -48,7 +48,7 @@ exports.strip = function (code) {
// Strip out serial numbers.
.replace(/(,\s*)?'block_id_\d+'\)/g, ')')
// Remove timeouts.
.replace(INFINITE_LOOP_TRAP, '')
.replace(new RegExp(utils.escapeRegExp(INFINITE_LOOP_TRAP), 'g'), '')
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coming soon to babel, replaceAll for this exact use case! https://twitter.com/v8js/status/1193917549060280320

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