Skip to content

Commit

Permalink
drop ^:dynamic - AFAICT it is not needed
Browse files Browse the repository at this point in the history
This leads to better codegen.
  • Loading branch information
darwin committed Mar 5, 2022
1 parent 3ffc8b7 commit cce2e47
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions src/lib/oops/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@

; -- diagnostics reporting --------------------------------------------------------------------------------------------------

(defn ^:dynamic report-error-dynamically [msg data]
(defn report-error-dynamically [msg data]
(runtime/report-error-dynamically msg data))

(defn ^:dynamic report-warning-dynamically [msg data]
(defn report-warning-dynamically [msg data]
(runtime/report-warning-dynamically msg data))

(defn ^:dynamic report-if-needed-dynamically [msg-id & [info]]
(defn report-if-needed-dynamically [msg-id & [info]]
(runtime/report-if-needed-dynamically msg-id info))

; -- runtime support for macros ---------------------------------------------------------------------------------------------
Expand All @@ -51,7 +51,7 @@
(defn ^boolean validate-fn-call-dynamically [fn mode]
(runtime/validate-fn-call-dynamically fn mode))

(defn ^:dynamic punch-key-dynamically! [obj key]
(defn punch-key-dynamically! [obj key]
(runtime/punch-key-dynamically obj key))

(defn build-path-dynamically [selector]
Expand Down
4 changes: 2 additions & 2 deletions test/transcripts/expected/oset_static_core.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

var target_obj_1 = window,
next_obj_1 = target_obj_1.k1;
(null == next_obj_1 ? oops.core.punch_key_dynamically_BANG_.cljs.core.IFn$_invoke$arity$4$ ? oops.core.punch_key_dynamically_BANG_.cljs.core.IFn$_invoke$arity$4$(target_obj_1, "k1") : oops.core.punch_key_dynamically_BANG_.call(null, target_obj_1, "k1") : next_obj_1).k2 = "val";
(null == next_obj_1 ? oops.core.punch_key_dynamically_BANG_(target_obj_1) : next_obj_1).k2 = "val";

// SNIPPET #2:
// (testing "oset! expansion with macro-generated params should be static"
Expand All @@ -29,7 +29,7 @@ var target_obj_1 = window,

var target_obj_2 = window,
next_obj_2 = target_obj_2.k1;
(null == next_obj_2 ? oops.core.punch_key_dynamically_BANG_.cljs.core.IFn$_invoke$arity$4$ ? oops.core.punch_key_dynamically_BANG_.cljs.core.IFn$_invoke$arity$4$(target_obj_2, "k1") : oops.core.punch_key_dynamically_BANG_.call(null, target_obj_2, "k1") : next_obj_2).k2 = "val";
(null == next_obj_2 ? oops.core.punch_key_dynamically_BANG_(target_obj_2) : next_obj_2).k2 = "val";

// SNIPPET #3:
// (testing "static oset! expansion without punching"
Expand Down
8 changes: 4 additions & 4 deletions test/transcripts/expected/oset_static_goog.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

var target_obj_1 = window,
next_obj_1 = module$contents$goog.object_get.call(null, target_obj_1, "k1");
(null == next_obj_1 ? oops.core.punch_key_dynamically_BANG_.cljs.core$IFn$_invoke$arity$4$ ? oops.core.punch_key_dynamically_BANG_.cljs.core.IFn$_invoke$arity$4$(target_obj_1, "k1") : oops.core.punch_key_dynamically_BANG_.call(null, target_obj_1, "k1") : next_obj_1).k2 = "val";
next_obj_1 = module$contents$goog$object_get.call(null, target_obj_1, "k1");
(null == next_obj_1 ? oops.core.punch_key_dynamically_BANG_(target_obj_1) : next_obj_1).k2 = "val";

// SNIPPET #2:
// (testing "oset! expansion with macro-generated params should be static"
// (oset! js/window (macro-identity "!k1.!k2") "val"))
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

var target_obj_2 = window,
next_obj_2 = module$contents$goog.object_get.call(null, target_obj_2, "k1");
(null == next_obj_2 ? oops.core.punch_key_dynamically_BANG_.cljs.core$IFn$_invoke$arity$4$ ? oops.core.punch_key_dynamically_BANG_.cljs.core.IFn$_invoke$arity$4$(target_obj_2, "k1") : oops.core.punch_key_dynamically_BANG_.call(null, target_obj_2, "k1") : next_obj_2).k2 = "val";
next_obj_2 = module$contents$goog$object_get.call(null, target_obj_2, "k1");
(null == next_obj_2 ? oops.core.punch_key_dynamically_BANG_(target_obj_2) : next_obj_2).k2 = "val";

// SNIPPET #3:
// (testing "static oset! expansion without punching"
Expand Down

0 comments on commit cce2e47

Please sign in to comment.