You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Sameer Charles (JIRA)" <ji...@apache.org> on 2013/12/05 05:55:36 UTC

[jira] [Commented] (SLING-3241) RhinoJavaScriptEngine.eval() does not unwrap NativeObject returned

    [ https://issues.apache.org/jira/browse/SLING-3241?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13839809#comment-13839809 ] 

Sameer Charles commented on SLING-3241:
---------------------------------------

unwrap might work if the resultant object is Scriptable, but seems like its always a NativeObject.

Is it possible to reuse the ScriptValueConvertor#unwrapValue [1] from the springframework project? we would have to do the same thing.
Or do you think it should be the responsibility of the client application to unwrap js native objects.

[1] https://src.springframework.org/svn/se-surf/trunk/spring-webscripts/spring-webscripts/src/main/java/org/springframework/extensions/webscripts/ScriptValueConverter.java

> RhinoJavaScriptEngine.eval() does not unwrap NativeObject returned
> ------------------------------------------------------------------
>
>                 Key: SLING-3241
>                 URL: https://issues.apache.org/jira/browse/SLING-3241
>             Project: Sling
>          Issue Type: Bug
>          Components: Scripting
>    Affects Versions: Scripting JavaScript 2.0.12
>         Environment: All
>            Reporter: Sameer Charles
>            Assignee: Felix Meschberger
>             Fix For: Scripting JavaScript 2.0.14
>
>
> org.apache.sling.scripting.javascript.internal.RhinoJavaScriptEngine#eval returns a org.mozilla.javascript.Scriptable object. Ideally resultant object should be unwrapped.



--
This message was sent by Atlassian JIRA
(v6.1#6144)