This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-05-02
Channels
- # announcements (7)
- # aws (3)
- # babashka (132)
- # beginners (38)
- # calva (3)
- # chlorine-clover (6)
- # clara (1)
- # clj-kondo (20)
- # cljs-dev (24)
- # cljsrn (9)
- # clojure (76)
- # clojure-dev (1)
- # clojure-germany (4)
- # clojure-india (2)
- # clojure-uk (24)
- # clojurescript (15)
- # conf-proposals (1)
- # conjure (114)
- # cursive (3)
- # fulcro (63)
- # graalvm (1)
- # helix (2)
- # joker (10)
- # juxt (1)
- # local-first-clojure (2)
- # meander (9)
- # off-topic (97)
- # rdf (4)
- # re-frame (7)
- # reagent (16)
- # reitit (1)
- # rum (9)
- # shadow-cljs (48)
- # spacemacs (3)
- # tools-deps (3)
- # vim (30)
- # xtdb (10)
@dnolen I'm still seeing delete be munged to delete$ with :language-out set to :es-next. It appears that :es5 first allowed delete to be used as a method.
I'm not sure if this particular version should work, but it's one instance of the problem:
❯ clj -Sdeps '{:deps {org.clojure/clojurescript {:mvn/version "1.10.748"}}}' -m cljs.main -co '{:language-out :es5}' --repl
ClojureScript 1.10.748
cljs.user=> (str (fn [] (js/window.delete)))
"function (){\nreturn window.delete$();\n}"
cljs.user=>
https://github.com/clojure/clojurescript/blob/master/src/main/clojure/cljs/analyzer.cljc#L198 given that I can get default to work, I suspect it's to do with this?
Found a regression (not in 1.10.753, but in 1.10.741): https://clojure.atlassian.net/browse/CLJS-3244 (This is why Planck started failing in Canary, but it took me a while to track down as an upstream compiler issue.)
^ Regressed with patch to https://clojure.atlassian.net/browse/CLJS-2957
@dominicm can you say more simply what the bug is :es-next
does not work, but :es6
and :es5
do?
@dnolen Oops, I shouldn't have said ":es5 first allowed delete", I should have said "es5 first allowed...". None of the clojurescript languages support delete right now.
@dominicm that's a bit odd since that's exactly what somebody tried the other day and it worked for them.
Yeah, default is explicitly whitelisted it seems. I think delete just needs adding to that list. I'm not sure if there's a list of the keywords that were added in es5
@dominicm if you do that patch, it would be nice to just fix this up to include whatever reserved things became non-reserved
@dominicm tests would be nice, but if you don't do that I can easily add those to test the different compiler settings
@mfikes thanks bumped to blocker though I think probably trivial - I suspect there's just a bad var in that file
Oh god, my eyes: > For web browsers, there is an exception to this rule, namely when reserved words are used. Most browsers support identifiers that unescape to a reserved word, as long as at least one character is escaped using a Unicode escape sequence. For example, var var; wouldn’t work, but e.g. var v\u0061r; would
I'm working on this minor self-host regression: https://clojure.atlassian.net/browse/CLJS-3245
looking closer, as far a I can tell function delete(){ }
is not supported, but let x = {}; x.delete = function() { return 10 }
works. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Property_accessors notes that properties must be an "IdentifierName", which means they can be any reserved keyword. That goes all the way back given the wording.