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

conditionals shouldnt use eval by default #5

Open
cressie176 opened this issue Jun 23, 2015 · 1 comment
Open

conditionals shouldnt use eval by default #5

cressie176 opened this issue Jun 23, 2015 · 1 comment
Assignees
Labels

Comments

@cressie176
Copy link

{
  condition: '@some.property',
  task: 'foo'
}

throws an exception because the condition is evaluated rather than looked up from the interpolated. This is counter intuitive as most other task attributes are interpolated.

Howabout...

  1. when condition is a function, execute it, passing the context as the first argument. Only support synchronous functions
  2. when the condition is a string starting with @ interpolate it
  3. when the condition is an object support an eval option, e.g.
{
  condition: {
    eval: 'Date.now() > 1435048419884'
  },
  task: 'foo'
}
@PeterAronZentai
Copy link

What should it do with...

  1. condition is an object but not eval
    -> if(object) would always be true...
  2. none of the above
    -> simple if(condition)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants