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

Draco fix for #6523 #6525

Merged
merged 3 commits into from
Apr 30, 2018
Merged

Draco fix for #6523 #6525

merged 3 commits into from
Apr 30, 2018

Conversation

ggetz
Copy link
Contributor

@ggetz ggetz commented Apr 30, 2018

Fixes #6523

replaceAllButFirstInString was replacing the variable name everywhere, even in subsets of other variables, (ex. a_position was replaced in both a_position and a_position_1).

@ggetz ggetz requested a review from lilleyse April 30, 2018 14:30
@cesium-concierge
Copy link

Signed CLA is on file.

@ggetz, thanks for the pull request! Maintainers, we have a signed CLA from @ggetz, so you can review this at any time.

⚠️ I noticed that CHANGES.md has not been updated. If this change updates the public API in any way, fixes a bug, or makes any non-trivial update, please add a bullet point to CHANGES.md and comment on this pull request so we know it was updated. For more info, see the Pull Request Guidelines.


I am a bot who helps you make Cesium awesome! Contributions to my configuration are welcome.

🌍 🌎 🌏

var index = string.indexOf(find);
return string.replace(new RegExp(find, 'g'), function(match, offset) {
// Limit search to strings that are not a subset of other tokens.
find += '(?![a-zA-Z_$])';
Copy link
Contributor

Choose a reason for hiding this comment

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

Can the $ be removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, also realized I missed 0-9.

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess in that case, could \w be used instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep

find += '(?![a-zA-Z_$])';
find = new RegExp(find, 'g');

var index = regexIndexOf(string, find, 0);
Copy link
Contributor

Choose a reason for hiding this comment

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

Could this line just be replaced with var index = string.search(find); and regexIndexOf be removed?

@ggetz
Copy link
Contributor Author

ggetz commented Apr 30, 2018

@lilleyse updated

@lilleyse
Copy link
Contributor

Thanks!

@lilleyse lilleyse merged commit da683c2 into master Apr 30, 2018
@lilleyse lilleyse deleted the draco-bug-fix branch April 30, 2018 16:13
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