Skip to content

Commit

Permalink
add "use strict" when checking transpile
Browse files Browse the repository at this point in the history
  • Loading branch information
tmdghks committed Jan 18, 2025
1 parent 7546926 commit 228e73b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/main/scala/esmeta/es/util/Coverage.scala
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,14 @@ case class Coverage(
case Some(blockScript) => blockingScripts += blockScript

if (updated)
val isSwcMinifiable = Minifier.checkMinifyDiffSrv(code, Some("swc"))
val codeWithUseStrict = USE_STRICT + code
val isSwcMinifiable = Minifier.checkMinifyDiffSrv(codeWithUseStrict, Some("swc"))
val isTerserMinifiable =
Minifier.checkMinifyDiffSrv(code, Some("terser"))
Minifier.checkMinifyDiffSrv(codeWithUseStrict, Some("terser"))
val isSwcES2015Transpilable =
Minifier.checkMinifyDiffSrv(code, Some("swcES2015"))
Minifier.checkMinifyDiffSrv(codeWithUseStrict, Some("swcES2015"))
val isBabelTranspilable =
Minifier.checkMinifyDiffSrv(code, Some("babel"))
Minifier.checkMinifyDiffSrv(codeWithUseStrict, Some("babel"))

_minimalInfo += script.name -> ScriptInfo(
ConformTest.createTest(cfg, finalSt),
Expand Down

0 comments on commit 228e73b

Please sign in to comment.