Skip to content

Commit 53291e0

Browse files
committed
revert unintended changes
1 parent 55493dc commit 53291e0

File tree

5 files changed

+7
-9
lines changed

5 files changed

+7
-9
lines changed

jscomp/others/js_dict.res

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ external keys: t<'a> => array<key> = "Object.keys"
6060
@obj
6161
external empty: unit => t<'a> = ""
6262

63-
let unsafeDeleteKey: (t<string>, string) => unit = %raw(` function (dict,key){
63+
let unsafeDeleteKey: (. t<string>, string) => unit = %raw(` function (dict,key){
6464
delete dict[key];
6565
}
6666
`)
@@ -118,7 +118,7 @@ let map = (f, source) => {
118118
let l = Js_array2.length(keys)
119119
for i in 0 to l - 1 {
120120
let key = Js_array2.unsafe_get(keys, i)
121-
set(target, key, f(unsafeGet(source, key)))
121+
set(target, key, f(. unsafeGet(source, key)))
122122
}
123123
target
124124
}

jscomp/others/js_dict.resi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ external keys: t<'a> => array<string> = "Object.keys"
107107
external empty: unit => t<'a> = ""
108108

109109
/** Experimental internal function */
110-
let unsafeDeleteKey: (t<string>, string) => unit
110+
let unsafeDeleteKey: (. t<string>, string) => unit
111111

112112
/**
113113
Returns an array of key/value pairs in the given dictionary (ES2017).
@@ -170,4 +170,4 @@ let salePrices = Js.Dict.map(discount, prices)
170170
salePrices == Js.Dict.fromList(list{("pen", 0.90), ("book", 4.50), ("stapler", 6.30)})
171171
```
172172
*/
173-
let map: ('a => 'b, t<'a>) => t<'b>
173+
let map: ((. 'a) => 'b, t<'a>) => t<'b>

jscomp/test/js_dict_test.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ let suites = {
2626
("fromArray", _ => Eq([("x", 23), ("y", 46)], fromArray([("x", 23), ("y", 46)]) |> entries)),
2727
(
2828
"map",
29-
_ => Eq({"foo": "43", "bar": "86"} |> Obj.magic, map(i => string_of_int(i), obj())),
29+
_ => Eq({"foo": "43", "bar": "86"} |> Obj.magic, map((. i) => string_of_int(i), obj())),
3030
),
3131
}
3232
}

lib/es6/js_dict.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11

22

3-
import * as Curry from "./curry.js";
43
import * as Caml_option from "./caml_option.js";
54

65
function get(dict, k) {
@@ -69,7 +68,7 @@ function map(f, source) {
6968
var l = keys.length;
7069
for(var i = 0; i < l; ++i){
7170
var key = keys[i];
72-
target[key] = Curry._1(f, source[key]);
71+
target[key] = f(source[key]);
7372
}
7473
return target;
7574
}

lib/js/js_dict.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
'use strict';
22

3-
var Curry = require("./curry.js");
43
var Caml_option = require("./caml_option.js");
54

65
function get(dict, k) {
@@ -69,7 +68,7 @@ function map(f, source) {
6968
var l = keys.length;
7069
for(var i = 0; i < l; ++i){
7170
var key = keys[i];
72-
target[key] = Curry._1(f, source[key]);
71+
target[key] = f(source[key]);
7372
}
7473
return target;
7574
}

0 commit comments

Comments
 (0)