All files / src/Ice TypeRegistry.js

100% Statements 31/31
100% Branches 5/5
100% Functions 4/4
100% Lines 31/31

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 3241x 41x 41x 41x 41x 41x 41x 41x 41x 41x 41x 1653x 1653x 1653x 1653x 41x 41x 1109x 1109x 1109x 1109x 1109x 41x 41x 193x 193x 41x 41x 430x 430x 41x  
// Copyright (c) ZeroC, Inc.
 
// The proxyTypes maps contains entries for proxy types. To support forward declarations of interface types.
const proxyTypes = new Map();
 
// The valueTypes maps contains entries for value types (types derived from Ice.Value). To support forward declarations
// of classes.
const valueTypes = new Map();
 
export class TypeRegistry {
    static declareProxyType(name, type) {
        if (proxyTypes.get(name) === undefined) {
            proxyTypes.set(name, type);
        }
    }
 
    static declareValueType(name, type) {
        if (valueTypes.get(name) === undefined) {
            valueTypes.set(name, type);
        }
        return type;
    }
 
    static getProxyType(name) {
        return proxyTypes.get(name);
    }
 
    static getValueType(name) {
        return valueTypes.get(name);
    }
}