This repository was archived by the owner on Jul 12, 2024. It is now read-only.
File tree 4 files changed +18
-8
lines changed
4 files changed +18
-8
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,16 @@ import org.scalajs.linker.interface.OutputPatterns
2
2
3
3
val scalaV = " 2.13.12"
4
4
5
+ inThisBuild(Def .settings(
6
+ scalacOptions ++= Seq (
7
+ " -encoding" ,
8
+ " utf-8" ,
9
+ " -feature" ,
10
+ " -deprecation" ,
11
+ " -Xfatal-warnings" ,
12
+ )
13
+ ))
14
+
5
15
lazy val cli = project
6
16
.in(file(" cli" ))
7
17
.enablePlugins(ScalaJSPlugin )
Original file line number Diff line number Diff line change @@ -32,9 +32,9 @@ class WasmBuilder {
32
32
}
33
33
}
34
34
35
- def transformTopLevelExport (export : LinkedTopLevelExport )(implicit ctx : WasmContext ): Unit = {
35
+ def transformTopLevelExport (topLevelExport : LinkedTopLevelExport )(implicit ctx : WasmContext ): Unit = {
36
36
implicit val fctx = WasmFunctionContext ()
37
- export .tree match {
37
+ topLevelExport .tree match {
38
38
case d : IRTrees .TopLevelFieldExportDef => ???
39
39
case d : IRTrees .TopLevelJSClassExportDef => ???
40
40
case d : IRTrees .TopLevelMethodExportDef => transformToplevelMethodExportDef(d)
@@ -370,11 +370,11 @@ class WasmBuilder {
370
370
)
371
371
ctx.addFunction(func)
372
372
373
- val export = new WasmExport .Function (
373
+ val exprt = new WasmExport .Function (
374
374
methodName.value,
375
375
func
376
376
)
377
- ctx.addExport(export )
377
+ ctx.addExport(exprt )
378
378
}
379
379
380
380
private def genFunction (
Original file line number Diff line number Diff line change @@ -133,7 +133,7 @@ class WasmModule(
133
133
def addFunctionType (typ : WasmFunctionType ): Unit = _functionTypes.addOne(typ)
134
134
def addRecGroupType (typ : WasmStructType ): Unit = _recGroupTypes.addOne(typ)
135
135
def addGlobal (typ : WasmGlobal ): Unit = _globals.addOne(typ)
136
- def addExport (export : WasmExport [_]) = _exports.addOne(export )
136
+ def addExport (exprt : WasmExport [_]) = _exports.addOne(exprt )
137
137
138
138
def functionTypes = _functionTypes.toList
139
139
def recGroupTypes = WasmModule .tsort(_recGroupTypes.toList)
@@ -157,8 +157,8 @@ object WasmModule {
157
157
} else {
158
158
val found = noPreds.map { _._1 }.toSet
159
159
val updated = hasPreds.map {
160
- case (k, Some (v)) => // should be safe because hasPreds has no None
161
- (k, if ( found.contains(v)) None else Some (v ))
160
+ case (k, v) =>
161
+ (k, v.filter( ! found.contains(_) ))
162
162
}
163
163
tsort(updated, done ++ found)
164
164
}
Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ trait FunctionTypeWriterWasmContext extends ReadOnlyWasmContext { this: WasmCont
96
96
97
97
class WasmContext (val module : WasmModule ) extends FunctionTypeWriterWasmContext {
98
98
import WasmContext ._
99
- def addExport (export : WasmExport [_]): Unit = module.addExport(export )
99
+ def addExport (exprt : WasmExport [_]): Unit = module.addExport(exprt )
100
100
def addFunction (fun : WasmFunction ): Unit = {
101
101
module.addFunction(fun)
102
102
functions.define(fun)
You can’t perform that action at this time.
0 commit comments