TypeError: I could use some explanation

Kasmeroglu, Daniel daniel.kasmeroglu at aperto.com
Wed Dec 16 14:01:27 UTC 2015

Hi there,

First of all: thanks for the great work with Nashorn.
Unfortunately I'm currently a little bit stuck as I don't get what I'm
doing wrong here.
Here's a simple code snippet that explains what I'm doing:

ScriptEngine engine = ...
Map<String, Object> context = ...
engine.put("t4_context", context);

The variable 't4' is a compiled template generated through Handlebars
(so it's a function taking a hash).
Unfortunately I don't get it running as there's the following complain:

Caused by: <function>:30 TypeError: {assets=dodo} is not an Object

It's clear to me that the issue is caused since the java object
'context' isn't an instance of 'ScriptObject'. However it isn't clear to
me why this happens. 

It would be nice to give me a hint of what I'm doing wrong or to point
me to some helpful documentation.

Thanks in advance.

Dipl.-Inform. Daniel Kasmeroglu, Java Developer Advanced

Email daniel.kasmeroglu at aperto.de
Phone +49 30 283921-381
Fax +49 30 283921-29

Aperto AG - In der Pianofabrik
Chausseestraße 5, D-10115 Berlin-Mitte

HRB 77049, AG Berlin Charlottenburg
Vorstand: Dirk Buddensiek (Vorsitzender), Kai Großmann, Stephan Haagen,
Daniel Simon
Aufsichtsrat: Bernd Hardes (Vorsitzender)

More information about the nashorn-dev mailing list