Unblanced "{}" in javascript studio functions break all javascript studio functions and doesn't display any error messages in studio

Open
#281 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
javascript
Domain
frontend

Research direction

Reproduce the failure through the /function/nkf/_Test5/Hello/World/ endpoint using the example function and compare the reported line 180 with the actual function at lines 183–185. Trace how the Studio surfaces Error executing function xy; done means malformed JavaScript produces a useful error in Studio and valid functions execute normally.

Written by the indexing model from the issue text.

Description

This was replicated in orientdb 2.0.8, 2.0.9 and 2.0.10.
None of my javascript functions are working. The only message is: Error executing function xy

I figured out what was happening using curl:

$ curl -X GET -u "admin:admin" http://localhost:2480/function/nkf/_Test5/Hello/World/

ScriptManager: error sun.org.mozilla.javascript.internal.EvaluatorException: invalid return (<Unknown source>#180) in <Unknown source> at line number 180.
Function getChildren(cLinks):

 175:                }
 176: }
 177:     }
 178: 
 179: // return asTree(result);
 180: >>> return cn ;
 181: }
 182: 
 183: function _Test5(p1,p2) {
 184: return p1 + p2;
 185: }

The actual function is shown at line 183 - 185.

Dominant language
HTML
Stars
128
Forks
51
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from orientechnologies/orientdb-studio

All issues in orientechnologies/orientdb-studio

Similar issues

More Web Dev issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.