diff --git a/src/core/primitives.js b/src/core/primitives.js index 39eddf984..a1e83b165 100644 --- a/src/core/primitives.js +++ b/src/core/primitives.js @@ -171,7 +171,14 @@ var Dict = (function DictClosure() { }, }; - Dict.empty = new Dict(null); + Dict.empty = (function () { + const emptyDict = new Dict(null); + + emptyDict.set = (key, value) => { + unreachable("Should not call `set` on the empty dictionary."); + }; + return emptyDict; + })(); Dict.merge = function ({ xref, dictArray, mergeSubDicts = false }) { const mergedDict = new Dict(xref);