ClojureScript

Self-host: cljs.compiler/munge doesn't preserve JVM compiler semantics

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: 1.9.655
  • Component/s: None
  • Labels:
    None
  • Patch:
    Code and Test

Activity

Hide
António Nuno Monteiro added a comment -

Attached patch with fix and test.

Show
António Nuno Monteiro added a comment - Attached patch with fix and test.
Hide
Mike Fikes added a comment -

FWIW, I tried the attached patch downstream with Planck and it worked. Prior to the patch, I observed this behavior:

cljs.user=> (.catch (js/Promise. #(%2 "x")) #(println %))
(new Promise((function (p1__20_SHARP_,p2__19_SHARP_){
return p2__19_SHARP_.call(null,"x");
}))).catch$ is not a function. (In '(new Promise((function (p1__20_SHARP_,p2__19_SHARP_){
return p2__19_SHARP_.call(null,"x");
}))).catch$((function (p1__21_SHARP_){
return cljs.core.println.call(null,p1__21_SHARP_);
}))', '(new Promise((function (p1__20_SHARP_,p2__19_SHARP_){
return p2__19_SHARP_.call(null,"x");
}))).catch$' is undefined)

And with the patch:

cljs.user=> (.catch (js/Promise. #(%2 "x")) #(println %))
x
#object[Promise [object Promise]]
Show
Mike Fikes added a comment - FWIW, I tried the attached patch downstream with Planck and it worked. Prior to the patch, I observed this behavior:
cljs.user=> (.catch (js/Promise. #(%2 "x")) #(println %))
(new Promise((function (p1__20_SHARP_,p2__19_SHARP_){
return p2__19_SHARP_.call(null,"x");
}))).catch$ is not a function. (In '(new Promise((function (p1__20_SHARP_,p2__19_SHARP_){
return p2__19_SHARP_.call(null,"x");
}))).catch$((function (p1__21_SHARP_){
return cljs.core.println.call(null,p1__21_SHARP_);
}))', '(new Promise((function (p1__20_SHARP_,p2__19_SHARP_){
return p2__19_SHARP_.call(null,"x");
}))).catch$' is undefined)
And with the patch:
cljs.user=> (.catch (js/Promise. #(%2 "x")) #(println %))
x
#object[Promise [object Promise]]

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: