Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-49862

[UDF] cannot use // comment style in JS udf

    XMLWordPrintable

Details

    • Bug
    • Resolution: Not a Bug
    • Major
    • 7.1.0
    • 7.1.0
    • js-evaluator
    • 7.1.0-1801
    • Untriaged
    • 1
    • Unknown

    Description

      Cannot have // comment in JS

      # cat pi.js 
      function pi() {
        // some comment
        return 3.1415926;
      } 

      # curl -s -k -X POST http://172.23.104.91:8093/evaluator/v1/libraries/use_cases -u Administrator:password -H 'content-type: application/json' -d@pi.js
      Error while compiling library. Cause:
      compilation failed:
      Exception: SyntaxError: Unexpected end of input
      Location: functions/use_cases.js:1 
      Code: function pi() {  // some comment  return 3.1415926;}
      SyntaxError: Unexpected end of input
       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            pierre.regazzoni Pierre Regazzoni
            pierre.regazzoni Pierre Regazzoni
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty