function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Srinivasa SomuSrinivasa Somu 

Lightning Component > JavaScript Helper/Controller --> Set javaScript Collection is not working from summer'16

Hi,

Set collection (I guess all the Collections) in lightning component's javaScript Helper/Controller is not working from Summer'16, It is throwing the following error -
TypeError: Set is not a Constructor (or)
TypeError: Set is not a Function.
Sample Code:
var s = new Set();

Note:
1. Before Summer'16 upgrade it was working.
2. I have included the above sample code in the javaScript of the Visualforce, It is working. Only the Lightning Component is causing the issue.

Please help me with a work around or let me know if you have any suggestions.

Thanks,
Srinivas
Best Answer chosen by Srinivasa Somu
Srinivasa SomuSrinivasa Somu
Hi,

We have submitted a case with Salesforce. They suggested to to turn off Enable Lightning LockerService Security in Critical Updates.
Problem is resolved.

Thanks,
Srinivas

All Answers

Amit VaidyaAmit Vaidya
Hi Srinivasa,

Yes, it not supporting me as well. We can use var s = new Array(); or var s = [];

Thanks,
Amit
Srinivasa SomuSrinivasa Somu
Hi Amit,

Thanks for the reply.

We don't want to allow duplicates, we need to verify wether a value present in set or not, out of thousands of entries in collection.

We have to loop through and verify for each and every value we are going to add if we use array.

Looking for working around alternative to the Set.

Thanks,
Srinivas
Srinivasa SomuSrinivasa Somu
Hi,

We have submitted a case with Salesforce. They suggested to to turn off Enable Lightning LockerService Security in Critical Updates.
Problem is resolved.

Thanks,
Srinivas
This was selected as the best answer
Amit VaidyaAmit Vaidya
Hi Srinivas,

Nice to know about this.