File tree 2 files changed +11
-2
lines changed
compiler/src/dotty/tools/backend/sjs
2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -2932,7 +2932,11 @@ class JSCodeGen()(using genCtx: Context) {
2932
2932
case TYPEOF =>
2933
2933
// js.typeOf(arg)
2934
2934
val arg = genArgs1
2935
- genAsInstanceOf(js.JSUnaryOp (js.JSUnaryOp .typeof, arg), defn.StringType )
2935
+ val typeofExpr = arg match {
2936
+ case arg : js.JSGlobalRef => js.JSTypeOfGlobalRef (arg)
2937
+ case _ => js.JSUnaryOp (js.JSUnaryOp .typeof, arg)
2938
+ }
2939
+ js.AsInstanceOf (typeofExpr, jstpe.ClassType (jsNames.BoxedStringClass ))
2936
2940
2937
2941
case STRICT_EQ =>
2938
2942
// js.special.strictEquals(arg1, arg2)
Original file line number Diff line number Diff line change @@ -1009,6 +1009,12 @@ object Build {
1009
1009
scalaJSLinkerConfig ~= { _.withSemantics(build.TestSuiteLinkerOptions .semantics _) },
1010
1010
scalaJSModuleInitializers in Test ++= build.TestSuiteLinkerOptions .moduleInitializers,
1011
1011
1012
+ jsEnvInput in Test := {
1013
+ val resourceDir = fetchScalaJSSource.value / " test-suite/js/src/test/resources"
1014
+ val f = (resourceDir / " NonNativeJSTypeTestNatives.js" ).toPath
1015
+ org.scalajs.jsenv.Input .Script (f) +: (jsEnvInput in Test ).value
1016
+ },
1017
+
1012
1018
managedSources in Compile ++= {
1013
1019
val dir = fetchScalaJSSource.value / " test-suite/js/src/main/scala"
1014
1020
val filter = (
@@ -1049,7 +1055,6 @@ object Build {
1049
1055
-- " ExportsTest.scala" // JS exports
1050
1056
-- " IterableTest.scala" // non-native JS classes
1051
1057
-- " JSExportStaticTest.scala" // JS exports
1052
- -- " JSNativeInPackage.scala" // #9785 tests fail due to js.typeOf(globalVar) being incorrect
1053
1058
-- " JSOptionalTest.scala" // non-native JS classes
1054
1059
-- " JSSymbolTest.scala" // non-native JS classes
1055
1060
-- " MiscInteropTest.scala" // non-native JS classes
You can’t perform that action at this time.
0 commit comments