askql icon indicating copy to clipboard operation
askql copied to clipboard

Throw a runtime error if any of the environment Values is a function

Open czerwinskilukasz1 opened this issue 4 years ago • 3 comments

Here is my environment:

export const values: Values = {
  hello: 'Hi, this is your Ask server',
  helloD: () => "Hello, this is AskQL server! It's " + new Date().toString()
}

While

ask {
  hello
}

returns correctly "Hi, this is your Ask server",

both

ask {
  helloD
}

and

ask {
  helloD()
}

return null.

Expected: helloD should return a function object, while helloD() should return a string.

image

image

czerwinskilukasz1 avatar Jun 11 '20 16:06 czerwinskilukasz1

I suggest disallowing proving functions in values - we have resources for this kind of thing. Let's make this issue about throwing a runtime error if someone tries to add a function as value. Thoughts?

mhagmajer avatar Jun 11 '20 16:06 mhagmajer

Hey @mhagmajer and @czerwinskilukasz1, how are you? I'm a first timer open source contributor and I would like to know more about this issue. Can you help me about this? Thank you!

rodolfoviolla avatar Oct 05 '20 21:10 rodolfoviolla

Hey @mhagmajer and @czerwinskilukasz1, how are you? I'm a first timer open source contributor and I would like to know more about this issue. Can you help me about this? Thank you!

Hi @rodolfoviolla . How are you? Would love to help you with that. Are you still interested in this issue?

YonatanKra avatar Oct 27 '20 19:10 YonatanKra