[SERVER-4654] stop setting 'args' in invoke Created: 10/Jan/12  Updated: 11/Jul/16  Resolved: 25/Apr/13

Status: Closed
Project: Core Server
Component/s: JavaScript
Affects Version/s: None
Fix Version/s: 2.5.0

Type: Improvement Priority: Major - P3
Reporter: Antoine Girbal Assignee: Mathias Stearn
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Description   

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.


Generated at Thu Feb 08 03:06:36 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.