The Error constructor parameter is incorrect here:
|
throw new Error("Unsupported an advertisement type: ", adType); |
According to MDN the second parameter for the Error constructor is an optional filename: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/Error
I think the line should say:
throw new Error("Unsupported an advertisement type: " + adType);
It seems that in other places of the code (like preloadAd) it is correct (although to be precise it's missing the whitespace after the colon):
|
throw new Error("Unsupported an advertisement type:" + adType); |