Skip to content

Commit 6a81ccb

Browse files
mununkicristianoc
authored andcommitted
jsx addKeyProp
1 parent 08c1ca9 commit 6a81ccb

9 files changed

+61
-35
lines changed

jscomp/main/builtin_cmi_datasets.ml

+5-5
Large diffs are not rendered by default.

jscomp/main/builtin_cmj_datasets.ml

+3-3
Large diffs are not rendered by default.

jscomp/others/jsx.ml

+4
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,7 @@ type 'props component = ('props, element) componentLike
3737
(* this function exists to prepare for making `component` abstract *)
3838
external component : ('props, element) componentLike -> 'props component
3939
= "%identity"
40+
41+
let addKeyProp (o : 't) k =
42+
Obj.magic (Js.Obj.assign (Obj.magic o) [%obj { key = k }])
43+
[@@inline]

jscomp/others/release.ninja

+1-1
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 $bsc
66+
o others/jsx.cmi others/jsx.cmj : cc others/jsx.ml | others/belt_internals.cmi others/js.cmi others/js.cmj $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

+8-8
Large diffs are not rendered by default.

lib/4.06.1/unstable/js_playground_compiler.ml

+8-8
Large diffs are not rendered by default.

lib/4.06.1/whole_compiler.ml

+8-8
Large diffs are not rendered by default.

lib/es6/jsx.js

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

lib/js/jsx.js

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

0 commit comments

Comments
 (0)