mfikes / ambly

ClojureScript REPL into embedded JavaScriptCore
http://ambly.fikesfarm.com
Eclipse Public License 1.0
541 stars 21 forks source link

Double bootstrapping can mess with core protocol definitions #54

Closed mfikes closed 9 years ago

mfikes commented 9 years ago

Take Shrimp, for example, which now involves invoking a copy of the bootstrap code that was originally in the Clojure REPL side, during the Objective-C startup.

If you then connect Ambly to Shrimp, and tap on one of the listed shrimp in the master view, when it attempts to display the details view, you will see the following in the Xcode log:

2015-03-01 20:46:47.017 Shrimp[29680:1386920] [file:///cljs/core.js:3015:53] Error: No protocol method IReset.-reset! defined for type cljs.core/Atom: [object Object]
missing_protocol@file:///cljs/core.js:168:18
file:///cljs/core.js:3015:33
_reset_BANG_@file:///cljs/core.js:3018:3
reset_BANG_@file:///cljs/core.js:15141:30
goby$core$TableViewDelegate$did_select_row_at_index_path$arity$3@file:///shrimp/master_view_controller.js:119:34
did_select_row_at_index_path@file:///goby/core.js:1043:78
2015-03-01 20:46:47.031 Shrimp[29680:1386920] [file:///cljs/core.js:3015:53] Error: No protocol method IReset.-reset! defined for type cljs.core/Atom: [object Object]
missing_protocol@file:///cljs/core.js:168:18
file:///cljs/core.js:3015:33
_reset_BANG_@file:///cljs/core.js:3018:3
reset_BANG_@file:///cljs/core.js:15141:30
view_did_load_BANG_@file:///shrimp/detail_view_controller.js:15:27

Empirically I can see that if I remove all of the code in -setup between the call to start-reading-messages and the :merge-opts return, then things behave much better, without the above occurring.