Fix #5287: Handle JS objects in MatchError.getMessage().#5288
Fix #5287: Handle JS objects in MatchError.getMessage().#5288sjrd merged 2 commits intoscala-js:mainfrom
Conversation
Copied as of v2.13.17 of the upstream repo.
f24700c to
27dbc1c
Compare
gzm0
left a comment
There was a problem hiding this comment.
IIUC to fix the immediate problem, this is a good approach.
Would it make sense to add some discussion about adjusting getClass?
IIUC at this point, it feels odd that getClass returns null, rather than a "special" jl.Class (in the spirit of: if it links, it's correct). Of course, changing this, would be quite the breaking change, likely for a lot of SJS code itself.
Maybe, we should add a tracking issue for 2.x to re-consider?
|
I briefly thought about that. It's definitely 2.x material: it's a run-time breaking change of something that's definitely working as intended. We have tests for that behavior. (I thought it was listed in https://www.scala-js.org/doc/semantics.html, but apparently not. I'll need to add that.) I don't think it breaks the spirit of "if it links, it works". To get a But there's no denying that there can be some undesirable consequences, like this particular issue. We could revisit. |
I'm not sure I fully agree with this TBH. I think mostly because "manipulating JS-specific things" is a global property: when targeting Scala.js, you have to assume JS specific things are manipulated. As a result, breaking a base JVM assumption ( In any case, I agree the discussion is somewhat moot for the current compatibility line. I'll just file the 2.x issue. |
And forward-port scala-js/scala-js#5288
Forward port of scala-js/scala-js#5288 [Cherry-picked bab8e0d]
No description provided.