[Jelly] Configure rendering in "non-permissive" mode: crash if referencing undefined things?

11 views
Skip to first unread message

Baptiste Mathus

unread,
Oct 27, 2015, 12:25:18 PM10/27/15
to jenkin...@googlegroups.com
Hi,

Currently, in my .jelly files, if I use something like ${it.getSomething(someparam)} but the method getSomething() is actually undefined on the it object, no error is generated.

Some questions:
  • is this expected? (I mean, calling something absent and that being just ignored)
  • is there a way to enable an aggressive mode, at least for example in dev mode, that would just throw a stack trace in my face?

Thanks a lot for any hint.

--
Baptiste

Jesse Glick

unread,
Oct 27, 2015, 6:01:15 PM10/27/15
to Jenkins Dev
On Tue, Oct 27, 2015 at 12:24 PM, Baptiste Mathus <m...@batmat.net> wrote:
> is this expected? (I mean, calling something absent and that being just
> ignored)

Yes.

> is there a way to enable an aggressive mode, at least for example in dev
> mode, that would just throw a stack trace in my face?

No.

JEXL and Jelly were just poor choices for a rendering engine in a big,
modular application. You can use Groovy views, which will report some
errors of this kind, though Groovy is a sufficiently complex and
dynamic language that it will let almost anything past the compiler,
and a lot of weird stuff past the runtime too.

I filed https://issues.jenkins-ci.org/browse/JENKINS-31203 to track
some ideas I have been mulling over.

Baptiste Mathus

unread,
Oct 28, 2015, 12:15:49 PM10/28/15
to jenkin...@googlegroups.com
Thanks a lot for the definitive answer Jesse. I'm watching the issue.

In the meantime I've indeed switched to Groovy views for at least better detection of refactored names.

Cheers


--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr2vZdOVgPb8OuYRrFQDj9JYsLd6aQG5cJOax9dxxPCCmA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.



--
Baptiste <Batmat> MATHUS - http://batmat.net
Sauvez un arbre,
Mangez un castor !
Reply all
Reply to author
Forward
0 new messages