Skip to content

Commit 836e5ae

Browse files
mununkicristianoc
authored andcommitted
change Jsx.addKeyProp to external binding
1 parent b367be5 commit 836e5ae

File tree

9 files changed

+37
-62
lines changed

9 files changed

+37
-62
lines changed

jscomp/main/builtin_cmi_datasets.ml

Lines changed: 5 additions & 5 deletions
Large diffs are not rendered by default.

jscomp/main/builtin_cmj_datasets.ml

Lines changed: 3 additions & 3 deletions
Large diffs are not rendered by default.

jscomp/others/jsx.ml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,5 @@ type 'props component = ('props, element) componentLike
3838
external component : ('props, element) componentLike -> 'props component
3939
= "%identity"
4040

41-
let addKeyProp (p : 'props) (k : string) : 'props =
42-
(* Use Js_obj.assign, not Js.Obj.assign, otherwise the dependency will not be picked up correctly
43-
in the ninja file. *)
44-
Obj.magic (Js_obj.assign (Obj.magic p) [%obj { key = k }])
45-
[@@inline]
41+
external addKeyProp : 'props -> string -> 'props = "Object.assign"
42+
[@@inline] [@@bs.val]

jscomp/others/release.ninja

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ o others/js_vector.cmj : cc_cmi others/js_vector.ml | others/belt_internals.cmi
6363
o others/js_vector.cmi : cc others/js_vector.mli | others/belt_internals.cmi others/js.cmi $bsc
6464
o others/js_weakmap.cmi others/js_weakmap.cmj : cc others/js_weakmap.ml | others/belt_internals.cmi others/js.cmi $bsc
6565
o others/js_weakset.cmi others/js_weakset.cmj : cc others/js_weakset.ml | others/belt_internals.cmi others/js.cmi $bsc
66-
o others/jsx.cmi others/jsx.cmj : cc others/jsx.ml | others/belt_internals.cmi others/js.cmi others/js_obj.cmj $bsc
66+
o others/jsx.cmi others/jsx.cmj : cc others/jsx.ml | others/belt_internals.cmi others/js.cmi $bsc
6767
o others/jsxDOM.cmi others/jsxDOM.cmj : cc others/jsxDOM.ml | others/belt_internals.cmi others/js.cmi others/jsx.cmj others/jsxDOMStyle.cmj others/jsxEvent.cmj $bsc
6868
o others/jsxDOMStyle.cmi others/jsxDOMStyle.cmj : cc others/jsxDOMStyle.ml | others/belt_internals.cmi others/js.cmi $bsc
6969
o others/jsxEvent.cmi others/jsxEvent.cmj : cc others/jsxEvent.ml | others/belt_internals.cmi others/js.cmi $bsc

lib/4.06.1/unstable/js_compiler.ml

Lines changed: 8 additions & 8 deletions
Large diffs are not rendered by default.

lib/4.06.1/unstable/js_playground_compiler.ml

Lines changed: 8 additions & 8 deletions
Large diffs are not rendered by default.

lib/4.06.1/whole_compiler.ml

Lines changed: 8 additions & 8 deletions
Large diffs are not rendered by default.

lib/es6/jsx.js

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1 @@
1-
2-
3-
4-
function addKeyProp(p, k) {
5-
return Object.assign(p, {
6-
key: k
7-
});
8-
}
9-
10-
export {
11-
addKeyProp ,
12-
}
13-
/* No side effect */
1+
/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */

lib/js/jsx.js

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1 @@
1-
'use strict';
2-
3-
4-
function addKeyProp(p, k) {
5-
return Object.assign(p, {
6-
key: k
7-
});
8-
}
9-
10-
exports.addKeyProp = addKeyProp;
11-
/* No side effect */
1+
/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */

0 commit comments

Comments
 (0)