on master help sign in
Make sure that List only gets instantiated once. Requires that the list library is pure (never touches the `elm` variable)
58640c5evancz
libraries/Native/List.js+3−1
@@ -3,6 +3,7 @@ Elm.Native.List = function(elm) {
3
3
4 elm.Native = elm.Native || {};
4 elm.Native = elm.Native || {};
5 if (elm.Native.List) return elm.Native.List;
5 if (elm.Native.List) return elm.Native.List;
6+ if ('values' in Elm.Native.List) return elm.Native.List = Elm.Native.List.values
6
7
7 var Utils = Elm.Native.Utils(elm);
8 var Utils = Elm.Native.Utils(elm);
8
9
@@ -280,7 +281,7 @@ Elm.Native.List = function(elm) {
280 return out;
281 return out;
281 }
282 }
282
283
283− return elm.Native.List = {
284+ Elm.Native.List.values = {
284 Nil:Nil,
285 Nil:Nil,
285 Cons:Cons,
286 Cons:Cons,
286 toArray:toArray,
287 toArray:toArray,
@@ -317,5 +318,6 @@ Elm.Native.List = function(elm) {
317 join:F2(join),
318 join:F2(join),
318 split:F2(split)
319 split:F2(split)
319 };
320 };
321+ return elm.Native.List = Elm.Native.List.values;
320
322
321};
323};