Skip to content

Support String.Join with objects - #1058

Merged
alfonsogarciacaro merged 1 commit into
fable-compiler:masterfrom
i-p:string-join-objects
Jul 10, 2017
Merged

alfonsogarciacaro merged 1 commit into
fable-compiler:masterfrom
i-p:string-join-objects

Conversation

@i-p

@i-p i-p commented Jul 10, 2017

Copy link
Copy Markdown
Contributor

Implementation of "join" function in JS is missing a call to "toString" for every value and doesn't process multiple non-string arguments.

As a result, following tests return [object Object]--[object Object] and an empty string when compiled to JS:

     System.String.Join("--", [|3I; 5I|])
      |> equal "3--5"
      System.String.Join("--", 3I, 5I)
      |> equal "3--5"

@alfonsogarciacaro

Copy link
Copy Markdown
Member

Thanks!

@alfonsogarciacaro
alfonsogarciacaro merged commit 2486612 into fable-compiler:master Jul 10, 2017
fable-repo-assist Bot added a commit that referenced this pull request Apr 26, 2026
Fix code scanning alerts IONIDE-009 (alerts #1056-#1058, #1069-#1070, #1083)
and IONIDE-002 (alerts #1065, #1072, #1181).

- Add [<return: Struct>] to partial active patterns in BabelPrinter.fs and
  Python transforms to avoid heap allocation for option types
- Replace [] postfix array syntax with the idiomatic 'array' postfix syntax
  in BabelPrinter.fs, Fable2Python.Util.fs, and Python.AST.fs

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants