Skip to content

Commit

Permalink
Use default semantics depending on optimalization mode
Browse files Browse the repository at this point in the history
  • Loading branch information
MaciejG604 committed Dec 6, 2023
1 parent 7cff624 commit ab66170
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/.bsp/
out/
.idea/
8 changes: 6 additions & 2 deletions cli/src/org/scalajs/cli/Scalajsld.scala
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,10 @@ object Scalajsld {
.valueName("<dir>")
.action { (x, c) => c.copy(outputDir = Some(x)) }
.text("Output directory of linker (required)")
// "By default, undefined behaviors are in Fatal mode for fastLinkJS and in Unchecked mode for fullLinkJS"
// taken from: https://www.scala-js.org/doc/semantics.html#undefined-behaviors
opt[Unit]('f', "fastOpt")
.action { (_, c) => c.copy(noOpt = false, fullOpt = false) }
.action { (_, c) => c.copy(noOpt = false, fullOpt = false, semantics = Semantics.Defaults) }
.text("Optimize code (this is the default)")
opt[Unit]('n', "noOpt")
.action { (_, c) => c.copy(noOpt = true, fullOpt = false) }
Expand All @@ -136,8 +138,10 @@ object Scalajsld {
.text("Pattern for JS file names (default: `%s.js`). " +
"Expects a printf-style pattern with a single placeholder for the module ID. " +
"A typical use case is changing the file extension, e.g. `%.mjs` for Node.js modules.")
// "By default, undefined behaviors are in Fatal mode for fastLinkJS and in Unchecked mode for fullLinkJS"
// taken from: https://www.scala-js.org/doc/semantics.html#undefined-behaviors
opt[Unit]('u', "fullOpt")
.action { (_, c) => c.copy(noOpt = false, fullOpt = true) }
.action { (_, c) => c.copy(noOpt = false, fullOpt = true, semantics = Semantics.Defaults.optimized) }
.text("Fully optimize code (uses Google Closure Compiler)")
opt[Unit]('p', "prettyPrint")
.action { (_, c) => c.copy(prettyPrint = true) }
Expand Down

0 comments on commit ab66170

Please sign in to comment.