This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-05-03
Channels
- # aleph (6)
- # announcements (4)
- # babashka (73)
- # beginners (117)
- # calva (25)
- # chlorine-clover (59)
- # cider (21)
- # clara (3)
- # cljdoc (8)
- # cljs-dev (54)
- # cljsrn (15)
- # clojure (65)
- # clojure-france (5)
- # clojure-spec (3)
- # clojure-uk (13)
- # clojurescript (79)
- # conf-proposals (1)
- # conjure (17)
- # core-logic (11)
- # datomic (21)
- # fulcro (82)
- # graalvm (11)
- # helix (7)
- # jobs-discuss (11)
- # joker (2)
- # juxt (3)
- # local-first-clojure (1)
- # luminus (5)
- # nrepl (61)
- # off-topic (12)
- # pathom (70)
- # re-frame (3)
- # reitit (3)
- # rum (1)
- # shadow-cljs (58)
- # sql (1)
- # tools-deps (26)
- # xtdb (3)
@dominicm the problem is that's only true for modern JS environments - if you think about back when this was done this was to prevent bad code gen - stuff that couldn't be loaded
@dnolen in that case this feels separate from es5 or not, and is to do with some other aspect of the environment. It's possible to have an es3 environment with a method named x.delete.
In any environment, if you use an interop form it should do exactly as I say. The language in/out doesn't matter.
@dnolen there is no ECMA-262 for 2001. There's 2011 and 1999 (and 2009 in the middle). Which did you mean?
however I agree it's 20 years later and it's pretty rare to run into a JS runtime now that has this problem
Okay. You're right :) In 3rd edition it was an identifier. I should be more careful. So from ES5+ all reserved keywords are available as property names (which I will now verify too!)
(11.2.1 "Property Accessors" in the 3ed uses "Identifier", which cannot be a reserved name)
so ... I think your idea is still fine, I think we can make this work in the dot property emission part of the compiler
I think you can just check to see if reserved, if so and the language setting is ok, skip munging
@dnolen yeah, we already have the es5-whitelist or something, I think any places that use that need changing.
https://clojure.atlassian.net/browse/CLJS-3247 created ticket & uploaded patch. No tests, but happy to write them. Will need a little guidance on how & placement.
great thanks, I'll have to take a look later - looking into other regression tickets today
No rush :). Playing around with this ticket I noted that ((.-delete window))
seems to work... so if I can get externs inference to play nice with that I'll be golden. I can't update until figwheel-main is updated anyway.
I noticed with Reagent node module processing test suite that 753 doesn't work with default language-out, but works with :es5
. Any idea idea if this is something already known or expected? Problem is with $jscomp
name, which I think is from Closure polyfills for Object methods used by object-assign
. (In this case the es3 output is 8KB vs 3KB for es5 output due to polyfills.)
Or the name might be ok, but a file that initializes $jscomp
object is missing.
Closure has the name written like that: https://github.com/google/closure-compiler/blob/3aaf3475128e8f7e398a42b3400256aee4870bbe/src/com/google/javascript/jscomp/js/util/polyfill.js#L26 so doesn't seem like problem with munging
@juhoteperi my understanding is that it's expected, certainly not new?
This worked in 597
Probably caused by Closure compiler update
I'll just set language-out to es5. Doesn't seem important enough to investigate why es3 doesn't work.
@mfikes I realizing this is probably why https://clojure.atlassian.net/browse/CLJS-3244#icft=CLJS-3244 is so strange
Might be related to the recent "protocol static dispatch inlining"... let me find that commit
^ this was really about just making it easier for runtimes to inline stuff, that's all
FWIW, I tried an experiment reverting CLJS-3185 and the problem persists (and the line numbers are still off), so maybe CLJS-3185 is unrelated.