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)
commit58640c553bdf7e4d373fde7d4a1a8282a0895832 authorevancz <info@elm-lang.org> dateMon 1 Apr 2013, 00:36 (14 years ago) parent7d1b40a
1 file changed+3−1
libraries/Native/List.js+3−1
libraries/Native/List.js+3−1
@@ -3,6 +3,7 @@ Elm.Native.List = function(elm) {
33
44 elm.Native = elm.Native || {};
55 if (elm.Native.List) return elm.Native.List;
6+ if ('values' in Elm.Native.List) return elm.Native.List = Elm.Native.List.values
67
78 var Utils = Elm.Native.Utils(elm);
89
@@ -280,7 +281,7 @@ Elm.Native.List = function(elm) {
280281 return out;
281282 }
282283
283− return elm.Native.List = {
284+ Elm.Native.List.values = {
284285 Nil:Nil,
285286 Cons:Cons,
286287 toArray:toArray,
@@ -317,5 +318,6 @@ Elm.Native.List = function(elm) {
317318 join:F2(join),
318319 split:F2(split)
319320 };
321+ return elm.Native.List = Elm.Native.List.values;
320322
321323};