@@ -1263,7 +1263,27 @@ object Serializers {
1263
1263
1264
1264
case TagJSNew => JSNew (readTree(), readTreeOrJSSpreads())
1265
1265
case TagJSPrivateSelect => JSPrivateSelect (readTree(), readFieldIdent())
1266
- case TagJSSelect => JSSelect (readTree(), readTree())
1266
+ case TagJSSelect =>
1267
+ readTree() match {
1268
+ case qualifier : JSLinkingInfo if hacks.use16 =>
1269
+ readTree() match {
1270
+ case StringLiteral (" productionMode" ) =>
1271
+ LinkTimeProperty (" core/productionMode" )(BooleanType )
1272
+ case StringLiteral (" esVersion" ) =>
1273
+ LinkTimeProperty (" core/esVersion" )(IntType )
1274
+ case StringLiteral (" assumingES6" ) =>
1275
+ LinkTimeProperty (" core/assumingES6" )(BooleanType )
1276
+ case StringLiteral (" isWebAssembly" ) =>
1277
+ LinkTimeProperty (" core/isWebAssembly" )(BooleanType )
1278
+ case StringLiteral (" version" ) =>
1279
+ LinkTimeProperty (" core/linkerVersion" )(StringType )
1280
+ case item =>
1281
+ throw new IOException (
1282
+ s " Found invalid field access ${item.show} on JSLinkingInfo. " )
1283
+ }
1284
+ case qualifier =>
1285
+ JSSelect (qualifier, readTree())
1286
+ }
1267
1287
case TagJSFunctionApply => JSFunctionApply (readTree(), readTreeOrJSSpreads())
1268
1288
case TagJSMethodApply => JSMethodApply (readTree(), readTree(), readTreeOrJSSpreads())
1269
1289
case TagJSSuperSelect => JSSuperSelect (readTree(), readTree(), readTree())
@@ -1283,8 +1303,19 @@ object Serializers {
1283
1303
JSObjectConstr (List .fill(readInt())((readTree(), readTree())))
1284
1304
case TagJSGlobalRef => JSGlobalRef (readString())
1285
1305
case TagJSTypeOfGlobalRef => JSTypeOfGlobalRef (readTree().asInstanceOf [JSGlobalRef ])
1286
- case TagJSLinkingInfo => JSLinkingInfo ()
1287
-
1306
+ case TagJSLinkingInfo =>
1307
+ if (hacks.use16) {
1308
+ JSObjectConstr (List (
1309
+ (StringLiteral (" productionMode" ), LinkTimeProperty (" core/productionMode" )(BooleanType )),
1310
+ (StringLiteral (" esVersion" ), LinkTimeProperty (" core/esVersion" )(IntType )),
1311
+ (StringLiteral (" assumingES6" ), LinkTimeProperty (" core/assumingES6" )(BooleanType )),
1312
+ (StringLiteral (" isWebAssembly" ), LinkTimeProperty (" core/isWebAssembly" )(BooleanType )),
1313
+ (StringLiteral (" version" ), LinkTimeProperty (" core/linkerVersion" )(StringType ))
1314
+ ))
1315
+ } else {
1316
+ throw new IOException (
1317
+ s " Found invalid pre-1.16 JSLinkingInfo def at ${pos}" )
1318
+ }
1288
1319
case TagUndefined => Undefined ()
1289
1320
case TagNull => Null ()
1290
1321
case TagBooleanLiteral => BooleanLiteral (readBoolean())
0 commit comments