-
Notifications
You must be signed in to change notification settings - Fork 973
support new Set(...) in ledger publisher ruleset #3545
Conversation
this accommodates the new longer exclusion list
if (op1.name !== 'Set') throw new Error('only new Set(...) is allowed, not new ' + op1.name) | ||
args = [] | ||
expr['arguments'].forEach((argument) => { args.push(traverse(argument)) }) | ||
return new Set(args[0]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't you want return new Set(...args)
for full generality? No point collecting the traversed arguments in args past the first one if you use only the first one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Set
takes at most one argument, which is an array. if i were to pass args
instead of args[0]
, then i would need to do use .apply()
as well. i will make it clearer.
Is there an issue defined for this? |
If not, please post an issue, mark 0.11.6 on the issue and then update the PR. The PR can be updated with:
|
i will create an issue. |
this accommodates the new longer exclusion list, cf., #3553
auditor: @BrendanEich