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

stop setting 'args' in invoke

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.5.0
    • Affects Version/s: None
    • Component/s: JavaScript
    • Labels:
      None

      Do we still need to set this (in engine_v8.cpp):
      setObject( "args", *argsObject, readOnlyArgs); // for backwards compatibility

      Dont think this variable is documented anywhere.
      Was observed to slow down execution over many invoke (e.g. MR) and also reported by 2 more people to be slow and potentially leak memory.

      Right now seems like it's used in only 1 test:
      jstests/js7.js:assert.eq( 17 , db.eval( function()

      { return args[0]; }

      , 17 ) );

      Instead the automatice variable 'arguments' can be used.

            Assignee:
            mathias@mongodb.com Mathias Stearn
            Reporter:
            antoine Antoine Girbal
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: