Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-20573

Javascript syntax errors show no context

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Critical - P2 Critical - P2
    • None
    • 3.1.8
    • JavaScript
    • None
    • ALL

    Description

      Taking the following test file "test.js":

      var barf = syntax error;
      

      With Spidermonkey:

      /data/1/mongo: ./mongo --nodb jstests/replsets/test.js 
      MongoDB shell version: 3.1.9-pre-
      2015-09-23T09:23:14.379-0400 E QUERY    [thread1] SyntaxError: missing ; before statement :
       
      failed to load: jstests/replsets/test.js
      

      With V8 in 3.0:

      /data/m/30/mongo: ./mongo --nodb /data/1/mongo/jstests/replsets/test.js 
      MongoDB shell version: 3.0.4-pre-
      2015-09-23T09:23:33.112-0400 E QUERY    SyntaxError: Unexpected identifier at /data/1/mongo/jstests/replsets/test.js:2
      failed to load: /data/1/mongo/jstests/replsets/test.js
      

      This makes it really hard to edit large js test files, for obvious reasons.

      Attachments

        Activity

          People

            mira.carey@mongodb.com Mira Carey
            milkie@mongodb.com Eric Milkie
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: