[SERVER-9291] V8Scope::invoke shouldn't silently ignore arguments after the 24th Created: 08/Apr/13  Updated: 14/Apr/16  Resolved: 13/Aug/15

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

Type: Bug Priority: Major - P3
Reporter: Mathias Stearn Assignee: Jonathan Reams
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-9051 v8 heap allocation failure can lead t... Closed
related to SERVER-8016 Properly allocate v8 handles on the s... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Build 7 08/10/15, Build 8 08/31/15
Participants:

 Description   

Really shouldn't have hard coded limit of 24 arguments.



 Comments   
Comment by Jonathan Reams [ 13/Aug/15 ]

I've verified that this has been resolved in the spidermonkey scripting engine:

> fn = function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z) { return z }
> args = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26]
> db.runCommand({eval: fn, args: args})
{ "retval" : 26, "ok" : 1 }

In 3.0.4, this returns an error

{
        "errmsg" : "exception: Too many arguments. Max is 24",
        "code" : 16862,
        "ok" : 0
}

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