This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
public sealed class Container | |
{ | |
private Dictionary<Type, Type> concreteTypes = new Dictionary<Type, Type>(); | |
private Dictionary<Type, object> objects = new Dictionary<Type, object>(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function objectMap () { | |
return Object.defineProperty(Object.create(null), Symbol.iterator, { | |
configurable: true, // This descriptor is inspired by Map.prototype[Symbol.iterator] | |
writable: true, | |
value: function* () { | |
for (const key in this) { | |
yield [key, this[key]] | |
} | |
} | |
}) |
OlderNewer