We're updating the issue view to help you get more done. 

this-as unexpectedly binds js/window when used within function with post-condition

Description

Adding a post-condition to any function that uses cljs.core/this-as will unexpectedly cause this-as's "this" symbol to be bound to the root object (e.g., js/window) instead.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 (defn f-no-post-condition [argument] (this-as this (js/console.log argument this))) (defn f-with-post-condition [argument] {:post [true]} (this-as this (js/console.log argument this))) (def test-object #js {:methodNoPostcondition f-no-post-condition :methodWithPostcondition f-with-post-condition}) (f-with-post-condition "A") ; Correctly prints js/window (.methodNoPostcondition test-object "B") ; Correctly prints test-object (.methodWithPostcondition test-object "C") ; Incorrectly prints js/window

Environment

None

Status

Assignee

Unassigned

Reporter

import

Labels

None

Approval

None

Patch

None

Priority

Minor