question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

LoadingManager.getHandler does not work half the time if a regex with g flag is passed

See original GitHub issue

If adding a handler with a regex that has the g flag, the regex.test in getHandler will return null every other time. I think string.match should be used rather than regex.test to avoid any side effect like this

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Mugen87commented, Nov 14, 2019

@makc Using lastIndex seems like an appropriate solution 👍

1reaction
donmccurdycommented, Nov 13, 2019

Could you share an example to reproduce this issue?

Read more comments on GitHub >

github_iconTop Results From Across the Web

LoadingManager – three.js docs
LoadingManager. Handles and keeps track of loaded and pending data. A default global instance of this class is created and used by loaders...
Read more >
What is the meaning of the 'g' flag in regular expressions?
The "g" flag indicates that the regular expression should be tested against all possible matches in a string. Without the g flag, ...
Read more >
Regular Expressions :: Eloquent JavaScript
Regular expression objects have a number of methods. The simplest one is test . If you pass it a string, it will return...
Read more >
Diff - 49e3b372ab288992a4705dfe7f37fbd732d06aed^^1^2 ...
-244,12 +244,12 @@ * on {@link ListFragment} for most of its work. ... //Do it a bit earlier than half the lease duration...
Read more >
Sets and ranges [...] - The Modern JavaScript Tutorial
The regular expression engine thinks that [XY] – are not two, but four characters: left half of X (1) ,; right half of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found