stylus icon indicating copy to clipboard operation
stylus copied to clipboard

avoid infinite loop in add-property

Open dlants opened this issue 1 year ago • 3 comments

What / Why:

https://github.com/stylus/stylus/issues/2771

How:

I suspect the infinite loop may be happening due to the local definition for add-property overshadowing the js definition, thereby creating an infinite loop. There seems to be a race condition for when that overshadowing happens, which occasionally allows the tests to pass.

Checklist:

  • [ ] Documentation
  • [ ] Unit Tests
  • [ ] Code complete
  • [ ] Changelog

dlants avatar Mar 07 '23 00:03 dlants

Deploy Preview for stylus-docs canceled.

Name Link
Latest commit 203ad7c1a0072b56588f097565531f430fdb8044
Latest deploy log https://app.netlify.com/sites/stylus-docs/deploys/64067f62e2a8b10007462290

netlify[bot] avatar Mar 07 '23 00:03 netlify[bot]

Hey, can you add unit test for this PR ? Thanks

iChenLei avatar Mar 07 '23 02:03 iChenLei

Hey, can you add unit test for this PR ? Thanks

Hm. I'm not sure if I can. It seems to me that there's a race condition, which causes this error in certain situations (as specified in #2771 ).

From my testing with my project's build tooling, the fix in this PR does seem to resolve the issue.

However, I'm not sure how to trigger it in a unit test. It seems like there are already unit tests for add-property ( test/cases/bifs.add-property.styl ), and those didn't catch this issue. Any suggestions?

dlants avatar Mar 07 '23 17:03 dlants