implement Immutable OrderedMap

This commit is contained in:
Erik Krogh Kristensen
2021-02-04 11:02:50 +01:00
parent 2e7bf9b53c
commit 609b16b1f7
3 changed files with 8 additions and 3 deletions

View File

@@ -1,7 +1,7 @@
var obj = { a: source("a"), b: source("b1") };
sink(obj["a"]); // NOT OK
const { Map, fromJS, List } = require('immutable');
const { Map, fromJS, List, OrderedMap } = require('immutable');
const map1 = Map(obj);
@@ -31,3 +31,7 @@ List(["safe"]).map(x => source()).forEach(x => sink(x)); // NOT OK
List([source()]).map(x => x).filter(x => true).toList().forEach(x => sink(x)); // NOT OK
List(["safe"]).push(source()).forEach(x => sink(x)); // NOT OK
const map4 = OrderedMap({}).set("f", source());
sink(map4.get("f")); // NOT OK

View File

@@ -10,3 +10,4 @@
| immutable.js:29:25:29:32 | source() | immutable.js:29:53:29:53 | x |
| immutable.js:31:7:31:14 | source() | immutable.js:31:75:31:75 | x |
| immutable.js:33:21:33:28 | source() | immutable.js:33:49:33:49 | x |
| immutable.js:36:38:36:45 | source() | immutable.js:37:6:37:18 | map4.get("f") |