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

Prevent code execution in Directives ctor's #135

Closed
wants to merge 7 commits into from

Conversation

aveXcaesar
Copy link
Contributor

Please check if the PR fulfills these requirements

  • I made sure that my code builds
  • I merged the master into this branch before pushing
  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

What kind of change does this PR introduce?** (check one with "x")

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

What is the current behavior? (You can also link to an open issue here)

close #133

What is the new behavior?

  • No code execution in Directives() ctor's

Does this PR introduce a breaking change? (check one with "x")

  • Yes
  • No

If this PR contains a breaking change, please describe the impact and migration path for existing applications

Other information

@aveXcaesar aveXcaesar requested a review from koeeenig September 27, 2018 11:52
@Meerownymous Meerownymous self-assigned this Dec 28, 2018
src/Yaapii.Xambly/Directive/Directives.cs Outdated Show resolved Hide resolved
src/Yaapii.Xambly/Directive/Directives.cs Outdated Show resolved Hide resolved
@aveXcaesar
Copy link
Contributor Author

@Meerownymous
changes done

public Directives(String text) : this(Directives.Parse(text))
/// <param name="xambly">Xambly script</param>
public Directives(IText xambly) : this(
new StickyScalar<ICollection<IDirective>>(() =>
Copy link
Contributor

Choose a reason for hiding this comment

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

should be a Solid to ensure threadsafeness.

/// <param name="items">list to instantiate from</param>
public ThreadsafeCollection(IEnumerable<T> items)
{
if (items == null)
Copy link
Contributor

Choose a reason for hiding this comment

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

code execution in ctor

/// <param name="items">list to instantiate from</param>
public ThreadsafeCollection(IEnumerable<T> items)
{
if (items == null)
Copy link
Contributor

Choose a reason for hiding this comment

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

ctor should be placed in a lock statement

@Meerownymous
Copy link
Contributor

Closed due to inactivity.

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.

Code execution in Directives() ctor
2 participants