There is not, you could write a wrapper to do that. Object.freeze locks an object’s properties, but while Map instances are objects, the values they store are not properties, so freezing has no effect on them, just like any other class that has internal state hidden away.
In a real ES6 environment where extending builtins is supported (not Babel), you could do this:
class FreezableMap extends Map {
set(...args){
if (Object.isFrozen(this)) return this;
return super.set(...args);
}
delete(...args){
if (Object.isFrozen(this)) return false;
return super.delete(...args);
}
clear(){
if (Object.isFrozen(this)) return;
return super.clear();
}
}
If you need to work in ES5 environments, you could easily make a wrapper class for a Map rather than extending the Map class.