Skip to content
This repository has been archived by the owner on Aug 4, 2021. It is now read-only.

replaced re.test with str.search #5

Merged
merged 1 commit into from
Jan 7, 2016
Merged

Conversation

yrns
Copy link
Contributor

@yrns yrns commented Jan 6, 2016

I think this fixes #4. re.test maintains state from previous searches, so it starts reporting false negatives if the injection appears in multiple files.

@Rich-Harris Rich-Harris merged commit 4c59f8b into rollup:master Jan 7, 2016
@Rich-Harris
Copy link
Contributor

This is a revelation! How did I not know about String.prototype.search? The hoops I've jumped through...

Not only that, but this PR exposed a separate bug, whereby a module would import itself (e.g. an Object.assign polyfill that refers to Object.assign) – because of that maintained state, the test was erroneously passing.

Many thanks. Released as 1.4.0

@yrns
Copy link
Contributor Author

yrns commented Jan 7, 2016

I saw the test was failing but I hadn't a clue. Figured you'd sort it out. 🤘

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants