-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Draco fix for #6523 #6525
Conversation
@ggetz, thanks for the pull request! Maintainers, we have a signed CLA from @ggetz, so you can review this at any time.
I am a bot who helps you make Cesium awesome! Contributions to my configuration are welcome. 🌍 🌎 🌏 |
Source/Scene/ModelUtility.js
Outdated
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_$])'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can the $
be removed?
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep
Source/Scene/ModelUtility.js
Outdated
find += '(?![a-zA-Z_$])'; | ||
find = new RegExp(find, 'g'); | ||
|
||
var index = regexIndexOf(string, find, 0); |
There was a problem hiding this comment.
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?
@lilleyse updated |
Thanks! |
Fixes #6523
replaceAllButFirstInString
was replacing the variable name everywhere, even in subsets of other variables, (ex.a_position
was replaced in botha_position
anda_position_1
).