File tree Expand file tree Collapse file tree 3 files changed +5
-2
lines changed Expand file tree Collapse file tree 3 files changed +5
-2
lines changed Original file line number Diff line number Diff line change 32
32
* Compiler: fix rewriter bug in share_constant (fix #1247 )
33
33
* Compiler: fix miscompilation of mutually recursive functions in loop (#1321 )
34
34
* Compiler: fix bug while minifying/renaming try-catch blocks
35
+ * Compiler: no dead code elimination for caml_js_get
35
36
* Runtime: fix ocamlyacc parse engine (#1307 )
36
37
* Runtime: fix Out_channel.is_buffered, set_buffered
37
38
* Runtime: fix format wrt alternative
Original file line number Diff line number Diff line change @@ -965,7 +965,9 @@ let _ =
965
965
966
966
register_tern_prim " caml_js_set" (fun cx cy cz _ ->
967
967
J. EBin (J. Eq , J. EAccess (cx, cy), cz));
968
- register_bin_prim " caml_js_get" `Mutable (fun cx cy _ -> J. EAccess (cx, cy));
968
+ (* [caml_js_get] can have side effect, we declare it as mutator.
969
+ see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get *)
970
+ register_bin_prim " caml_js_get" `Mutator (fun cx cy _ -> J. EAccess (cx, cy));
969
971
register_bin_prim " caml_js_delete" `Mutator (fun cx cy _ ->
970
972
J. EUn (J. Delete , J. EAccess (cx, cy)));
971
973
register_bin_prim " caml_js_equals" `Mutable (fun cx cy _ ->
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ function caml_js_pure_expr (f) { return f(); }
24
24
25
25
//Provides: caml_js_set (mutable, const, const)
26
26
function caml_js_set ( o , f , v ) { o [ f ] = v ; return 0 }
27
- //Provides: caml_js_get mutable (const, const)
27
+ //Provides: caml_js_get (const, const)
28
28
function caml_js_get ( o , f ) { return o [ f ] ; }
29
29
//Provides: caml_js_delete (mutable, const)
30
30
function caml_js_delete ( o , f ) { delete o [ f ] ; return 0 }
You can’t perform that action at this time.
0 commit comments