Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump espruino version #30

Merged
merged 3 commits into from
Aug 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified resources/espruino_esp32.bin
Binary file not shown.
4 changes: 0 additions & 4 deletions src/esprit/make_rom.clj
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,8 @@
[clojure.java.io :as io]
[clojure.string :as string]))

(def argument-global "arguments2462148dcdc") ; Random so we don't get a name collision https://xkcd.com/221/

(defn -main []
(let [main-js (-> (slurp "out/main.js")
(string/replace "arguments" (str "[" argument-global "=arguments," argument-global "][1]"))
(string/replace "/[\\\\\"\\b\\f\\n\\r\\t]/g" "/[\\\\\"\\f\\n\\r\\t]/g")
(string/replace "goog.NONCE_PATTERN_=/^[\\w+/_-]+[=]{0,2}$/" "goog.NONCE_PATTERN_=null")
(string/replace "/^((https:)?\\/\\/[0-9a-z.:[\\]-]+\\/|\\/[^/\\\\]|[^:/\\\\%]+\\/|[^:/\\\\%]*[?#]|about:blank#)/i" "null")
(string/replace "/^(?:(?:https?|mailto|ftp):|[^:/?#]*(?:[/?#]|$))/i" "null")
Expand Down
13 changes: 2 additions & 11 deletions src/esprit/repl.clj
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
(javax.jmdns JmDNS ServiceListener)
(java.net URI)))

(def argument-global "arguments2462148dcdc") ; Random so we don't get a name collision

(defn set-logging-level [logger-name level]
"Sets the logging level for a logger to a level."
{:pre [(string? logger-name) (instance? java.util.logging.Level level)]}
Expand Down Expand Up @@ -141,19 +139,12 @@
[js]
(str "(function (){try{return " (subs js 4 (dec (count js))) "}})()"))

(defn str-replace-js
"Performs str replacements to fix various espruino bugs we find"
[js]
(-> js
(str/replace "arguments" (str "[" argument-global "=arguments," argument-global "][1]"))))

(defn process
"Process outgoing JS to make compatible with Espruino"
[js]
(if (str/starts-with? js "try{cljs.core.pr_str.call")
(do
(str-replace-js (fn-ify js)))
(str-replace-js js)))
(fn-ify js)
js))

(defn write
[out js]
Expand Down
1 change: 0 additions & 1 deletion src/esprit/repl.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
(ind/indicate-print))

(defn eval-data [data]
(println data)
(try
(ind/indicate-eval true)
#js {:status "success"
Expand Down