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)
@@ -383,11 +383,11 @@ class WasmBuilder {
383
383
)
384
384
ctx.addFunction(func)
385
385
386
- val export = new WasmExport .Function (
386
+ val exprt = new WasmExport .Function (
387
387
methodName.value,
388
388
func
389
389
)
390
- ctx.addExport(export )
390
+ ctx.addExport(exprt )
391
391
}
392
392
393
393
private def genFunction (
Original file line number Diff line number Diff line change @@ -134,7 +134,7 @@ class WasmModule(
134
134
def addFunctionType (typ : WasmFunctionType ): Unit = _functionTypes.addOne(typ)
135
135
def addRecGroupType (typ : WasmStructType ): Unit = _recGroupTypes.addOne(typ)
136
136
def addGlobal (typ : WasmGlobal ): Unit = _globals.addOne(typ)
137
- def addExport (export : WasmExport [_]) = _exports.addOne(export )
137
+ def addExport (exprt : WasmExport [_]) = _exports.addOne(exprt )
138
138
139
139
def functionTypes = _functionTypes.toList
140
140
def recGroupTypes = WasmModule .tsort(_recGroupTypes.toList)
@@ -158,8 +158,8 @@ object WasmModule {
158
158
} else {
159
159
val found = noPreds.map { _._1 }.toSet
160
160
val updated = hasPreds.map {
161
- case (k, Some (v)) => // should be safe because hasPreds has no None
162
- (k, if ( found.contains(v)) None else Some (v ))
161
+ case (k, v) =>
162
+ (k, v.filter( ! found.contains(_) ))
163
163
}
164
164
tsort(updated, done ++ found)
165
165
}
Original file line number Diff line number Diff line change @@ -124,7 +124,7 @@ trait FunctionTypeWriterWasmContext extends ReadOnlyWasmContext { this: WasmCont
124
124
125
125
class WasmContext (val module : WasmModule ) extends FunctionTypeWriterWasmContext {
126
126
import WasmContext ._
127
- def addExport (export : WasmExport [_]): Unit = module.addExport(export )
127
+ def addExport (exprt : WasmExport [_]): Unit = module.addExport(exprt )
128
128
def addFunction (fun : WasmFunction ): Unit = {
129
129
module.addFunction(fun)
130
130
functions.define(fun)
You can’t perform that action at this time.
0 commit comments