I'm using map from 'core-js/feature/map'. By calling has on the map I get an Error as follows:
ERROR: org.mozilla.javascript.EcmaError: TypeError: Expected argument of type object, but instead had type object
The error is thrown in line 16 (if (this.playerStateMap.has(user)) {) of
var RoulettePlayerManager = /** @class */ (function () {
function RoulettePlayerManager(gameManager) {
this.gameManager = gameManager;
this.playerStateMap = new Map();
}
RoulettePlayerManager.prototype.placeBet = function (user, data) {
var buyIn = data;
var betSum = buyIn.betAmountPurple + buyIn.betAmountGreen + buyIn.betAmountBlue + buyIn.betAmountYellow;
if (1 <= betSum &&
betSum <=
user
.getKnuddelAccount()
.getKnuddelAmount()
.asNumber()) {
user.getKnuddelAccount().use(KnuddelAmount.fromKnuddel(betSum), BET_TEXT);
if (this.playerStateMap.has(user)) {
this.playerStateMap.set(user, new PlayerState_1.PlayerState(user, this.gameManager, data));
}
else {
this.playerStateMap.get(user).updateBet(data);
}
}
};
return RoulettePlayerManager;
}());
The code is running in a java applications rhino engine.
I tried to import the full core-js lib but it didn't change anything.